function formvalidator(checkform){

var validchar = "abcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+=-`{}|\][;':,./?><* ";
var Invalidchar = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+=-`{}|\][;':,./?><*";
var ValidEmail = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@-._";
var validnum = "0123456789";
var ValidNAME = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";

if (checkform["FullName"].value == ""){
	alert('Please enter your full name.');
	checkform["FullName"].focus();
	return false;
	}
	
if (checkform["Sex"].value == ""){
	alert('Please select youe sex.');
	checkform["Sex"].focus();
	return false;
	}
	
if (checkform["MaritalStatus"].value == ""){
	alert('Please enter your marital status.');
	checkform["MaritalStatus"].focus();
	return false;
	}
	
if (checkform["Nationality"].value == ""){
	alert('Please enter your nationality.');
	checkform["Nationality"].focus();
	return false;
	}

if (checkform["NRICorPassportNo"].value == ""){
	alert('Please enter your NRIC or passport No.');
	checkform["NRICorPassportNo"].focus();
	return false;
	}

if (checkform["CurrentAddress"].value == ""){
	alert('Please enter your address.');
	checkform["CurrentAddress"].focus();
	return false;
	}
	
if (checkform["TelephoneNo"].value == ""){
	if (checkform["HandphoneNo"].value == ""){
	alert('Please enter your telephone number.');
	checkform["TelephoneNo"].focus();
	return false;
	}
	}

if (checkform["Email"].value == ""){
	alert('Please enter your email.');
	checkform["Email"].focus();
	return false;
	}

if (checkform.Email.value == ""){
	alert('Please enter your email address.');
	checkform.Email.focus();
	return false;
	}
	
if (checkform.Email.value != ""){
if (!IsValidEmail(checkform.Email.value)){
	alert('Please enter a valid email address.');
	checkform.Email.focus();
	return false;
	}
}


return true;
}


function IsValidEmail(str){
  var filter=/^.+@.+\..{2,3}$/
  return (filter.test(str))
}
