  // updates the city combo box. it gets called when the country combo box changes
  function updateCityComboBox(countryControl)
  {
    var curForm = countryControl.form;
    var countryid = curForm.countryId;    var cityid = curForm.cityId;

    updateCurrencyTextInForm(curForm);

    // Empty the city drop down box of any choices
    for (var q=cityid.options.length;q>=0;q--) 
        cityid.options[q]=null;

    // Now loop through the array of cities. Any containing the same group id as the
    // country id are added to the cities dropdown box
    var x;
    for ( x = 0 ; x < cityIdArr.length  ; x++ )
    {
 	if (displayAllCities == false && cityIdArr[x] == 101) // Handle All Cities
	{
		continue;
	}
	if ( cityGrpArr[x] == countryid.value )
        {
	  cityid[cityid.length] = new Option(cityNmArr[x], cityIdArr[x]);
        }
    }
  }
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
  // update the pcity text input. This is called when the city is set to other
  function	updatePCityInputText(cityControl)
  {
    var curForm = cityControl.form;

    // if city is other
    if (cityControl.value == 100)
    {
        curForm.pcity.disabled = false;
    }
    else
    {
        curForm.pcity.disabled = true; curForm.pcity.value = "";
    }
  }
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
  function update2CurrencyTextInForm(form1, form2)
  {
	updateCurrencyTextInForm(form1);
	updateCurrencyTextInForm(form2);
  }
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
  // sets the currency to Rs/$ etc depending on the country in the form
  function updateCurrencyTextInForm(curForm)
  {
	// form the currency tag name from the hidden field in the form.
	var currencyTagName = curForm.currencyTag.value+"_currency";
	//alert(currencyTagName);

	var curr = "Rs.";
	if (curForm.countryId.value == "1")
		curr = "Rs.";
	if (curForm.countryId.value != "1")
		curr = "$";

	// get all the element whose id is currencyTagName. NOT name, as the method name suggests.
	var arr=document.getElementsByName(currencyTagName);
	for (var i=0;i<arr.length;i++)
	{
		arr[i].innerHTML = curr;
	}

	/*
      	if (document.getElementById) 
     	{
              	document.getElementById("currency1").innerHTML = curr;
         	}
     	else if (document.all) 
     	{
        		document.all["currency1"].innerHTML = curr;
    	}
	*/
  }
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
