﻿	//留言资料检测
	document.onkeydown=function() {
		if (window.event.ctrlKey&&window.event.keyCode==13) { 
			   GuestbookCheck() 
			} 

	}

	function GuestbookCheck() 
	{ 
		if (document.GuestbookForm.f_User.value == "") 
		{ 
		alert("Please input the username!"); 
		document.GuestbookForm.f_User.focus(); 
		return (false); 
		}
		if (document.GuestbookForm.f_company.value == "") 
		{ 
		alert("Please input the company name!"); 
		document.GuestbookForm.f_company.focus(); 
		return (false); 
		}
		if (document.GuestbookForm.f_add.value == "") 
		{ 
		alert("Please input the ADD!"); 
		document.GuestbookForm.f_add.focus(); 
		return (false); 
		}
		if (document.GuestbookForm.f_phone.value == "") 
		{ 
		alert("Please input the TEL!"); 
		document.GuestbookForm.f_phone.focus(); 
		return (false); 
		}
		if (document.GuestbookForm.f_email.value == "") 
		{ 
		alert("Please input the E-mail!"); 
		document.GuestbookForm.f_email.focus(); 
		return (false); 
		}
		
		//检测EMAIL地址是否有效
		strEmail=document.GuestbookForm.f_email.value;               
		  emailerr=0               
		  for   (i=0;   i<strEmail.length;   i++)               
		  {               
			  if   ((strEmail.charAt(i)   ==   "@")   &   (strEmail.length   >   5))               
			  {               
			      emailerr=emailerr+1               
			  }               
		  }               
		  if   (emailerr   !=   1)               
		  {               
			  alert("The E-mail is wrong!");               
			  document.GuestbookForm.f_email.focus();               
		  return   false;               
		  }   

	}
