// JavaScript Document
function ShowMenu(obj)
{
		if(obj.style.display!="none")
		{
			obj.style.display="none";
		}else{
			obj.style.display="block";
		}
}

function CheckLogin(obj)
{
	if(obj.userName.value=="")
	{
		obj.userName.focus();
		return false;
	}
	if(obj.Password.value=="")
	{
		obj.Password.focus();
		return false;
	}
	return true;
}

function CheckOrder(obj)
{
	if(obj.account.value=="")
	{
		document.all.showerr.innerHTML="please fill in your paypal account email.";
		obj.account.focus();
		return false;	
	}
	if(!isEmail(obj.account.value))
	{
		document.all.showerr.innerHTML="please fill in your paypal account email.";
		obj.account.focus();
		return false;
	}
	if(obj.FistName.value=="")
	{
		document.all.showerr.innerHTML="please fill in your first name!";
		obj.FistName.focus();
		return false;
	}
	if(obj.FamilyName.value=="")
	{
		document.all.showerr.innerHTML="please fill in your family name!";
		obj.FamilyName.focus();
		return false;
	}
	if(obj.country.value=="")
	{
		document.all.showerr.innerHTML="please fill in your country name!";
		obj.country.focus();
		return false;
	}
	if(obj.tel.value=="")
	{
		document.all.showerr.innerHTML="please fill in your contact telephone number!";
		obj.tel.focus();
		return false;
	}
	if(obj.MSN.value=="")
	{
		document.all.showerr.innerHTML="please fill in your MSN or ICQ account!";
		obj.MSN.focus();
		return false;
	}
	document.all.showerr.innerHTML="";
	return true;
}

function changelocation(obj)
{
	document.all.checkimg.innerHTML="<img src='Images/face/"+obj+"' width='20' height='20'>";
}

function CheckReg(obj)
{
	if(obj.userName.value=="")
	{
		document.all.showerr.innerHTML="please fill in your paypal account email.";
		obj.userName.focus();
		return false;	
	}
	if(obj.Password.value=="")
	{
		document.all.showerr.innerHTML="please fill in your password.";
		obj.Password.focus();
		return false;	
	}
	if(obj.Password2.value!=obj.Password.value)
	{
		document.all.showerr.innerHTML="You two different input password.";
		obj.Password2.focus();
		return false;	
	}
	if(obj.problem.value=="")
	{
		document.all.showerr.innerHTML="please fill in secret question!";
		obj.problem.focus();
		return false;
	}
	if(obj.answer.value=="")
	{
		document.all.showerr.innerHTML="please fill in answer question!";
		obj.answer.focus();
		return false;
	}
	if(obj.FistName.value=="")
	{
		document.all.showerr.innerHTML="please fill in your first name!";
		obj.FistName.focus();
		return false;
	}
	if(obj.FamilyName.value=="")
	{
		document.all.showerr.innerHTML="please fill in your family name!";
		obj.FamilyName.focus();
		return false;
	}
	if(obj.country.value=="")
	{
		document.all.showerr.innerHTML="please fill in your country name!";
		obj.country.focus();
		return false;
	}
	if(obj.tel.value=="")
	{
		document.all.showerr.innerHTML="please fill in your contact telephone number!";
		obj.tel.focus();
		return false;
	}
	if(obj.MSN.value=="")
	{
		document.all.showerr.innerHTML="please fill in your MSN or ICQ account!";
		obj.MSN.focus();
		return false;
	}
	if(obj.icon.value=="")
	{
		document.all.showerr.innerHTML="please select face!";
		obj.icon.focus();
		return false;
	}
	document.all.showerr.innerHTML="";
	return true;
}

function CheckForget(obj)
{
	if(obj.userName.value=="")
	{
		obj.userName.focus();
		return false;
	}
	return true;
}

function CheckForgetNext(obj)
{
	if(obj.answer.value=="")
	{
		alert("Please fill in answers!");
		obj.answer.focus();
		return false;
	}
	return true;
}

function CheckForgetLast(obj)
{
if(obj.Password.value=="")
	{
		alert("please fill in your password.");
		obj.Password.focus();
		return false;	
	}
	if(obj.Password2.value!=obj.Password.value)
	{
		alert("You two different input password.");
		obj.Password2.focus();
		return false;	
	}
	return true;
}

function CheckMessage(obj)
{
	if(obj.email.value=="" ||  !isEmail(obj.email.value))	
	{
		alert("Please fill in the correct email!");
		obj.email.focus();
		return false;
	}
	if(obj.title.value=="")
	{
		alert("Please fill in title!");
		obj.title.focus();
		return false;
	}
	if(obj.info.value=="")
	{
		alert("Please fill in content!");
		obj.info.focus();
		return false;
	}
	return true;
}

function CheckChange(obj)
{
	if(obj.PwdOld.value=="")	
	{
		alert("Please fill in the old password!");
		obj.PwdOld.focus();
		return false;
	}
	if(obj.PwdNew.value=="")	
	{
		alert("Please fill in the new password!");
		obj.PwdNew.focus();
		return false;
	}
	if(obj.PwdNew.value!=obj.PwdNew2.value)
	{
		alert("You two different input password.");
		obj.PwdNew2.focus();
		return false;	
	}
	return true;
}