

function ChkResume()
{
	if(confirm("是否执行此操作?")==true)
	{
		return true
		
	}
	else
	{
		return false	
	}
}


function CheckInput(str)
{
	for(i=0;i<str.length;i++)
 	{
		if(str.charCodeAt(i)==event.keyCode)
		{
			return true;
		}
	}
	 return false
}




function ChkFax(val)
{
	val=val.value
	
	if(val=="")
	{
		alert("Sorry, fax can not be empty!")	
		return false
	}
	else if(val.length<6)
	{
		alert("Sorry, fax shall not be less than the median 6!")
		return false
	}
}
function ChkTel(val)
{
	val=val.value
	
	if(val=="")
	{
		alert("Sorry, telephone number can not be empty")	
		return false
	}
	else if(val.length<6)
	{
		alert("Sorry, telephone shall not be less than the median 6!")
		return false
	}
}
///-----------------------------
///检查联系人
///-----------------------------
function ChkContact(val)
{
	val=val.value
	
	if(val=="")
	{
		alert("Sorry,contact can not be empty")	
		return false
	}
}

///---------------------------------------------
///密码
///---------------------------------------------
function ChkPass(val)
{
	val = val.value
	if(val == "")
	{
		alert("Sorry,password can not be empty！")
		return false	
	}
	else if(val.length <6)
	{
		alert("Sorry, password shall not be less than the median 6!")
		return false
	}
	else if(val.length >16)
	{
		alert("Sorry, not larger than 16 digit password!")
		return false
	}
}
function ChkPass2(val1,val2)
{
	val1 = val1.value
	val2 = val2.value
	if(val2 == "")
	{
		alert("Sorry, please fill out the Password!")
		return false	
	}
	else if(val2.length <6)
	{
		alert("Sorry, confirmed no less than 6-digit password!")
		return false
	}
	else if(val2.length >16)
	{
		alert("Sorry, Confirm password may not exceed 16 median!")
		return false
	}
	else if(val1 != val2)
	{
		alert("Sorry, not Confirm password and password!")
		return false
	}
}





function ChkEmail(val)
{
	val = val.value
	if(val == "")
	{
		alert("Sorry, e-mail address will not be allowed to air!")
		return false	
	}
	else if((val.indexOf("@")) == -1 || (val.lastIndexOf(".")) == -1)
	{
		alert("Sorry, e-mail address format is not correct, please re-enter!")
		return false	
	}
}


function ChkModAll(myPass1,myPass2,myTel,myFax,myContact,myComName,myEmail)
{
	if(ChkPass(myPass1)==false)
	{
		return false
	}
	else if(ChkPass2(myPass1,myPass2)==false)
	{
		return false	
	}
	else if(ChkComName(myComName)==false)
	{
		return false	
	}
	else if(ChkTel(myTel)==false)
	{
		return false	
	}
	else if(ChkFax(myFax)==false)
	{
		return false	
	}
	else if(ChkEmail(myEmail)==false)
	{
		return false	
	}
	else if(ChkContact(myContact)==false)
	{
		return false	
	}
	
	return true

}

function ChkComName(val)
{
	val=val.value
	
	if(val=="")
	{
		alert("Sorry, please Company Name")	
		return false
	}
}

function ChkEmail(val)
{
	val = val.value
	if(val == "")
	{
		alert("Sorry, e-mail address will not be allowed to air!")
		return false	
	}
	else if((val.indexOf("@")) == -1 || (val.lastIndexOf(".")) == -1)
	{
			alert("Sorry, e-mail address format is not correct, please re-enter!")
		return false	
	}
}

function ChkUserName(val)
{
	val=val.value
	
	if(val=="")
	{
		alert("Sorry, please enter your user name!")
		
		return false	
	}
}


function ChkRegAll(myUser,myPass,myTel,myFax,myContact,myCompany,myEmail,myMsn)
{
	if(ChkUserName(myUser)==false)
	{
		return false
	}
	else if(ChkPass(myPass)==false)
	{
		return false
	}
	else if(ChkComName(myCompany)==false)
	{
		return false	
	}
	else if(ChkTel(myTel)==false)
	{
		return false	
	}
	else if(ChkFax(myFax)==false)
	{
		return false	
	}
	else if(ChkEmail(myEmail)==false)
	{
		return false	
	}
	else if(ChkEmail(myMsn)==false)
	{
		return false	
	}
	else if(ChkContact(myContact)==false)
	{
		return false	
	}
	else
	{
		return true
	}
}





