


	
function validate(form1) {
   if(form1.sal.value=="")			
  {
    alert("Please Enter Salutation!");
    form1.sal.focus();
	form1.sal.style.background='#FFCCCC'
    return false;
  }    
   
   if(form1.lname.value=="")				//lnsme(empty)
  {
    alert("Please Enter Your Family Name!");
    form1.lname.focus();
	form1.lname.select();
	form1.lname.style.background='#FFCCCC'
    return false;
  }


  if(form1.fname.value=="")				//fnsme(empty)
  {
    alert("Please Enter Your First Name!!");
    form1.fname.focus();
	form1.fname.select();
	form1.fname.style.background='#FFCCCC'
    return false;
  }
   

  if(form1.Designation.value=="")				//lnsme(empty)
  {
    alert("Please Enter Your Designation!");
    form1.Designation.focus();
	form1.Designation.select();
	form1.Designation.style.background='#FFCCCC'
    return false;
  }

 
  if(form1.company.value=="")				//company(empty)
  {
    alert("Please Enter Your Company!");
    form1.company.focus();
	form1.company.select();
	form1.company.style.background='#FFCCCC'
    return false;
  }
      if(form1.country.value=="")				//company(empty)
  {
    alert("Please select country!");
    form1.country.focus();
	form1.country.style.background='#FFCCCC'
    return false;
  } 
  
      if(form1.city.value=="")				//company(empty)
  {
    alert("Please Enter Your city!");
    form1.city.focus();
	form1.city.select();
	form1.city.style.background='#FFCCCC'
    return false;
  } 
  
    if(form1.telcc.value=="")				//fnsme(empty)
  {
    alert("Please Enter The Country Code For Your Telephone Number!");
    form1.telcc.focus();
	form1.telcc.select();
	form1.telcc.style.background='#FFCCCC'
    return false;
  }  

if(form1.telcc.value!=="")
{    
      telcc=document.form1.telcc.value;     
         reg=/^[0-9]+$/;  
        if(!reg.test(telcc)){    
             alert("Country Code For Telephone Number Can Only Contain Digits!");//请将“字符串类型”要换成你要验证的那个属性名称！    
           form1.telcc.select();
	form1.telcc.style.background='#FFCCCC'
    return false;
         }    
}  

  if(form1.tel.value=="")				//fnsme(empty)
  {
    alert("Please Enter Your Telephone Number!");
    form1.tel.focus();
	form1.tel.select();
	form1.tel.style.background='#FFCCCC'
    return false;
  }        
  
if(form1.tel.value!=="")
{    
      tel=document.form1.tel.value;     
         reg=/^[0-9]+$/;    
        if(!reg.test(tel)){    
             alert("Telephone Number Can Only Contain Digits!");//请将“字符串类型”要换成你要验证的那个属性名称！    
           form1.tel.select();
	form1.tel.style.background='#FFCCCC'
    return false;
         }    
} 

 if(form1.addr1.value=="")				//address(empty)
  {
    alert("Please Enter Your Address!");
    form1.addr1.focus();
	form1.addr1.select();
	form1.addr1.style.background='#FFCCCC'
    return false;
  }  

  if(form1.zipcode.value=="")				//address(empty)
  {
    alert("Please Enter zip code!");
    form1.zipcode.focus();
	form1.zipcode.select();
	form1.zipcode.style.background='#FFCCCC'
    return false;
  }   
     

if(form1.faxcc.value!=="")
{    
      faxcc=document.form1.faxcc.value;     
         reg=/^[0-9]+$/;    
        if(!reg.test(faxcc)){    
             alert("Country Code For Telephone Number Can Only Contain Digits!");//请将“字符串类型”要换成你要验证的那个属性名称！    
           form1.faxcc.select();
	form1.faxcc.style.background='#FFCCCC'
    return false;
         }    
}    
     

if(form1.fax.value!=="")
{    
      fax=document.form1.fax.value;     
         reg=/^[0-9]+$/;    
        if(!reg.test(fax)){    
             alert("Fax Number Can Only Contain Digits!");//请将“字符串类型”要换成你要验证的那个属性名称！    
           form1.fax.select();
	form1.fax.style.background='#FFCCCC'
    return false;
         }    
} 
                   
  if(form1.email.value=="")				//email(empty)
  {
    alert("Please Enter Your Email!");
    form1.email.focus();
	form1.email.select();
	form1.email.style.background='#FFCCCC'
    return false;
  }
 	 
  if(!isEmail(form1.email.value))				//email
  {
    alert("Please Enter A Valid Email Address!");
    form1.email.focus();
	form1.email.select();
	form1.email.style.background='#FFCCCC'
    return false;
  }
     
  if(!form1.formarea1.checked && !form1.formarea2.checked&& !form1.formarea3.checked && !form1.formarea4.checked && !form1.formarea5.checked&& !form1.formarea6.checked&& !form1.formarea7.checked&& !form1.formarea8.checked&& !form1.formarea9.checked&& !form1.formarea10.checked)				//industry
	  {
	    alert("Please Enter about this conference from!");
	    form1.formarea1.focus();
		form1.formarea1.select();
		form1.formarea1.style.background='#FFCCCC'
		return false;
	  }
	  
  if(form1.formarea10.checked &&				//industry(others)  
  	form1.formareaother.value=="")
  {
    alert("Please Enter other this conference from !");
    form1.formareaother.focus();
	form1.formareaother.select();
	form1.formareaother.style.background='#FFCCCC'
    return false;
  }	  
  
   
   
      if(!form1.attend1[0].checked && !form1.attend1[1].checked)			
  {
    alert("Please Select Your Registration Package!");
    form1.attend1[1].focus();
	form1.attend1[1].select();
	form1.attend1[1].style.background='#FFCCCC'
    return false;
  }  
 

 
}

function isAlphabet(ch)
{
  return((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')||(ch==',')||(ch=='.')||(ch=='/')||(ch=='-'));
}

function isSpace(ch)
{
  return (ch==' ');
}

function isDigit(ch)
{
  return(ch>='0'&&ch<='9')||(ch=='-')||(ch==',')||(ch=='/')||(ch==' ');
}

function isAllalphabets(str)
{
  var i;
  for(i=0;i<str.length;i++)
  {
    if(!isAlphabet(str.charAt(i))&&!isSpace(str.charAt(i)))return false;
  }
  return true;
}




function isEmail(str)
{
  if(str.indexOf('@')==-1||str.indexOf('.')==-1)  return false;
  if(str.length<5)  return false;
  return true;
}
function displayAlertMessage(){
	alert("Registration will be processed only upon presentation of a copy of your degree/licence (5 years maximum since graduation). Please fax copy to +86 21 52980210, and indicate the conference name, name(s) of delegate(s) and the registration number. ");
}
