﻿//Ham xu li ngay
function showdateVN()
{
	var dt = new Date();
	var strMonth = new Array("/ 1","/ 2","/ 3","/ 4","/ 5","/ 6",
                                                            "/ 7","/ 8","/ 9","/ 10","/ 11","/ 12"); 
	var strDay = new Array("Ch&#7911; Nh&#7853;t","Th&#7913; Hai","Th&#7913; Ba","Th&#7913;                                                           T&#432;","Th&#7913; N&#259;m","Th&#7913; Sáu","Th&#7913; B&#7843;y");			var date = "<span class='showDate'>" + strDay[dt.getDay()] + ", ";
	var years = dt.getYear();

	if(years<1900)
		years += 1900;

	return (date += dt.getDate() + strMonth[dt.getMonth()] + "/ " + years + "</span>");
}


	
	
//Check the enquiry form is filled in correctly
function CheckForm () { 

	//Initialise variables
	var errorMsg = "";

	//Check for a first name
	if (document.frmEnquiry.firstName.value == ""){
		errorMsg += "\n\tFirst Name \t- Enter your First Name";	
	}
	
	//Check for a last name
	if (document.frmEnquiry.lastName.value == ""){
		errorMsg += "\n\tLast Name \t- Enter your Last Name";
	}
	 	
	//Check for an e-mail address and that it is valid
	if ((document.frmEnquiry.email.value == "") || (document.frmEnquiry.email.value.length > 0 && (document.frmEnquiry.email.value.indexOf("@",0) == - 1 || document.frmEnquiry.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
	}
			
	//Check for an enquiry
	if (document.frmEnquiry.enquiry.value == "") { 
 		errorMsg += "\n\tEnquiry \t\t- Enter an enquiry";
	}
		
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Thong tin chua the gui di do co van de voi Form nhap lieu.\n";
		msg += "Xin vui long kiem tra lai va gui mot lan nua! Cam on!.\n";
		msg += "______________________________________________________________\n\n";
		msg += "Nhung noi dung co danh dau (*) phai co du lieu chinh xac: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}
// -->