<!--//--><![CDATA[//><!--
function validate(obj) {
	var tmp;
	if ($.trim($('#fullname').val())=="") {
		$.jGrowl("Please enter your fullname!");
		tmp = 'fullname';
	}
	if ($.trim($('#email1').val())=="") {
		$.jGrowl("Please enter your email address!");
		if (!tmp)
			tmp = 'email1';
	}
	else if (!check_email($('#email1').val())) {
		$.jGrowl("Please enter a valid email address!");
		if (!tmp)
			tmp = 'email1';
	}
	if ($('#password1').val()=="") {
		$.jGrowl("Please enter your password!");
		if (!tmp)
			tmp = 'password1';
	}
	else if ($('#password1').val().length<8) {
		$.jGrowl("Please enter at least 8 characters for your password!");
		if (!tmp)
			tmp = 'password1';
	}
	if ($('#password2').val()=="") {
		$.jGrowl("Please retype your password!");
		if (!tmp)
			tmp = 'password2';
	}
	else if ($('#password1').val()!=$('#password2').val()) {
		$.jGrowl("Your password entries do not match!");
		if (!tmp)
			tmp = 'password2';
	}
	if ($('#nationality')[0].selectedIndex==0) {
		$.jGrowl("Please select your nationality!");
		if (!tmp)
			tmp = 'nationality';
	}
	if ($.trim($('#nric').val())=="") {
		$.jGrowl("Please enter your NRIC / Passport No!");
		if (!tmp)
			tmp = 'nric';
	}
	else if ($('#nationality')[0].selectedIndex==1 || $('#nationality')[0].selectedIndex==2) {
		if (!checkNRIC($('#nric').val())) {
			$.jGrowl("The NRIC you key in is invalid!");
			if (!tmp)
				tmp = 'nric';
		}
	}
	if ($('#gender')[0].selectedIndex==0) {
		$.jGrowl("Please select your gender!");
		if (!tmp)
			tmp = 'gender';
	}
	if ($('#school')[0].selectedIndex==0) {
		$.jGrowl("Please select your school!");
		if (!tmp)
			tmp = 'school';
	}
	if (tmp) {
		$('#'+tmp).focus();
		return false;
	}
	obj.submit();
	return true;
}
//--><!]]>