function selectCities(frm, ddlCountryList, ddlCityList, txtLastName)
{
	var cName, cityArr, cName;
	var objCountryList, objCityList, objLastName;

    objCountryList = document.getElementById(ddlCountryList);
    objCityList = document.getElementById(ddlCityList);
    objLastName = document.getElementById(txtLastName);
    
	if (objCountryList.options[objCountryList.selectedIndex].value == "") 
	{
		objCityList.options.length=0;
		objCityList.options[0] = new Option("Please select a country first.", "-1");
		objCityList.options[0].selected = true;
		return;
	}
	re = / /g;             
	cName = objCountryList.options[objCountryList.selectedIndex].value;
	cName = objCountryList.options[objCountryList.selectedIndex].value.replace(re, "_");
	cName = cName.replace("|", "");
	cName = cName + "_arr";
	cityStr = eval(cName);
	if(cityStr != "")
	{
		cityArr = eval(cityStr.split("|"));
		objCityList.options.length = cityArr.length - 1;
		objCityList.options[0] = new Option("Choose One:                 ", "");
		objCityList.options[0].selected = true;
		for(i = 0; i < cityArr.length-1; i++)
		{
			cityArr0 = eval(cityArr[i].split("--"));
			objCityList.options[i+1] = new Option(cityArr0[0], cityArr[i]);
		}
		if (cityArr.length > 0 ) 
		{
			objCityList.options[0].selected = true;
		}
	}
	else
	{
		objCityList.options.length=0;
		objCityList.options = new Option("                            ", "");
	}
	objLastName.focus();
}

//function selectCitiesOLD(frm)
//{
//	var cName, cityArr, cName;

//	if(isNS4 || isDOM) 
//	{
//		if (frm.ddlCountryList.options[frm.ddlCountryList.selectedIndex].value == "") 
//		{
//			frm.ddlCityList.options.length=0;
//			frm.ddlCityList.options[0] = new Option("Please select a country first.", "-1");
//			frm.ddlCityList.options[0].selected = true;
//			return;
//		}
//		re = / /g;             
//		cName = frm.ddlCountryList.options[frm.ddlCountryList.selectedIndex].value;
//		cName = frm.ddlCountryList.options[frm.ddlCountryList.selectedIndex].value.replace(re, "_");
//		cName = cName.replace("|", "");
//		cName = cName + "_arr";
//		cityStr = eval(cName);
//		if(cityStr != "")
//		{
//  			cityArr = eval(cityStr.split("|"));
//  			frm.ddlCityList.options.length = cityArr.length - 1;
//  			frm.ddlCityList.options[0] = new Option("Choose One:                 ", "");
//  			frm.ddlCityList.options[0].selected = true;
//  			for(i = 0; i < cityArr.length-1; i++)
//  			{
//  				cityArr0 = eval(cityArr[i].split("--"));
//  				frm.ddlCityList.options[i+1] = new Option(cityArr0[0], cityArr[i]);
//  			}
//  			if (cityArr.length > 0 ) 
//  			{
//  				frm.ddlCityList.options[0].selected = true;
//  			}
//		}
//		else
//		{
//  			frm.ddlCityList.options.length=0;
//  			frm.ddlCityList.options = new Option("                            ", "");
//		}
//		frm.txtName.focus();
//	}
//	else
//	{
//		if (frm("ddlCountryList").value == "" ) 
//		{
//			for (i=frm("ddlCityList").length-1;i >= 0;i--)
//			{
//				frm("ddlCityList").remove (0);
//			}
//			objOption = document.createElement("OPTION");
//			objOption.text = "Please select a country first.";
//			objOption.value = "" ;
//			frm("ddlCityList").add (objOption);
//			
//			return;
//		}
//		re = / /g;             
//	    cName = frm("ddlCountryList").value.replace(re, "_");
//		cName = cName + "_arr";
//		cName = cName.replace("|", "");
//		cityStr = eval(cName);
//		if (cityStr != "")
//		{
//			cityArr = eval(cityStr.split("|"));

//			for (i=frm("ddlCityList").length-1;i >= 0;i--)
//			{
//				frm("ddlCityList").remove (0);
//			}
//			objOption = document.createElement("OPTION");
//			objOption.text = "Choose one:                 ";
//			objOption.value = "" ;
//			frm("ddlCityList").add (objOption);
//			
//			for(i = 0; i < cityArr.length-1; i++)
//			{
//				objOption = document.createElement("OPTION");
//				cityArr0 = eval(cityArr[i].split("--"));
//				objOption.text = cityArr0[0];
//				objOption.value = cityArr[i] ;
//				frm("ddlCityList").add (objOption);
//			}
//			
//			if (cityArr.length > 0 ) 
//			{
//				frm("ddlCityList").selectedIndex=0;
//			}
//		}
//		else
//		{
//			for (i=frm("ddlCityList").length-1;i >= 0;i--)
//			{
//				frm("ddlCityList").remove (0);
//			}
//		}

//		frm.txtLastName.focus();
//	}
//}
