// Function fill up Counties/Shires dropdown as per selected State/Province
// argument 1: Name of form
// argument 2: Name of State/Province dropdown(<select>)
// argument 3: Name of Counties/Shires dropdown(<select>)

function setCounty(frmName, cmbState, cmbShire)
{
	 var intIndex;

	 intIndex = eval("document."+frmName+"."+cmbState+".options.selectedIndex"); 
	 strState = eval("document."+frmName+"."+cmbState+".options["+intIndex+"].value");

	 eval("document."+frmName+"."+cmbShire+".options.length=1");
	  
	 if(strState != "Choose a province" && strState != "")
	 {
		 arrCounties[strState]=arrCounties[strState]+""; // hack to prevent "split is not a function" bug
		 var arrCounty = arrCounties[strState].split(",");	 
		 eval("document."+frmName+"."+cmbShire+".options.length = "+arrCounty.length+"+1");

		 for(i=1;i <= arrCounty.length;i++)
	     {
	    	test=arrCounty[i-1];
	    	eval("document."+frmName+"."+cmbShire+".options["+i+"].value = '"+test+"'");
	    	eval("document."+frmName+"."+cmbShire+".options["+i+"].text = '"+test+"'");
	     }	
	 }
	 return false;
}