// JavaScript Document
function changestate(control, statcode, val)
{
   //frmhome.document.statename.value = val;
  
  var flag;
	control.options.length = 0;
	if(val == "CA")
	 control.options[0] = new Option("-- Select Province --");
	else
	 control.options[0] = new Option("-- Select State --");
	control.options[0].value = "";
	if(statcode == "")
		control.options[0].selected = true;	
	
   //alert(val);
   //alert(statArr.length);
   for(i=0,j=1; i<statArr.length; i++)
	{
		if(statArr[i][0] == val)
		{
			if(statcode == statArr[i][1])
			{			   
				control.options[j] = new Option(statArr[i][2]);
				control.options[j].value = statArr[i][1];				
				control.options[j].selected = true;
			}
			else
			{
				control.options[j] = new Option( statArr[i][2]);
				control.options[j].value = statArr[i][1];
			}				
			j++;
		}
	}
	
	
	
}
function checkVendorState()
{

     if(document.frmhome.vState.value == '')
     {
          document.getElementById('err_vstate').style.display = '';
          document.getElementById('vState').focus();
          return false;
     }
     else
     {
          document.getElementById('err_vstate').style.display = 'none';
     }
}
