/*-------------------------------- start of login validation perumahan swasta form  function -------------------------------------------*/

function validateformperumahanswasta(form,path) 
{
	var theMessage = "Sila isikan sekurang-kurangnya\nsalah satu dari yang berikut:\n";
	var noErrors = theMessage;
	var listChecknegeri = document.formcarian.NegeriPerumahan.selectedIndex;
	var listCheckdaerah = document.formcarian.DaerahPerumahan.selectedIndex;
	var listCheckjenis = document.formcarian.JenisRumah.selectedIndex;
	// Make sure a selection list is used
	if (document.formcarian.NegeriPerumahan.options[listChecknegeri].value=="none" && document.formcarian.DaerahPerumahan.options[listCheckdaerah].value=="none" && document.formcarian.JenisRumah.options[listCheckjenis].value=="none" && document.formcarian.anggaranmin.value=="" && document.formcarian.anggaranmax.value=="" && document.formcarian.namaprojek.value=="") {
		theMessage = theMessage + "\nNegeri\nDaerah\nJenis\n\Projek\nHarga Minimum\nHarga Maksimum";
	}
	if (document.formcarian.DaerahPerumahan.options[listCheckdaerah].value!="none" && document.formcarian.NegeriPerumahan.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nNegeri\nDaerah\nJenis";
	}
	/*if (
		(document.formcarian.NegeriPerumahan.options[listChecknegeri].value!="none" && (document.formcarian.DaerahPerumahan.options[listCheckdaerah].value=="none" || document.formcarian.JenisRumah.options[listCheckjenis].value=="none")) 
		|| (document.formcarian.DaerahPerumahan.options[listCheckdaerah].value!="none" && (document.formcarian.NegeriPerumahan.options[listChecknegeri].value=="none" || document.formcarian.JenisRumah.options[listCheckjenis].value=="none")) 
		|| (document.formcarian.JenisRumah.options[listCheckjenis].value!="none" && (document.formcarian.NegeriPerumahan.options[listChecknegeri].value=="none" || document.formcarian.DaerahPerumahan.options[listCheckdaerah].value=="none"))
		) {
		theMessage = theMessage + "\nNegeri\nDaerah\nJenis";
	}
	if((document.formcarian.anggaranmin.value!="" && document.formcarian.anggaranmax.value=="") || (document.formcarian.anggaranmax.value!="" && document.formcarian.anggaranmin.value==""))
	{
		theMessage = theMessage + "\nHarga Minimum\nHarga Maksimum";
	}*/
	// If errors were found, show alert message
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If no errors, submit the form
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------- end of login validation perumahan swasta form  function -------------------------------------------*/

/*------------------------------ start of login validation perumahan swasta district form  function ----------------------------------*/
function validateformperumahanswastaditrict(form,path) 
{
	var theMessage = "Sila pilih Negeri bagi Daerah\nyang ingin anda pilih";
	var noErrors = theMessage;
	var listChecknegeri = document.formcarian.NegeriPerumahan.selectedIndex;
	var listCheckdaerah = document.formcarian.DaerahPerumahan.selectedIndex;
	var listCheckjenis = document.formcarian.JenisRumah.selectedIndex;
	// Make sure a selection list is used
	if (document.formcarian.NegeriPerumahan.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + " ";
		document.formcarian.NegeriPerumahan.focus();
	}
	// If errors were found, show alert message
	if (theMessage == noErrors) 
	{
		formcarian.action= path + 'carianperumahan.cfm'
		return true;
	} 
	// If no errors, submit the form
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*------------------------------ end of login validation perumahan swasta district form  function -----------------------------------*/

/*------------------------------ start of login validation perumahan swasta district form  function ----------------------------------*/
function validateformperumahanswastalength(form,path) 
{
	var theMessage = "Sila pastikan nama projek\nlebih daripada 4 huruf";
	var noErrors = theMessage;
	var ss=document.formcarian.namaprojek.value;
	result = ss.length;

	// Make sure a selection list is used
	if (result<5) 
	{
		theMessage = theMessage + " ";
	}
	// If errors were found, show alert message
	if (theMessage == noErrors) 
	{
		formcarian.action= path + 'carianperumahan.cfm'
		return true;
	} 
	// If no errors, submit the form
	else 	
	{
		alert(theMessage);
		document.formcarian.namaprojek.focus();
		return false;
	}
}
// End -->

/*------------------------------ end of login validation perumahan swasta district form  function -----------------------------------*/

/*------------------------------ start of login validation perumahan swasta district form  function ----------------------------------*/
function validateformperumahanswastalength(form,path) 
{
	var theMessage = "Sila pastikan nama Projek\nlebih daripada 4 huruf";
	var noErrors = theMessage;
	var ss=document.formcarian.namaprojek.value;
	result = ss.length;

	// Make sure a selection list is used
	if (ss!= "" && result<5) 
	{
		theMessage = theMessage + " ";
	}
	// If errors were found, show alert message
	if (theMessage == noErrors) 
	{
		formcarian.action= path + 'carianperumahan.cfm';
		return true;
	} 
	// If no errors, submit the form
	else 	
	{
		alert(theMessage);
		document.formcarian.namaprojek.focus();
		return false;
	}
}
// End -->

/*------------------------------ end of login validation perumahan swasta district form  function -----------------------------------*/

/*------------------------------ start of login validation perumahan swasta district form  function ----------------------------------*/
function validateformpemajunamalength(form,path) 
{
	var theMessage = "Sila pastikan Nama \nlebih daripada 4 huruf";
	var noErrors = theMessage;
	var ss=document.formcarian.namapemaju.value;
	result = ss.length;

	// Make sure a selection list is used
	if (ss!= "" && result<5) 
	{
		theMessage = theMessage + " ";
	}
	// If errors were found, show alert message
	if (theMessage == noErrors) 
	{
		formcarian.action= path + 'carianperumahan.cfm';
		return true;
	} 
	// If no errors, submit the form
	else 	
	{
		alert(theMessage);
		document.formcarian.namapemaju.focus();
		return false;
	}
}
// End -->

/*------------------------------ end of login validation perumahan swasta district form  function -----------------------------------*/

/*------------------------------ start of login validation perumahan swasta district form  function ----------------------------------*/
function validateformpemajuroclength(form,path) 
{
	var theMessage = "Sila pastikan nama ROC\nlebih daripada 4 huruf";
	var noErrors = theMessage;
	var pp=document.formcarian.roc.value;
	results = pp.length;

	// Make sure a selection list is used
	if (pp!= "" && results<5) 
	{
		theMessage = theMessage + " ";
	}
	// If errors were found, show alert message
	if (theMessage == noErrors) 
	{
		formcarian.action= path + 'carianperumahan.cfm';
		return true;
	} 
	// If no errors, submit the form
	else 	
	{
		alert(theMessage);
		document.formcarian.roc.focus();
		return false;
	}
}
// End -->

/*------------------------------ end of login validation perumahan swasta district form  function -----------------------------------*/

/*-------------------------------- start of login validation perumahan ppr form  function -------------------------------------------*/

function validateformperumahanppr(form,path) 
{
	var theMessage = "Sila isikan sekurang-kurangnya\nsalah satu dari yang berikut:\n";
	var noErrors = theMessage;
	var listChecknegeri_ppr = document.formcarian.negeri_ppr.selectedIndex;
	var listCheckJenisRumah_ppr = document.formcarian.JenisRumah_ppr.selectedIndex;
	// Make sure a selection list is used
	if (document.formcarian.negeri_ppr.options[listChecknegeri_ppr].value=="none" && document.formcarian.JenisRumah_ppr.options[listCheckJenisRumah_ppr].value=="none") {
		theMessage = theMessage + "\nNegeri\nJenis";
	}
	/*if (document.formcarian.JenisRumah_ppr.options[listCheckJenisRumah_ppr].value=="none") {
		theMessage = theMessage + "\nJenis";
	}*/
	// If errors were found, show alert message
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If no errors, submit the form
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------- end of login validation perumahan ppr form  function -------------------------------------------*/
/*-------------------------------- start of login validation pemaju form  function -------------------------------------------*/

function validateformpemaju(form,path) 
{
	var theMessage = "Sila isikan sekurang-kurangnya\nsalah satu dari yang berikut:\n";
	var noErrors = theMessage;
	var listChecknegeripemaju = document.formcarian.NegeriPemaju.selectedIndex;
	// Make sure a selection list is used
	if (document.formcarian.namapemaju.value=="" && document.formcarian.NegeriPemaju.options[listChecknegeripemaju].value=="none" && document.formcarian.roc.value=="") 
	{
		theMessage = theMessage + "\nNama\nNegeri\nROC";
	}
	// If errors were found, show alert message
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If no errors, submit the form
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------- end of login validation pemaju form  function -------------------------------------------*/
function enabledisableformpemajufield(form,field)
{
	/*alert('test '+ field);*/
	if(field=="namapemaju")
	{
		if(document.formcarian.namapemaju.value!="")
		{
			document.formcarian.roc.disabled = true;
		}
		else
		{
			document.formcarian.roc.disabled = false;
		}
	}
	if(field=="namaprojek")
	{
		if(document.formcarian.namaprojek.value!="")
		{
			document.formcarian.namapemaju.disabled = true;
			document.formcarian.roc.disabled = true;
		}
		else
		{
			document.formcarian.namapemaju.disabled = false;
			document.formcarian.roc.disabled = false;
		}
	}
	if(field=="roc")
	{
		if(document.formcarian.roc.value!="")
		{
			document.formcarian.namapemaju.disabled = true;
			document.formcarian.NegeriPemaju.disabled = true;
		}
		else
		{
			document.formcarian.namapemaju.disabled = false;
			document.formcarian.NegeriPemaju.disabled = false;
		}
	}
}
/*--------------------------------------- start of login validation form  function -------------------------------------------*/

function validateloginform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.formlogmasuk.katanama.value=="")
	{
		theMessage = theMessage + "\nKata Nama";
	}
	// make sure field is not blank
	if (document.formlogmasuk.katalaluan.value=="")
	{
		theMessage = theMessage + "\nKata Laluan";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------------------- end of login validation form  function --------------------------------------*/

/*--------------------------------------- start of login validation form  function -------------------------------------------*/

function validateregisterform() 
{
	var theMessage = "Sila isikan semua maklumat berikut: \n";
	var noErrors = theMessage
	// make sure field is not blank
	if (document.registerform.katanama.value=="")
	{
		theMessage = theMessage + "\nKata Nama";
	}
	// make sure field is not blank
	if (document.registerform.katalaluan.value=="")
	{
		theMessage = theMessage + "\nKata Laluan";
	}
	if(document.registerform.katalaluan.value!=document.registerform.pengesahankatalaluan.value) 
	{
		theMessage = theMessage + "\nKatalaluan dan pengesahan katalaluan harus sama";
	}
	// make sure field is not blank
	if (document.registerform.pengesahankatalaluan.value=="")
	{
		theMessage = theMessage + "\nPengesahan Kata Laluan";
	}
	// make sure field is not blank
	if (document.registerform.nama.value=="")
	{
		theMessage = theMessage + "\nNama";
	}
	// make sure field is not blank
	if (document.registerform.noic.value=="")
	{
		theMessage = theMessage + "\nNo Kad Pengenalan";
	}
	
	// make sure field is not blank
	if (document.registerform.nohp.value=="")
	{
		theMessage = theMessage + "\nNo Tel  [HP]";
	}
	// make sure field is not blank
	if (document.registerform.emel.value=="")
	{
		theMessage = theMessage + "\nEmail";
	}
	var listCheckkategori = document.registerform.kategori.selectedIndex;
	// Make sure a selection list is used
	//if (document.registerform.kategori.options[listCheckkategori].value=="none") 
	//{
		//theMessage = theMessage + "\nKategori Pendaftaran";
	//}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------------------- end of login validation form  function ---------------------------------------*/

/*--------------------------------------- start of login validation form  function -------------------------------------------*/

function validateadminformkemaskinimaklumat(form) 
{
	var e = form.elements;
	var theMessage = "Sila isikan semua maklumat berikut: \n";
	var noErrors = theMessage
	// make sure field is not blank
	if (document.updateprofileform.katanama.value=="")
	{
		theMessage = theMessage + "\nKata Nama";
	}
	// make sure field is not blank
	if (document.updateprofileform.katalaluan.value=="")
	{
		theMessage = theMessage + "\nKata Laluan";
	}
	if(document.updateprofileform.katalaluan.value!=document.updateprofileform.pengesahankatalaluan.value) 
	{
		theMessage = theMessage + "\nKatalaluan dan pengesahan katalaluan harus sama";
	}
	// make sure field is not blank
	if (document.updateprofileform.pengesahankatalaluan.value=="")
	{
		theMessage = theMessage + "\nPengesahan Kata Laluan";
	}
	// make sure field is not blank
	if (document.updateprofileform.nama.value=="")
	{
		theMessage = theMessage + "\nNama";
	}
	// make sure field is not blank
	if (document.updateprofileform.noic.value=="")
	{
		theMessage = theMessage + "\nNo Kad Pengenalan";
	}
	
	// make sure field is not blank
	if (document.updateprofileform.nohp.value=="")
	{
		theMessage = theMessage + "\nNo Tel  [HP]";
	}
	// make sure field is not blank
	if (document.updateprofileform.emel.value=="")
	{
		theMessage = theMessage + "\nEmail";
	}
	var listCheckkategori = document.updateprofileform.kategori.selectedIndex;
	// Make sure a selection list is used
	if (document.updateprofileform.kategori.options[listCheckkategori].value=="none") 
	{
		theMessage = theMessage + "\nKategori Pendaftaran";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------------------- end of login validation form  function ------------------------------------*/
/*------------------------------------------ start of password validation form  function ------------------------------------*/
function validatepassword(form) {
  var e = form.elements;

  /* Your validation code. */

  if(e['password'].value != e['confirm-password'].value) {
    alert('Your passwords do not match. Please type more carefully.');
    return false;
  }
  return true;
}
/*-------------------------------------------- end of login validation form  function ----------------------------------------*/
/*------------------------------------------- start of polls validation form  function ----------------------------------------*/
function validatepolls(form,path) {
	var theMessage = "Sila isikan salah satu\ndaripada yang berikut";
	// make sure a radio button is selected
	var radioCheck = false;
	for (i = 0; i < document.poolform.p_ansvers_number.length; i++) {
	if (document.poolform.p_ansvers_number[i].checked)
	{
	poolform.action= path + 'interaksi/poll_display.cfm';
	radioCheck = true; 
	}
	}
	if (!radioCheck) {
	alert(theMessage);
	return false;
	}
}
/*-------------------------------------------- end of polls validation form  function ----------------------------------------*/
/*------------------------------------------- start of polls validation form  function ---------------------------------------*/
function validatepollss(form,path) {
	var theMessage = "Sila isikan salah satu\ndaripada yang berikut";
	// make sure a radio button is selected
	var radioCheck = false;
	for (i = 0; i < document.poolforms.p_ansvers_number.length; i++) {
	if (document.poolforms.p_ansvers_number[i].checked)
	{
	poolforms.action= path + 'interaksi/poll_display.cfm';
	radioCheck = true; 
	}
	}
	if (!radioCheck) {
	alert(theMessage);
	return false;
	}
}
/*-------------------------------------------- end of polls validation form  function -----------------------------------------*/
/*-------------------------------------------- end of login validation form  function -----------------------------------------*/
function validateadminpolls(form,path) 
{
	var theMessage = "Sila isikan semua maklumat berikut: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	var listCheckQuestion = document.fAdminUndian.selectQuestion.selectedIndex;
	// Make sure a selection list is used
	if (document.fAdminUndian.selectQuestion.options[listCheckQuestion].value=="0") 
	{
		theMessage = theMessage + "\nSoalan Undian";
	}
	// make sure field is not blank
	if (document.fAdminUndian.P_ANSVER.value=="")
	{
		theMessage = theMessage + "\nJawapan Undian";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
	/*fAdminUndian.action= path + 'admin/poll_admin_process.cfm?task=daftar';*/
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
/*-------------------------------------------- end of login validation form  function --------------------------------------*/
/*-------------------------------------------- end of login validation form  function ---------------------------------------*/
function validateadminpolluestions(form,path) 
{
	var theMessage = "Sila isikan maklumat berikut: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	// make sure field is not blank
	if (document.fAdminSoalanUndian.fPollQuestions.value=="")
	{
		theMessage = theMessage + "\nSoalan Undian";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
/*-------------------------------------------- end of login validation form  function -------------------------------------*/
/*--------------------------------------- start of cob validation form  function -------------------------------------------*/

function validatecobform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	var listChecknegeri = document.cariancob.negeri.selectedIndex;
	// Make sure a selection list is used
	if (document.cariancob.negeri.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nNegeri";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	var listCheckpbt = document.cariancob.pbt.selectedIndex;
	// Make sure a selection list is used
	if (document.cariancob.pbt.options[listCheckpbt].value=="none") 
	{
		theMessage = theMessage + "\nPBT";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------------------- end of cob validation form  function --------------------------------------*/
/*-------------------------------------------- start of news validation form function --------------------------------------*/
function validateadminnews(form,path) 
{
	var theMessage = "Sila isikan maklumat berikut: \n";
	var noErrors = theMessage;
	var listChecknegeri = document.fAdminNews.fBahasa.selectedIndex;
	// Make sure a selection list is used
	if (document.fAdminNews.fBahasa.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nBahasa";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// make sure field is not blank
	if (document.fAdminNews.fNewsPublishedEnd.value=="")
	{
		theMessage = theMessage + "\nTarikh Luput";
	}
	// make sure field is not blank
	if (document.fAdminNews.fNewsYear.value=="")
	{
		theMessage = theMessage + "\nTahun Berita Dimasukkan";
	}
	// make sure field is not blank
	if (document.fAdminNews.fNewsTitle.value=="")
	{
		theMessage = theMessage + "\nTajuk";
	}
	// make sure field is not blank
	if (document.fAdminNews.fNewsDetails.value=="")
	{
		theMessage = theMessage + "\nBerita";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
/*-------------------------------------------- end of news validation form function ----------------------------------------------*/
/*-------------------------------------------- start of event validation form function -----------------------------------------*/
function validateadmincalendar(form,path) 
{
	var theMessage = "Sila isikan maklumat berikut: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.fAdminEvent.fEventYear.value=="")
	{
		theMessage = theMessage + "\nTahun Aktiviti Diadakan";
	}
	// make sure field is not blank
	if (document.fAdminEvent.fEventDateEnd.value=="")
	{
		theMessage = theMessage + "\nTarikh Luput";
	}
	// make sure field is not blank
	if (document.fAdminEvent.fEventTitle.value=="")
	{
		theMessage = theMessage + "\nTajuk";
	}
	// make sure field is not blank
	if (document.fAdminEvent.EventDate.value=="")
	{
		theMessage = theMessage + "\nTarikh";
	}
	// make sure field is not blank
	if (document.fAdminEvent.fEventDetails.value=="")
	{
		theMessage = theMessage + "\nAktiviti";
	}
	// make sure field is not blank
	if (document.fAdminEvent.fEventPlace.value=="")
	{
		theMessage = theMessage + "\nTempat";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
/*-------------------------------------------- end of event validation form function ----------------------------------------------*/
/*-------------------------------------------- start of maklumatpemaju validation form function -------------------------------*/
function validatemaklumatpemajuform(form) 
{
	var theMessage = "Sila isikan maklumat berikut: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.maklumatpemaju.nolesen.value=="")
	{
		theMessage = theMessage + "\nNo Lesen";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
/*-------------------------------------------- end of maklumatpemaju validation form function ----------------------------------*/
/*-------------------------------------------- start of laporanspt1a validation form function -------------------------------*/
function validatelaporanspt1aform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	var listChecknegeri = document.laporanspt1a.StateDropDownReport.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt1a.StateDropDownReport.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nNegeri";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	var listCheckdaerah = document.laporanspt1a.DistrictDropDownReport.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt1a.DistrictDropDownReport.options[listCheckdaerah].value=="none") 
	{
		theMessage = theMessage + "\nDaerah";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->
/*-------------------------------------------- end of laporanspt1a validation form function ----------------------------------*/
/*-------------------------------------------- start of laporanspt2a validation form function -------------------------------*/
function validatelaporanspt2aform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	var listChecknegeri = document.laporanspt2a.StateDropDown.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt2a.StateDropDown.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nNegeri";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	var listCheckdaerah = document.laporanspt2a.DistrictDropDown.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt2a.DistrictDropDown.options[listCheckdaerah].value=="none") 
	{
		theMessage = theMessage + "\nDaerah";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->
/*-------------------------------------------- end of laporanspt2a validation form function ----------------------------------*/
/*-------------------------------------------- start of laporanspt3a validation form function -------------------------------*/
function validatelaporanspt3aform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	var listChecknegeri = document.laporanspt3a.StateDropDownReport.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt3a.StateDropDownReport.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nNegeri";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->
/*-------------------------------------------- end of laporanspt3a validation form function ----------------------------------*/
/*-------------------------------------------- start of laporanspt4a validation form function -------------------------------*/
function validatelaporanspt4aform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	var listChecknegeri = document.laporanspt4a.StateDropDown.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt4a.StateDropDown.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nNegeri";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->
/*-------------------------------------------- end of laporanspt4a validation form function ----------------------------------*/
/*-------------------------------------------- start of laporanspt5a validation form function -------------------------------*/
function validatelaporanspt5aform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	var listChecknegeri = document.laporanspt5a.StateDropDown.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt5a.StateDropDown.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nNegeri";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	var listChecktahundari = document.laporanspt5a.TahunDari.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt5a.TahunDari.options[listChecktahundari].value=="none") 
	{
		theMessage = theMessage + "\nTahun Dari";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	var listCheckTahunHingga = document.laporanspt5a.TahunHingga.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt5a.TahunHingga.options[listCheckTahunHingga].value=="none") 
	{
		theMessage = theMessage + "\nTahun Hingga";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	var listCheckStatusTawaran = document.laporanspt5a.StatusTawaran.selectedIndex;
	// Make sure a selection list is used
	if (document.laporanspt5a.StatusTawaran.options[listCheckStatusTawaran].value=="none") 
	{
		theMessage = theMessage + "\nStatus Tawaran";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->
/*-------------------------------------------- end of laporanspt5a validation form function ----------------------------------*/
/*-------------------------------------------- start of daftarcob validation form function -------------------------------*/
function validatedaftarcob(form) 
{
	var theMessage = "Sila isikan maklumat berikut: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.registercobform.pbt.value=="")
	{
		theMessage = theMessage + "\nPBT";
	}
	// make sure field is not blank
	if (document.registercobform.cob.value=="")
	{
		theMessage = theMessage + "\nCOB";
	}
	var listChecknegari = document.registercobform.negeri.selectedIndex;
	// Make sure a selection list is used
	if (document.registercobform.negeri.options[listChecknegari].value=="none") 
	{
		theMessage = theMessage + "\nNegeri";
	}
	if (document.registercobform.telefon.value=="")
	{
		theMessage = theMessage + "\nTelefon";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
/*-------------------------------------------- end of daftarcob validation form function ----------------------------------*/
/*------------------------------------------- start of register form validation form  function ------------------------------*/
function validateregister(form) {
	var theMessage = "Sila isikan salah satu\ndaripada yang berikut";
	// make sure a radio button is selected
	var radioCheck = false;
	for (i = 0; i < document.register.kategori.length; i++) {
	if (document.register.kategori[i].checked)
	{
	register.action= path + 'form/register1.cfm';
	radioCheck = true; 
	}
	}
	if (!radioCheck) {
	alert(theMessage);
	return false;
	}
}
/*-------------------------------------------- end of register form validation form  function ---------------------------------*/
/*--------------------------------------- start of change password validation form  function -------------------------------------------*/

function validatechangeform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.changepassword.kl_lama.value=="")
	{
		theMessage = theMessage + "\nKatalaluan";
	}
	// make sure field is not blank
	if (document.changepassword.kl_baru.value=="")
	{
		theMessage = theMessage + "\nKatalaluan Baru";
	}
	// make sure field is not blank
	if (document.changepassword.kl_baru_ulang.value=="")
	{
		theMessage = theMessage + "\nUlang Katalaluan Baru";
	}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------------------- end of  change password  validation form  function --------------------------------------*/
/*--------------------------------------- start of forgot password validation form  function -------------------------------------------*/

function validateforgotform(form) 
{
	var theMessage = "Sila isikan yang berikut: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.myform.katanama.value=="")
	{
		theMessage = theMessage + "\nKatanama";
	}
	// make sure field is not blank
	if (document.myform.noic.value=="")
	{
		theMessage = theMessage + "\nNo Kad Pengenalan";
	}
	
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------------------- end of  FORGOT password  validation form  function ------------------------------*/
/*--------------------------------------- start of login validation form  function -------------------------------------------*/

function validateupdateform() 
{
	var theMessage = "Sila isikan semua maklumat berikut: \n";
	var noErrors = theMessage
	// make sure field is not blank
	if (document.registerform.katanama.value=="")
	{
		theMessage = theMessage + "\nKata Nama";
	}
	// make sure field is not blank
	if (document.registerform.katalaluan.value=="")
	{
		theMessage = theMessage + "\nKata Laluan";
	}
	if(document.registerform.katalaluan.value!=document.registerform.pengesahankatalaluan.value) 
	{
		theMessage = theMessage + "\nKatalaluan dan pengesahan katalaluan harus sama";
	}
	// make sure field is not blank
	if (document.registerform.pengesahankatalaluan.value=="")
	{
		theMessage = theMessage + "\nPengesahan Kata Laluan";
	}
	// make sure field is not blank
	if (document.registerform.nama.value=="")
	{
		theMessage = theMessage + "\nNama";
	}
	// make sure field is not blank
	if (document.registerform.nohp.value=="")
	{
		theMessage = theMessage + "\nNo Tel  [HP]";
	}
	// make sure field is not blank
	if (document.registerform.emel.value=="")
	{
		theMessage = theMessage + "\nEmail";
	}
	/*var listCheckkategori = document.registerform.kategori.selectedIndex;
	// Make sure a selection list is used
	//if (document.registerform.kategori.options[listCheckkategori].value=="none") 
	//{
		//theMessage = theMessage + "\nKategori Pendaftaran";
	//}
	// If no errors, submit the form
	if (theMessage == noErrors) 
	{
		return true;
	} 
	// If errors were found, show alert message*/
	else 	
	{
		alert(theMessage);
		return false;
	}
}
// End -->

/*-------------------------------------------- end of login validation form  function ---------------------------------------*/
