var ddvisi = new Array(2);
ddvisi["country"]=false;
ddvisi["l_country"]=false;
var doit = new Array(2);
doit["country"]   = false;
doit["l_country"] = false;

try
{
 	doit["country"] = document.form1.ncountry.selectedIndex;
 	//doit["country"] = document.getElementById('country');
}
catch(e)
{
	doit["country"] = false;
}

try
{
  doit["l_country"] = document.form1.nl_country.selectedIndex; 
  //doit["l_country"] = document.getElementById('l_country');
}
catch(e)
{
 	doit["l_country"] = false;
}

function showsubctry(elname)
{
	if(elname=="" || elname==undefined) elname="country"; 
	if(elname=="l_country" && doit["l_country"]==1) id=document.form1.nl_country[document.form1.nl_country.selectedIndex].value;
  else if(doit["country"]) id=document.form1.ncountry[document.form1.ncountry.selectedIndex].value;
  else return;

  if(ctry[id] != false)
  {
  	document.getElementById(elname).innerHTML="<select name=nsub"+elname+">"+ctry[id]+"</select>\n";
    document.getElementById(elname).style.visibility='visible';
    ddvisi[elname] = true;
  }
  else
  {
    document.getElementById(elname).innerHTML="";
    document.getElementById(elname).style.visibility='hidden';
    ddvisi[elname] = false;
  }
}

function selectsubctry(toselect, elname)
{
  if(elname=="" || elname==undefined) elname="country";
	if(doit[elname]==false) return;
	if(ddvisi[elname]==false) return true;
  ddlen = document.form1["nsub"+elname].length;
  for(i=0; i<ddlen; i++)
  {
    if(document.form1["nsub"+elname].options[i].value==toselect)
    {
      document.form1["nsub"+elname].options[i].selected=true;
      //return;
    }
  }
}
