function clearbox() {
document.Form1.companyname.value="";
document.Form1.contactperson.value="";
document.Form1.contacttel.value="";
document.Form1.contactfax.value="";
document.Form1.contactemail.value="";
document.Form1.contactadd.value="";
document.Form1.contacturl.value="";
document.Form1.feedbackdesc.value="";
}

function check_feedbackform()
{
	if(document.aspnetForm.ctl00$ContentPlaceHolder1$feedbackdesc.value=="")
	{
		alert("请填写内容！");
		document.aspnetForm.ctl00$ContentPlaceHolder1$feedbackdesc.select();
		return false;
	}
	else if(document.aspnetForm.ctl00_ContentPlaceHolder1_contactpersonfirst.value=="")
	{
		alert("请填写您的姓名！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_contactpersonfirst.select();
		return false;
	}
	else if(document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.value=="")
	{
		alert("请填写您的Email！");
		document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.select();
		return false;
	}
    else if(document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.value.length !=0)
    {
        if(/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.exec(document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.value)==null)
        {
            alert("请核对您的Email！");
            document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.select();
            return false;
        }
        else if(document.aspnetForm.ctl00$ContentPlaceHolder1$street.value=="")
        {
	        alert("请填写您的公司地址！");
	        document.aspnetForm.ctl00$ContentPlaceHolder1$street.select();
	        return false;
        }
        else if(document.aspnetForm.ctl00$ContentPlaceHolder1$tecountrycode.value=="")
        {
	        alert("请填写您的联系电话！");
	        document.aspnetForm.ctl00$ContentPlaceHolder1$tecountrycode.select();
	        return false;
        }        
        else if(document.aspnetForm.ctl00$ContentPlaceHolder1$companyname.value=="")
        {
	        alert("请填写您的公司名称！");
	        document.aspnetForm.ctl00$ContentPlaceHolder1$companyname.select();
	        return false;
        }        
        else
        {
            return true;
        }
	}
}

function check_feedbackform2()
{
	if(document.aspnetForm.ctl00_ContentPlaceHolder1_contactpersonfirst.value=="")
	{
		alert("请填写您的姓名！");
		document.aspnetForm.ctl00_ContentPlaceHolder1_contactpersonfirst.select();
		return false;
	}
	if(document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.value=="")
	{
		alert("请填写您的Email！");
		document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.select();
		return false;
	}	
	if(document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.value.length !=0)
    {
        if(/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.exec(document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.value)==null)
	    {
	        alert("请核对您的Email！");
	        document.aspnetForm.ctl00$ContentPlaceHolder1$contactemail.select();
	        return false;
	    }
	    else if(document.aspnetForm.ctl00$ContentPlaceHolder1$address.value=="")
        {
	        alert("请填写您的公司地址！");
	        document.aspnetForm.ctl00$ContentPlaceHolder1$address.select();
	        return false;
        }
	    else if(document.aspnetForm.ctl00$ContentPlaceHolder1$tecountrycode.value=="")
        {
	        alert("请填写您的联系电话！");
	        document.aspnetForm.ctl00$ContentPlaceHolder1$tecountrycode.select();
	        return false;
        }        
        else if(document.aspnetForm.ctl00$ContentPlaceHolder1$companyname.value=="")
        {
	        alert("请填写您的公司名称！");
	        document.aspnetForm.ctl00$ContentPlaceHolder1$companyname.select();
	        return false;
        }        
        else
        {
            return true;
        }
   }
}


function check_signin()
{
	if(document.Form1.username.value.length<4||document.Form1.username.value.length>12)
	{
	  alert("4-12 length");
	  document.Form1.username.select();
	  return false;
	 }
  if(document.Form1.pwd.value.length<4||document.Form1.pwd.value.length>12)
	{
	  alert("4-12 length");
	  document.Form1.pwd.select();
	  return false;
	}
	return true;	

}

function check_keyword()
{
	if(document.aspnetForm.ctl00_search_input.value==""||document.aspnetForm.ctl00_search_input.value=="Product Search...")
	{
		alert("Please enter product item or name!");
		document.aspnetForm.ctl00_search_input.select();
		return false;
	}
	if(document.aspnetForm.ctl00_search_input.value.length >30)
	{
		alert("1-30 length");
		document.aspnetForm.ctl00_search_input.value="";
		document.aspnetForm.ctl00_search_input.select();
		
		return false;
		
	}
	
	return true;
}
