// JavaScript Document
function AddFavorite(sURL, sTitle)
{
     try
     {
         window.external.addFavorite(sURL, sTitle);
     }
     catch (e)
     {
         try
         {
             window.sidebar.addPanel(sTitle, sURL, "");
         }
         catch (e)
         {
             alert("add fail,please add by hand");
         }
     }
}
//check contact form
function checkmesForm()
{
	if (document.mesForm.cName.value=="")
	{
	  alert("Name field is required!");
	  document.mesForm.cName.focus();
	  return false
	 }
	 if(document.mesForm.cEmail.value == "")
	 {
		alert("Email field is required!");
		document.mesForm.cEmail.focus();
		return false;
	 }
	 if(!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(document.mesForm.cEmail.value))
	 {
    	alert("please input right Email!"); 
    	document.mesForm.cEmail.focus(); 
   		return false; 
	 } 
	 if(document.mesForm.cComment.value == "")
	 {
		alert("Comments field is required!");
		document.mesForm.cComment.focus();
		return false;
	 }
	  if(document.mesForm.captchacode.value == "")
	 {
		alert("Identifying Code field is required!");
		document.mesForm.captchacode.focus();
		return false;
	 }
}
