//function to validate the fields in checkregistration
function checkregistration() {

	//Validating the name
	if (trim(frmRegister.studentName.value) == "") {
		alert("Please enter your full name.")
		frmRegister.studentName.focus();
		return false;
	}

	//Validating the IC
	if (trim(frmRegister.studentNRIC.value) == "") {
		alert("Please enter your IC/Passport No.")
		frmRegister.studentNRIC.focus();
		return false;
	}

	if (trim(frmRegister.studentPassType.value) == "0"){
		alert("Please select your Pass Type.");
		frmRegister.studentPassType.focus();
		return false;
	}

	//STARTING DATE OF BIRTH VALIDATION
	var leap = 0;

	var dday = frmRegister.DateBD.value
	var mmonth = frmRegister.MonthBD.value
	var yyear = frmRegister.YearBD.value	
	
	if (dday=="0"){
		alert("Please select your Birth Day.");
		frmRegister.DateBD.focus();
		return false;
	}

	if (mmonth=="0"){
		alert("Please select your Birth Month.");
		frmRegister.MonthBD.focus();
		return false;
	}
	
	if (yyear=="0"){
		alert("Please select your Birth Year.");
		frmRegister.YearBD.focus();
		return false;
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid Date of Birth.")
		 frmRegister.DateBD.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid Date of Birth, February's leap year does not have day "+dday+".");
		frmRegister.DateBD.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid Date of Birth, February does not have day "+dday+".");
		frmRegister.DateBD.focus();
		return false;
	 }

	//END OF DATE OF BIRTH VALIDATION

	//Validating the nationality
	if (trim(frmRegister.studentNationality.value) == "") {
		alert("Please enter your nationality.")
		frmRegister.studentNationality.focus();
		return false;
	}

	if (trim(frmRegister.studentCountryBirth.value) == "") {
		alert("Please enter your Country of Birth.")
		frmRegister.studentCountryBirth.focus();
		return false;
	}

	if (trim(frmRegister.studentAddress.value)==""){
		alert("Please enter your address.");
		frmRegister.studentAddress.focus();
		return false;
	}

	if (trim(frmRegister.studentCountry.value)==""){
		alert("Please enter the country.");
		frmRegister.studentCountry.focus();
		return false;
	}

	if (trim(frmRegister.studentPostal.value) == "") {
		alert("Please enter your postal code.")
		frmRegister.studentPostal.focus();
		return false;
	}

	if (!chknumber(frmRegister.studentPostal.value)) {
		alert("Please enter only digits in the postal code.")
		frmRegister.studentPostal.focus();
		return false;
	}

	//Validating the email
	if (trim(frmRegister.studentEmail.value) == "") {
		alert("Please enter your E-mail address.")
		frmRegister.studentEmail.focus();
		return false;
	}

	if (frmRegister.studentEmail.value != "") {
		if (!chkmail(frmRegister.studentEmail.value)) {
			alert("Please enter a valid E-mail address.");
			frmRegister.studentEmail.focus();
			return false;
		}
	}

	if (trim(frmRegister.studentMobile.value)==""){
		alert("Please enter your mobile number.");
		frmRegister.studentMobile.focus();
		return false;
	}

	if (trim(frmRegister.studentMobile.value) != "") {
		if (!chknumber(frmRegister.studentMobile.value)) {
			alert("Please enter a valid telephone number.");
			frmRegister.studentMobile.focus();
			return false;
		}
	}
	
	if (trim(frmRegister.studentTel.value)==""){
		alert("Please enter your telephone number.");
		frmRegister.studentTel.focus();
		return false;
	}

	if (trim(frmRegister.studentTel.value) != "") {
		if (!chknumber(frmRegister.studentTel.value)) {
			alert("Please enter a valid telephone number.");
			frmRegister.studentTel.focus();
			return false;
		}
	}
	
	//***********************************************************************
	//STARTING VALIDATION EDU 1 (start)
	var leap = 0;

	var dday = frmRegister.startDay1.value
	var mmonth = frmRegister.startMonth1.value
	var yyear = frmRegister.startYear1.value	

	if (dday!=""){
		if (mmonth==""){
			alert("Please select the School Start Month.");
			frmRegister.startMonth1.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.startYear1.focus();
			return false;
		}		
	}
	if (mmonth!=""){
		if (dday==""){
			alert("Please select the School Start Day.");
			frmRegister.startDay1.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.startYear1.focus();
			return false;
		}		
	}
	if (yyear!=""){
		if (dday==""){
			alert("Please select the School Start Day.");
			frmRegister.startDay1.focus();
			return false;
		}	
		if (mmonth==""){
			alert("Please select the School Start Month.");
			frmRegister.startMonth1.focus();
			return false;
		}		
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid School Start Date.")
		 frmRegister.startMonth1.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid School Start Date, February's leap year does not have day "+dday+".");
		frmRegister.startDay1.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid School Start Date, February does not have day "+dday+".");
		frmRegister.startDay1.focus();
		return false;
	 }

	//END OF VALIDATION EDU 1 (start)

	//STARTING VALIDATION EDU 1 (end)
	var leap = 0;

	var dday = frmRegister.endDay1.value
	var mmonth = frmRegister.endMonth1.value
	var yyear = frmRegister.endYear1.value	

	if (dday!=""){
		if (mmonth==""){
			alert("Please select the School End Month.");
			frmRegister.endMonth1.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.endYear1.focus();
			return false;
		}		
	}
	if (mmonth!=""){
		if (dday==""){
			alert("Please select the School End Day.");
			frmRegister.endDay1.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School End Year.");
			frmRegister.endYear1.focus();
			return false;
		}		
	}
	if (yyear!=""){
		if (dday==""){
			alert("Please select the School End Day.");
			frmRegister.endDay1.focus();
			return false;
		}	
		if (mmonth==""){
			alert("Please select the School End Month.");
			frmRegister.endMonth1.focus();
			return false;
		}		
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid School End Date.")
		 frmRegister.endMonth1.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid School End Date, February's leap year does not have day "+dday+".");
		frmRegister.endDay1.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid School End Date, February does not have day "+dday+".");
		frmRegister.endDay1.focus();
		return false;
	 }

	//END OF VALIDATION EDU 1 (end)
	//***********************************************************************



	//***********************************************************************
	//STARTING VALIDATION EDU 2 (start)
	var leap = 0;

	var dday = frmRegister.startDay2.value
	var mmonth = frmRegister.startMonth2.value
	var yyear = frmRegister.startYear2.value	

	if (dday!=""){
		if (mmonth==""){
			alert("Please select the School Start Month.");
			frmRegister.startMonth2.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.startYear2.focus();
			return false;
		}		
	}
	if (mmonth!=""){
		if (dday==""){
			alert("Please select the School Start Day.");
			frmRegister.startDay2.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.startYear2.focus();
			return false;
		}		
	}
	if (yyear!=""){
		if (dday==""){
			alert("Please select the School Start Day.");
			frmRegister.startDay2.focus();
			return false;
		}	
		if (mmonth==""){
			alert("Please select the School Start Month.");
			frmRegister.startMonth2.focus();
			return false;
		}		
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid School Start Date.")
		 frmRegister.startMonth2.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid School Start Date, February's leap year does not have day "+dday+".");
		frmRegister.startDay2.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid School Start Date, February does not have day "+dday+".");
		frmRegister.startDay2.focus();
		return false;
	 }

	//END OF VALIDATION EDU 2 (start)

	//STARTING VALIDATION EDU 2 (end)
	var leap = 0;

	var dday = frmRegister.endDay2.value
	var mmonth = frmRegister.endMonth2.value
	var yyear = frmRegister.endYear2.value	

	if (dday!=""){
		if (mmonth==""){
			alert("Please select the School End Month.");
			frmRegister.endMonth2.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.endYear2.focus();
			return false;
		}		
	}
	if (mmonth!=""){
		if (dday==""){
			alert("Please select the School End Day.");
			frmRegister.endDay2.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School End Year.");
			frmRegister.endYear2.focus();
			return false;
		}		
	}
	if (yyear!=""){
		if (dday==""){
			alert("Please select the School End Day.");
			frmRegister.endDay2.focus();
			return false;
		}	
		if (mmonth==""){
			alert("Please select the School End Month.");
			frmRegister.endMonth2.focus();
			return false;
		}		
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid School End Date.")
		 frmRegister.endMonth2.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid School End Date, February's leap year does not have day "+dday+".");
		frmRegister.endDay2.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid School End Date, February does not have day "+dday+".");
		frmRegister.endDay2.focus();
		return false;
	 }

	//END OF VALIDATION EDU 2 (end)
	//***********************************************************************


	//***********************************************************************
	//STARTING VALIDATION EDU 3 (start)
	var leap = 0;

	var dday = frmRegister.startDay3.value
	var mmonth = frmRegister.startMonth3.value
	var yyear = frmRegister.startYear3.value	

	if (dday!=""){
		if (mmonth==""){
			alert("Please select the School Start Month.");
			frmRegister.startMonth3.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.startYear3.focus();
			return false;
		}		
	}
	if (mmonth!=""){
		if (dday==""){
			alert("Please select the School Start Day.");
			frmRegister.startDay3.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.startYear3.focus();
			return false;
		}		
	}
	if (yyear!=""){
		if (dday==""){
			alert("Please select the School Start Day.");
			frmRegister.startDay3.focus();
			return false;
		}	
		if (mmonth==""){
			alert("Please select the School Start Month.");
			frmRegister.startMonth3.focus();
			return false;
		}		
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid School Start Date.")
		 frmRegister.startMonth3.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid School Start Date, February's leap year does not have day "+dday+".");
		frmRegister.startDay3.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid School Start Date, February does not have day "+dday+".");
		frmRegister.startDay3.focus();
		return false;
	 }

	//END OF VALIDATION EDU 3 (start)

	//STARTING VALIDATION EDU 3 (end)
	var leap = 0;

	var dday = frmRegister.endDay3.value
	var mmonth = frmRegister.endMonth3.value
	var yyear = frmRegister.endYear3.value	

	if (dday!=""){
		if (mmonth==""){
			alert("Please select the School End Month.");
			frmRegister.endMonth3.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.endYear3.focus();
			return false;
		}		
	}
	if (mmonth!=""){
		if (dday==""){
			alert("Please select the School End Day.");
			frmRegister.endDay3.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School End Year.");
			frmRegister.endYear3.focus();
			return false;
		}		
	}
	if (yyear!=""){
		if (dday==""){
			alert("Please select the School End Day.");
			frmRegister.endDay3.focus();
			return false;
		}	
		if (mmonth==""){
			alert("Please select the School End Month.");
			frmRegister.endMonth3.focus();
			return false;
		}		
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid School End Date.")
		 frmRegister.endMonth3.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid School End Date, February's leap year does not have day "+dday+".");
		frmRegister.endDay3.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid School End Date, February does not have day "+dday+".");
		frmRegister.endDay3.focus();
		return false;
	 }

	//END OF VALIDATION EDU 3 (end)
	//***********************************************************************

	//***********************************************************************
	//STARTING VALIDATION EDU 4 (start)
	var leap = 0;

	var dday = frmRegister.startDay4.value
	var mmonth = frmRegister.startMonth4.value
	var yyear = frmRegister.startYear4.value	

	if (dday!=""){
		if (mmonth==""){
			alert("Please select the School Start Month.");
			frmRegister.startMonth4.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.startYear4.focus();
			return false;
		}		
	}
	if (mmonth!=""){
		if (dday==""){
			alert("Please select the School Start Day.");
			frmRegister.startDay4.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.startYear4.focus();
			return false;
		}		
	}
	if (yyear!=""){
		if (dday==""){
			alert("Please select the School Start Day.");
			frmRegister.startDay4.focus();
			return false;
		}	
		if (mmonth==""){
			alert("Please select the School Start Month.");
			frmRegister.startMonth4.focus();
			return false;
		}		
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid School Start Date.")
		 frmRegister.startMonth4.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid School Start Date, February's leap year does not have day "+dday+".");
		frmRegister.startDay4.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid School Start Date, February does not have day "+dday+".");
		frmRegister.startDay4.focus();
		return false;
	 }

	//END OF VALIDATION EDU 4 (start)

	//STARTING VALIDATION EDU 4 (end)
	var leap = 0;

	var dday = frmRegister.endDay4.value
	var mmonth = frmRegister.endMonth4.value
	var yyear = frmRegister.endYear4.value	

	if (dday!=""){
		if (mmonth==""){
			alert("Please select the School End Month.");
			frmRegister.endMonth4.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School Start Year.");
			frmRegister.endYear4.focus();
			return false;
		}		
	}
	if (mmonth!=""){
		if (dday==""){
			alert("Please select the School End Day.");
			frmRegister.endDay4.focus();
			return false;
		}	
		if (yyear==""){
			alert("Please select the School End Year.");
			frmRegister.endYear4.focus();
			return false;
		}		
	}
	if (yyear!=""){
		if (dday==""){
			alert("Please select the School End Day.");
			frmRegister.endDay4.focus();
			return false;
		}	
		if (mmonth==""){
			alert("Please select the School End Month.");
			frmRegister.endMonth4.focus();
			return false;
		}		
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid School End Date.")
		 frmRegister.endMonth4.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid School End Date, February's leap year does not have day "+dday+".");
		frmRegister.endDay4.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid School End Date, February does not have day "+dday+".");
		frmRegister.endDay4.focus();
		return false;
	 }

	//END OF VALIDATION EDU 4 (end)
	//***********************************************************************

	if (frmRegister.declaration.checked == false) {
		alert("Please read and accept the Declaration.");
		return false;
	}
	
		
	frmRegister.submit();
}// checkregistration function



//function to validate the fields in edit profile
function checkeditprofile() {

	if (trim(frmRegister.studentPassType.value) == "0"){
		alert("Please select your Pass Type.");
		frmRegister.studentPassType.focus();
		return false;
	}

	//STARTING DATE OF BIRTH VALIDATION
	var leap = 0;

	var dday = frmRegister.DateBD.value
	var mmonth = frmRegister.MonthBD.value
	var yyear = frmRegister.YearBD.value	
	
	if (dday=="0"){
		alert("Please select your Birth Day.");
		frmRegister.DateBD.focus();
		return false;
	}

	if (mmonth=="0"){
		alert("Please select your Birth Month.");
		frmRegister.MonthBD.focus();
		return false;
	}
	
	if (yyear=="0"){
		alert("Please select your Birth Year.");
		frmRegister.YearBD.focus();
		return false;
	}

	/* Validation of other months with day 31 */
	 if ((dday > 30) && ((mmonth == 4) || (mmonth == 6) || (mmonth == 9) || (mmonth == 11))) {
		 alert("Please enter a valid Date of Birth.")
		 frmRegister.DateBD.focus();
		 return false;
	}
		
	/* Validation leap-year / february / day */
	if ((yyear % 4 == 0) || (yyear % 100 == 0) || (yyear % 400 == 0)) {
		 leap = 1;
	 }

	if ((mmonth == 2) && (leap == 1) && (dday > 29)) {
		alert("Please select a valid Date of Birth, February's leap year does not have day "+dday+".");
		frmRegister.DateBD.focus();
		return false;
	 }

	 if ((mmonth == 2) && (leap != 1) && (dday > 28)) {
		alert("Please select a valid Date of Birth, February does not have day "+dday+".");
		frmRegister.DateBD.focus();
		return false;
	 }

	//END OF DATE OF BIRTH VALIDATION

	//Validating the nationality
	if (trim(frmRegister.studentNationality.value) == "") {
		alert("Please enter your nationality.")
		frmRegister.studentNationality.focus();
		return false;
	}

	if (trim(frmRegister.studentCountryBirth.value) == "") {
		alert("Please enter your Country of Birth.")
		frmRegister.studentCountryBirth.focus();
		return false;
	}

	if (trim(frmRegister.studentAddress.value)==""){
		alert("Please enter your address.");
		frmRegister.studentAddress.focus();
		return false;
	}

	if (trim(frmRegister.studentCountry.value)==""){
		alert("Please enter the country.");
		frmRegister.studentCountry.focus();
		return false;
	}

	if (trim(frmRegister.studentPostal.value) == "") {
		alert("Please enter your postal code.")
		frmRegister.studentPostal.focus();
		return false;
	}

	if (!chknumber(frmRegister.studentPostal.value)) {
		alert("Please enter only digits in the postal code.")
		frmRegister.studentPostal.focus();
		return false;
	}

	//Validating the email
	if (trim(frmRegister.studentEmail.value) == "") {
		alert("Please enter your E-mail address.")
		frmRegister.studentEmail.focus();
		return false;
	}

	if (frmRegister.studentEmail.value != "") {
		if (!chkmail(frmRegister.studentEmail.value)) {
			alert("Please enter a valid E-mail address.");
			frmRegister.studentEmail.focus();
			return false;
		}
	}

	if (trim(frmRegister.studentMobile.value)==""){
		alert("Please enter your mobile number.");
		frmRegister.studentMobile.focus();
		return false;
	}

	if (trim(frmRegister.studentMobile.value) != "") {
		if (!chknumber(frmRegister.studentMobile.value)) {
			alert("Please enter a valid telephone number.");
			frmRegister.studentMobile.focus();
			return false;
		}
	}
	
	if (trim(frmRegister.studentTel.value)==""){
		alert("Please enter your telephone number.");
		frmRegister.studentTel.focus();
		return false;
	}

	if (trim(frmRegister.studentTel.value) != "") {
		if (!chknumber(frmRegister.studentTel.value)) {
			alert("Please enter a valid telephone number.");
			frmRegister.studentTel.focus();
			return false;
		}
	}


	
		
	frmRegister.submit();
}// checkeditprofile function


//validate login form
function validatelogin(){
	if (trim(frmlogin.nric.value)==""){
		alert("Please enter in your NRIC to log-in.");
		frmlogin.nric.focus();
		return;
	}

	if (trim(frmlogin.password.value)==""){
		alert("Please enter in your password to log-in.");
		frmlogin.password.focus();
		return;
	}
	
	frmlogin.submit();
}//validatelogin


//add material
function validateUploadMaterial() {

	var oRegEx=/\.doc$|\.pdf$|\.rtf$|\.txt$/gi;
	if(!oRegEx.test(frmdocument.filename.value)){
		alert("Please check that your document is one of the following formats and has the correct file extension:\n\n- Microsoft Word Document (*.doc, *.rtf)\n- Adobe Portable Document Format (*.pdf)\n- Rich Text Format (*.rtf)\n- Text Only (*.txt)\n\n");
		frmdocument.filename.focus();
		return ;
	}
					
		frmdocument.submit()
	}//validateUploadMaterial


