/*****************************************************************************
' Copyright: 2003 redZ
'
' Proprietary Rights Notice:
'    All rights reserved.  This material contains the valuable properties and trade
'    secrets of redZ, incorporated in the state of New South Wales in Australia,
'    and embodies substantial creative effort, confidential information, ideas and
'    expressions, no part of which may be reproduced or transmitted in any form or by any
'    means, electronic, mechanical, or otherwise, including photographic and recording or
'    in connection with any information storage or retrieval system without the permission
'    in writing from redZ.
*****************************************************************************/

var bol_ie4 = (document.all) ? true : false;
var bol_ns4 = (document.layers) ? true : false;
var bol_ns6 = (document.getElementById && !document.all) ? true : false;

function txtjsHideLayer(str_layer_id)
/********************************************************************************
' Purpose : Hides a later
'
' Params  : IN  str_layer_id    = ID of layer to hide
'
' Return  : None
'********************************************************************************/
{
   if (bol_ie4) {document.all[str_layer_id].style.visibility = "hidden";}
   if (bol_ns4) {document.layers[str_layer_id].visibility = "hide";}
   if (bol_ns6) {document.getElementById([str_layer_id]).style.display = "none";}
}

function txtjsShowLayer(str_layer_id)
/********************************************************************************
' Purpose : Shows a Later
'
' Params  : IN  str_layer_id    = ID of layer to show
'
' Return  : None
'********************************************************************************/
{
   if (bol_ie4) {document.all[str_layer_id].style.visibility = "visible";}
   if (bol_ns4) {document.layers[str_layer_id].visibility = "show";}
   if (bol_ns6) {document.getElementById([str_layer_id]).style.display = "block";}
}


function txtjsWriteToLayer(str_layer_id, str_text)
/********************************************************************************
' Purpose : Changes the text of a layer
'
' Params  : IN  str_layer_id    = ID of layer to show
'           IN  str_text        = Text to display
'
' Return  : None
'********************************************************************************/
{
   if (bol_ie4) {
      document.all[str_layer_id].innerHTML = str_text;
      }

   if (bol_ns4) {
      document[str_layer_id].document.write(str_text);
      document[str_layer_id].document.close();
      }

   if (bol_ns6) {
      over = document.getElementById([str_layer_id]);
      range = document.createRange();
      range.setStartBefore(over);
      domfrag = range.createContextualFragment(str_text);
      while (over.hasChildNodes()) {
         over.removeChild(over.lastChild);
         }
      over.appendChild(domfrag);
      }
}


function jsPopulateSelect(js_obj_select, js_array_value, js_array_text)
/********************************************************************************
' Purpose : Populate the select list
'
' Params  : IN  js_obj_select    = Select list to populate
'           IN  js_array_value   = Option values
'           IN  js_array_text    = Option text
'
' Return  : None
'********************************************************************************/
{
   js_obj_select.options.length = 0;
   var js_obj_no = new Option();
   js_obj_no.value = '';
   js_obj_no.text = 'Select Country...';
   js_obj_select.options.length = js_obj_select.options.length + 1;
   js_obj_select[js_obj_select.options.length - 1] = js_obj_no;

   for (var js_int_work = 0; js_int_work < js_array_value.length; js_int_work++)   {
      js_obj_no = new Option();
      js_obj_no.value = js_array_value[js_int_work];
      js_obj_no.text = js_array_text[js_int_work];
      js_obj_select.options.length = js_obj_select.options.length + 1;
      js_obj_select[js_obj_select.options.length - 1] = js_obj_no;
      }
}

function jsUpdateRate(js_obj_select, js_str_display)
/********************************************************************************
' Purpose : Populate the select list
'
' Params  : IN  js_obj_select    = Select option to display
'           IN  js_str_display   = Div area to write to
'
' Return  : None
'********************************************************************************/
{
   var js_int_selected = -1;
   var js_str_work = '';

   if (js_obj_select.selectedIndex > 0)
      js_str_work = js_obj_select.options[js_obj_select.selectedIndex].text + ' = ' + js_obj_select.value + ' per min.'

   txtjsWriteToLayer(js_str_display, js_str_work);
   return;
}

function pageLoadFunctions()
{
   jsPopulateSelect(document.frmCon.TXT_COUNTRY, js_m_obj_country_rate, js_m_obj_country_text);
   return;
}

