﻿function checkFrm(){

if (document.form1.Other1.value=="")
 {alert('Please click the most relevant category!');
  document.form1.Other1.focus();
   return false;}
   
 if (document.form1.Other2.value=="")
 {alert('Please select a source!');
  document.form1.Other2.focus();
   return false;}
   
 if (document.form1.UserName.value=="")
 {alert('Your first name can not be empty!');
  document.form1.UserName.focus();
   return false;}
   
 if (document.form1.Organization.value=="")
 {alert('Your Organization can not be empty!');
  document.form1.Organization.focus();
   return false;}
   

 if (document.form1.EMail.value=="")
 {alert('Your email can not be empty!');
  document.form1.EMail.focus();
   return false;}
  
  if (IsEmail(document.form1.EMail.value)==false){
		document.form1.EMail.focus();
		return false;
  }
 
 if (document.form1.Other4.value=="")
 {alert('Your fax can not be empty!');
  document.form1.Other4.focus();
   return false;}
   
 if (document.form1.Requirement.value=="")
 {alert('Your enquiry can not be empty!');
  document.form1.Requirement.focus();
   return false;}
   
}

function IsEmail(object_name)
{
	var string;
	string=new String(object_name);
	var len=string.length;
	if (string.indexOf("@",1)==-1||string.indexOf(".",1)==-1||string.length<7)
		{
		alert("Your email address is error！");
		return false;
		}
	if (string.charAt(len-1)=="."||string.charAt(len-1)=="@")
		{
		alert("Your email address is error！");
		return false;
		}
	return true;
}