// JavaScript Document
function registerCheck()
	{
		var theform = document.contactform;
		
		if(theform.email.value == "")
		{
			alert("Email can not empty!");
			theform.email.focus();
			return false;
		}
		if(theform.email.value != "")
		{
			var str = theform.email.value;
			if((str.indexOf('@',0) == -1)||(str.indexOf('.') == -1)||(str.length <5))
			{
				alert("Wrong Email Format!");
				theform.email.focus();
				return false;
			}
		}
		if(theform.matkhau.value == "")
		{
			alert("Password can not empty!");
			theform.matkhau.focus();
			return false;
		}
		if(theform.repassword.value == "")
		{
			alert("Repassword can not empty!");
			theform.repassword.focus();
			return false;
		}
		if(theform.repassword.value != theform.matkhau.value)
		{
			alert("Password and Repassword don't match!");
			theform.matkhau.focus();
			return false;
		}			
	}

function isCheck()
	{
		var theform = document.contactform;
		
		if(theform.contact_name.value == "") {
			alert("Vui lòng nhập tên!");
			theform.contact_name.focus();			
			return false;
		}
		if(theform.address.value == "") {
			alert("Vui lòng nhập địa chỉ!");
			theform.address.focus();
			return false;
		}
		if(theform.phone.value == "") {
			alert("Vui lòng nhập số điện thoại!");
			 
			theform.phone.focus();
			return false;
		}
		if(theform.email.value == "")
		{
			alert("Vui lòng nhập email!");
			theform.email.focus();
			return false;
		}
		if(theform.email.value != "")
		{
			var str = theform.email.value;
			if((str.indexOf('@',0) == -1)||(str.indexOf('.') == -1)||(str.length <5))
			{
				alert("Email không hợp lệ!");
				theform.email.focus();
				return false;
			}
		}
		if(theform.content.value == "")
		{
			alert("Vui lòng nhập nội dung!");
			theform.content.focus();
			return false;
		}	
	}