//*****************************************************
//引用: tpl.login.htm
//作用：用户登陆提交验证
function checklogin()
{
	var vloingID = document.aa.loginID.value;
	var vpwd = document.aa.pwd.value;
	if(vloingID == "" || ifspace(vloingID) == true)
	{
		alert("Please input LoginID!");
		document.aa.loginID.focus();
		return false;
	}
	else if(vpwd == "")
	{
		alert("Please input password!");
		document.aa.pwd.focus();
		return false;
	}
}



//引用: tpl.findpwd1.htm
//作用：用户找回密码第一步提交验证
function checkfind1()
{
	var vloingID = document.findform1.loginID.value;
	if(vloingID == "" || ifspace(vloingID) == true)
	{
		alert("Please input LoginID!");
		document.findform1.loginID.focus();
		return false;
	}
}



//引用: tpl.findpwd20.htm
//作用：用户找回密码第二步（回答问题）提交验证
function checkfind20()
{
	var vanswer = document.findform2.answer.value;
	if(vanswer == "")
	{
		alert("Please input your answer!");
		document.findform2.answer.focus();
		return false;
	}
}



//引用: tpl.findpwd21.htm
//作用：用户找回密码第二步（邮件发送）提交验证
function checkfind21()
{
	var vemail = document.findform2.email.value;
	if(vemail == "")
	{
		alert("Please input your email!");
		document.findform2.email.focus();
		return false;
	}
	else if(vemail.length<3 || vemail.indexOf("@")<=0)
	{
		alert("Please input your valid email!");
		document.findform2.email.focus();
		return false;
	}
}



//引用: tpl.register2.htm
//作用：英文注册用户提交信息前检测
function checkform()
{
	var vloginID = document.aa.loginID.value;
	var vpwd = document.aa.pwd.value;
	var vpwdsure = document.aa.pwdsure.value;
	var vquestion = document.aa.question.value;
	var vanswer = document.aa.answer.value;
	var vusername = document.aa.username.value;
	var vcompany = document.aa.company.value;
	var vbusinature = document.aa.businature.value;
	var vproducts = document.aa.products.value;
	var vtel = document.aa.tel.value;
	var vemail = document.aa.email.value;
	
	var i = 0, flag = 0, temp = "";
	for(i=0; i<vloginID.length; i++)
	{
		temp = vloginID.substring(i, i+1);
		if( (temp>="a" && temp<="z") || (temp>="A" && temp<="Z") || (temp>="0" && temp<="9") || temp=="_"  || temp=="-"  || temp==".")
			continue;
		else
		{
			flag++;
			break;
		}
	}
	
	
	if(vloginID == "")
	{
		alert("Please input login ID!");
		document.aa.loginID.focus();
		return false;	
	}
	else if(vloginID.length<3 || flag > 0)
	{
		alert("Please input valid login ID and the length should be larger than 2!");
		document.aa.loginID.focus();
		return false;
	}
	else if(vpwd == "" || ifspace(vpwd) == true)
	{
		alert("Please input password!");
		document.aa.pwd.focus();
		return false;
	}
	else if(vpwd.length<3)
	{
		alert("The password's length should be larger than 2!");
		document.aa.pwd.focus();
		return false;
	}
	else if(vpwd != vpwdsure)
	{
		alert("The passwords you input are not accordant!");
		document.aa.pwdsure.focus();
		return false;
	}
	else if(vquestion == "")
	{
		alert("Please input question!");
		document.aa.question.focus();
		return false
	}
	else if(vanswer == "")
	{
		alert("Please input answer!");
		document.aa.answer.focus();
		return false
	}
	else if(vusername == "")
	{
		alert("Please input your name!");
		document.aa.username.focus();
		return false
	}
	else if(vcompany == "")
	{
		alert("Please input company!");
		document.aa.company.focus();
		return false
	}
	else if(vbusinature == "")
	{
		alert("Please choose business nature!");
		document.aa.businature.focus();
		return false
	}
	else if(vproducts == "")
	{
		alert("Please chooose Target products!");
		document.aa.products.focus();
		return false
	}
	else if(vtel == "")
	{
		alert("Please input tel!");
		document.aa.tel.focus();
		return false
	}
	else if(vemail == "")
	{
		alert("Please input email!");
		document.aa.email.focus();
		return false
	}
	else if(vemail.length<3 || vemail.indexOf("@")<=0)
	{
		alert("Please input valid email!");
		document.aa.email.focus();
		return false
	}
}