window.onload = windowload;
function windowload(){
	setHTML();
}
function KOver(id){
	document.getElementById(id).className="menu_"+id+"c";
}
function KOut(id){
	document.getElementById(id).className="menu_"+id;
}
function setHTML(){
	var h1=document.getElementById("pinky").offsetHeight;
	var h2=document.getElementById("phome").offsetHeight;	
	if (h1<h2)
	{
		document.getElementById("pinky").style.height=h2;
		document.getElementById("anna").style.height=h2;
	}else{
		document.getElementById("phome").style.height=h1;
		document.getElementById("anna").style.height=h1;
	}
}
//产品留言
function checklog(){
	if(document.ProductLog.ViewName.value==""){
		window.alert("Please input your Name.");
		document.ProductLog.ViewName.focus();
		return false;
	}
	if(document.ProductLog.email.value==""){
		window.alert("Please input your email.");
		document.ProductLog.email.focus();
		return false;
	}
	if(document.ProductLog.Comments.value==""){
		window.alert("Please input your Comments.");
		document.ProductLog.Comments.focus();
		return false;
	}
	return true;
}
//::::::::LOGIN CHECK
function LoginCheck(){	
	var UserName=document.getElementById("UID").value;
	if (UserName=="")
	{
		window.alert("No UserName!Input it First!");
		document.getElementById("UID").focus();
	}else{
		var Passwords=document.getElementById("PW").value;
		if (Passwords=="")
		{
			window.alert("No Passwords!Input it First!");
			document.getElementById("PW").focus();
		}else{
			document.location.href="Login_Check.asp?UserName="+UserName+"&Passwords="+Passwords;
		}
	}	
}
//::::::::产品图片变换
function ChangeImage(id){
	document.getElementById("BigImage").src=id.src;
	document.getElementById("BigLink").href=id.src;
}
//::::::::产品搜索
function Search(){
	if (document.getElementById("SearchValue").value!="")
	{
		var Url="Search.asp?SearchValue="+document.getElementById("SearchValue").value;
		window.location.href=Url;
	}
}
//::::::::会员注册::::::::::::
function CheckUser(){
	if (document.UserRes.UserName.value=="")
	{
		alert("Please input your Name.");
		document.UserRes.UserName.focus();
		return false;
	}
	if (document.UserRes.UserName.value.length<4)
	{
		alert("UserName must more then 4 letters!");
		document.UserRes.UserName.focus();
		return false;
	}
	if (document.UserRes.OldPassword.value=="")
	{
		alert("Please input Old Password.");
		document.UserRes.OldPassword.focus();
		return false;
	}
	if (document.UserRes.Password.value=="")
	{
		alert("Please input Password.");
		document.UserRes.Password.focus();
		return false;
	}
	if (document.UserRes.Password2.value=="")
	{
		alert("Please input rePassword.");
		document.UserRes.Password2.focus();
		return false;
	}
	if (document.UserRes.Password.value!=document.UserRes.Password2.value)
	{
		alert("Two Passwords are not equal.");
		document.UserRes.Password2.focus();
		return false;
	}
	if (document.UserRes.FirstName.value=="")
	{
		alert("Please input your First Name.");
		document.UserRes.FirstName.focus();
		return false;
	}
	if (document.UserRes.LastName.value=="")
	{
		alert("Please input your Last Name.");
		document.UserRes.LastName.focus();
		return false;
	}
	if ((document.UserRes.Email.value.indexOf("@")<0)||(document.UserRes.Email.value.indexOf(".")<0))
	{
		alert("Please input your Email.");
		document.UserRes.Email.focus();
		return false;
	}
	if (document.UserRes.Phone.value=="")
	{
		alert("Please input your TelePhone.");
		document.UserRes.Phone.focus();
		return false;
	}
	if (document.UserRes.Address.value=="")
	{
		alert("Please input your Address.");
		document.UserRes.Address.focus();
		return false;
	}
	if (document.UserRes.State.value=="")
	{
		alert("Please input your State.");
		document.UserRes.State.focus();
		return false;
	}
	if (document.UserRes.Country.value=="")
	{
		alert("Please input your Country.");
		document.UserRes.Country.focus();
		return false;
	}
	if (document.UserRes.ZipCode.value=="")
	{
		alert("Please input your Zip Code.");
		document.UserRes.ZipCode.focus();
		return false;
	}
	return true;
}
