

 	   
			function RefreshCities(state, ControlToFill, Current_Ctrl_Value){			        
				//Get_ZipCode(state, ControlToFill, Current_Ctrl_Value)
			}
			
		
			function RefreshStates(CodeCountry, ControlToFill, Current_Ctrl_Value){			        
				Get_States(CodeCountry, ControlToFill, Current_Ctrl_Value)
				if(CodeCountry=="United States" || CodeCountry=="Canada" || CodeCountry=="Mexico" )
					document.all.star.innerText="*"
				else
					document.all.star.innerText=""
				//ControlToFill.focus();
			}
			
			function RefreshStates2(CodeCountry, ControlToFill, Current_Ctrl_Value){
				Get_States(CodeCountry, ControlToFill, Current_Ctrl_Value)
				//if(CodeCountry=="United States" || CodeCountry=="Canada" || CodeCountry=="Mexico" )
				//		document.all.star.innerText="*"
				//else
				//		document.all.star.innerText=""
				//ControlToFill.focus()
			}
			
			function SetHomeStateValue(sel_value){
				if(sel_value!=0){
					document.all.hidHomeState.value=sel_value;
				}else{
					document.all.hidHomeState.value=""
				}
			}

			function SetHomeCityValue(sel_value){
				if(sel_value!=0){
					document.all.city.value=sel_value;
				}else{
					document.all.city.value=""
				}
			}		
			function SetHomeZipCodeValue(sel_value){
				if(sel_value!=0){
					document.all.selHomeZip.value=sel_value;
				}else{
					document.all.selHomeZip.value=""
				}
			}			

function checkf()
{ 
   theform = eval("document.Form1");	   
  
   if (theform.email.value=="") {
   		alert("Please input Email");
			theform.email.focus();
			return (false);
   }
   	
   if (theform.cname.value=="") {
			alert("Please input Name");
			theform.cname.focus();
			return (false);
   }

   if (theform.pw.value!=theform.cpw.value) {
			alert("Password does not match Confirm Password!");
			theform.cpw.focus();
			return (false);
   }
   	
   if (theform.pw.value.length<6) {
			alert("Password's length must large than 6!");
			theform.pw.focus();
			return (false);
   }
   	
   if (!chk_mail(theform.email.value))
   {
     theform.email.focus();
     return false;
   }
     			   				
   if (theform.cn.value=="") {
			alert("Please input Company Name");
			theform.cn.focus();
			return (false);
   }	     
   
   if (theform.selHomeCountry.value=="") {
      alert("Please select your Country");
			theform.selHomeCountry.focus();
			return (false);
   }	
   
   if (theform.selHomeState.value=="" || theform.selHomeState.value=="------------ Select a State or Province ------------") {
      alert("Please select your State or Province");
			theform.selHomeState.focus();
			return (false);
   }
 
	 var vTemp="";
	 var vTemp1="";
	 
	 for (var j=1;j<theform.Application_Industry.options.length;j++)
	 {
   	if (document.getElementById("Application_Industry").options[j].selected)
    {
   		if (vTemp==""){
			  vTemp = document.getElementById("Application_Industry").options[j].text;
			  vTmp1 = document.getElementById("Application_Industry").options[j].value;
			}else{
				vTemp = vTemp+","+document.getElementById("Application_Industry").options[j].text;
				vTemp1 = vTemp1+","+document.getElementById("Application_Industry").options[j].value;
			}
   	}
	} 
  
  theform.vApplication_Industry.value= vTemp; 
  theform.vApplication_Industryid.value= vTemp1; 

	 var vTmp="";
	 var vTmp1="";
	 
	 for (var i=1;i<theform.Products_Interest.options.length;i++)
	 {
   	if (document.getElementById("Products_Interest").options[i].selected)
    {
   		if (vTmp==""){
			  vTmp = document.getElementById("Products_Interest").options[i].text;
			  vTmp1 = document.getElementById("Products_Interest").options[i].value;
			}else{
				vTmp = vTmp+","+document.getElementById("Products_Interest").options[i].text;
				vTmp1 = vTmp1+","+document.getElementById("Products_Interest").options[i].value;
			}
   	}
	}
  

  theform.vProducts_Interest.value= vTmp; 
  theform.vProducts_Interestid.value= vTmp1; 
  
  theform.submit();   

  return (true);
}


function checkf2009()
{ 
   theform = eval("document.Form1");	   
   
   if (theform.email.value=="") {
   		alert("Please input Email");
			theform.email.focus();
			return (false);
   }
   	
   if (theform.cname.value=="") {
			alert("Please input Name");
			theform.cname.focus();
			return (false);
   }
   	
   if (!chk_mail(theform.email.value))
   {
     theform.email.focus();
     return false;
   }
     			   				
   if (theform.cn.value=="") {
			alert("Please input Company Name");
			theform.cn.focus();
			return (false);
   }	     
   
   if (theform.selHomeCountry.value=="") {
      alert("Please select your Country");
			theform.selHomeCountry.focus();
			return (false);
   }	
   
   if (theform.selHomeState.value=="" || theform.selHomeState.value=="------------ Select a State or Province ------------") {
      alert("Please select your State or Province");
			theform.selHomeState.focus();
			return (false);
   }
   
   if (document.all.star.innerText=="*" && theform.phone.value=="") {
			alert("Please input phone number");
			theform.phone.focus();
			return (false);
   }	 
 
	 var vTemp="";
	 var vTemp1="";
	 
	 for (var j=1;j<theform.Application_Industry.options.length;j++)
	 {
   	if (document.getElementById("Application_Industry").options[j].selected)
    {
   		if (vTemp==""){
			  vTemp = document.getElementById("Application_Industry").options[j].text;
			  vTmp1 = document.getElementById("Application_Industry").options[j].value;
			}else{
				vTemp = vTemp+","+document.getElementById("Application_Industry").options[j].text;
				vTemp1 = vTemp1+","+document.getElementById("Application_Industry").options[j].value;
			}
   	}
	} 
  
  theform.vApplication_Industry.value= vTemp; 
  theform.vApplication_Industryid.value= vTemp1; 

	 var vTmp="";
	 var vTmp1="";
	 
	 for (var i=1;i<theform.Products_Interest.options.length;i++)
	 {
   	if (document.getElementById("Products_Interest").options[i].selected)
    {
   		if (vTmp==""){
			  vTmp = document.getElementById("Products_Interest").options[i].text;
			  vTmp1 = document.getElementById("Products_Interest").options[i].value;
			}else{
				vTmp = vTmp+","+document.getElementById("Products_Interest").options[i].text;
				vTmp1 = vTmp1+","+document.getElementById("Products_Interest").options[i].value;
			}
   	}
	}
  

  theform.vProducts_Interest.value= vTmp; 
  theform.vProducts_Interestid.value= vTmp1; 
  
  theform.submit();   

  return (true);
}

function checkkey()
{
	/*
	if (window.event)
	{
		code=window.event.keyCode;
	}else{
		code=e.which;
	}
	*/

	var code=window.event ? window.event.keyCode : e.which;

   if(((code>=48)&&(code<=57))||((code>=65)&&(code<=90))||((code>=97)&&(code<=122)))
   {
     return true;
   }  
   else
   {
     return false;
   } 
}


function checkform() {
 var icount=0;  
 var icount2=0;
 var icount3=0;
 var form=document.Form1;   
 var currEl, currGrp, e = 0;
 while (currEl = form.elements[e++]) {
   
   if (currEl.type == 'radio' && currEl.name =='ci[]') {
     currGrp = form.elements[currEl.name];     
     for (var i=0; i<currGrp.length; i++){
       if (currGrp[i].checked){
         icount++;              
       }        
     } 
   }
   
   
   if (currEl.type == 'radio' && currEl.name =='bt[]') {
     currGrp = form.elements[currEl.name];     
     for (var i=0; i<currGrp.length; i++){
       if (currGrp[i].checked){
         icount2++;              
       }        
     } 
   }      
  
 } 
 
  
 if(icount==0){
    alert("Please select the Company Industry");	    
    return (false);	    
  } 
  if(icount2==0){
    alert("Please select the Business Type");	    
    return (false);	    
   }         
 
}

function chk_mail(email)
{
   var len = email.length;
   var str=email.substring(0,email.indexOf("@"));
   if((email.indexOf("@")==-1)||(email.indexOf("@")==0)||(email.indexOf("@")==(len-1)))
   {
      alert("Your email is invalid !\n");
      return false;
   }   
   if((email.indexOf("@")!=-1)&&(email.substring(email.indexOf("@")+1,len).indexOf("@")!=-1))
   {
      alert("Your email is invalid !\n");
      return false;
   }   
   if((email.indexOf(".")==-1)||(email.indexOf(".")==0)||(email.lastIndexOf(".")==(len-1)))
   {
      alert("Your email is invalid !\n");
      return false;
   }     
   if(str.indexOf("test")>0){
      alert("Your email is invalid !\n");
      return false;
   }   
   return true;
}


