/*-------------------------------- start of login validation perumahan swasta form  function --------------------------------*/

function validateformperumahanswasta(form,path) 
{
	var theMessage = "Please fill up at least one\nfrom the following:\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 + "\nState\nDistrict\nType\nProject\nMinimum Price\nMaximum Price";
	}
	if (document.formcarian.DaerahPerumahan.options[listCheckdaerah].value!="none" && document.formcarian.NegeriPerumahan.options[listChecknegeri].value=="none") 
	{
		theMessage = theMessage + "\nState\nDistrict\nType";
	}
	/*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 = "Please select State for\nDistrict you want to choose";
	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_bi.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 = "Please make sure project name\n more then 4 letter";
	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_bi.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 = "Please make sure project name\n more then 4 letter";
	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_bi.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 = "Please make sure name\n more then 4 letter";
	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_bi.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 = "Please make sure ROC\n more then 4 letter";
	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_bi.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 = "Please fill up at least one\nfrom the following:\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 + "\nState\nType";
	}
	/*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 = "Please fill up at least one\nfrom the following:\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 + "\nName\nState\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 = "Please fill in that the following: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.formlogmasuk.katanama.value=="")
	{
		theMessage = theMessage + "\nUsername";
	}
	// make sure field is not blank
	if (document.formlogmasuk.katalaluan.value=="")
	{
		theMessage = theMessage + "\nPassword";
	}
	// 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 = "Please fill in that the following: \n";
	var noErrors = theMessage
	// make sure field is not blank
	if (document.registerform.katanama.value=="")
	{
		theMessage = theMessage + "\nUsername";
	}
	// make sure field is not blank
	if (document.registerform.katalaluan.value=="")
	{
		theMessage = theMessage + "\nPassword";
	}
	if(document.registerform.katalaluan.value!=document.registerform.pengesahankatalaluan.value) 
	{
		theMessage = theMessage + "\nPassword and Confirmation Password should equivalent";
	}
	// make sure field is not blank
	if (document.registerform.pengesahankatalaluan.value=="")
	{
		theMessage = theMessage + "\nConfirmation Password";
	}
	// make sure field is not blank
	if (document.registerform.nama.value=="")
	{
		theMessage = theMessage + "\nName";
	}
	// make sure field is not blank
	if (document.registerform.noic.value=="")
	{
		theMessage = theMessage + "\nIC No";
	}
	
	// make sure field is not blank
	if (document.registerform.nohp.value=="")
	{
		theMessage = theMessage + "\nTel No [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 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 = "Please fill in all following information: \n";
	var noErrors = theMessage
	// make sure field is not blank
	if (document.updateprofileform.katanama.value=="")
	{
		theMessage = theMessage + "\nUsername";
	}
	// make sure field is not blank
	if (document.updateprofileform.katalaluan.value=="")
	{
		theMessage = theMessage + "\nPassword";
	}
	if(document.updateprofileform.katalaluan.value!=document.updateprofileform.pengesahankatalaluan.value) 
	{
		theMessage = theMessage + "\nPassword and Confirmation Password should equivalent";
	}
	// make sure field is not blank
	if (document.updateprofileform.pengesahankatalaluan.value=="")
	{
		theMessage = theMessage + "\nConfirmation Password";
	}
	// make sure field is not blank
	if (document.updateprofileform.nama.value=="")
	{
		theMessage = theMessage + "\nName";
	}
	// make sure field is not blank
	if (document.updateprofileform.noic.value=="")
	{
		theMessage = theMessage + "\nIC No";
	}
	
	// make sure field is not blank
	if (document.updateprofileform.nohp.value=="")
	{
		theMessage = theMessage + "\nTel No [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 + "\nRegistration Category";
	}
	// 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 = "Please fill up at least one\nfrom the following";
	// 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 + 'ehomebi/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 = "Please fill up at least one\nfrom the following";
	// 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 = "Please fill in all following information: \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 + "\nVote Question";
	}
	// make sure field is not blank
	if (document.fAdminUndian.P_ANSVER.value=="")
	{
		theMessage = theMessage + "\nVote Answer";
	}
	// 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 = "Please fill in following information: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	// make sure field is not blank
	if (document.fAdminSoalanUndian.fPollQuestions.value=="")
	{
		theMessage = theMessage + "\nVote Question";
	}
	// 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 = "Please fill in following information: \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 + "\nState";
	}
	// 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 = "Please fill in following information: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.fAdminNews.fNewsTitle.value=="")
	{
		theMessage = theMessage + "\nTitle";
	}
	// make sure field is not blank
	if (document.fAdminNews.fNewsDetails.value=="")
	{
		theMessage = theMessage + "\nNews";
	}
	// 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 = "Please fill in following information: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.fAdminEvent.fEventTitle.value=="")
	{
		theMessage = theMessage + "\nTitle";
	}
	// make sure field is not blank
	if (document.fAdminEvent.EventDate.value=="")
	{
		theMessage = theMessage + "\nDate";
	}
	// make sure field is not blank
	if (document.fAdminEvent.fEventDetails.value=="")
	{
		theMessage = theMessage + "\nEvent";
	}
	// make sure field is not blank
	if (document.fAdminEvent.fEventPlace.value=="")
	{
		theMessage = theMessage + "\nPlace";
	}
	// 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 = "Please fill in following information: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.maklumatpemaju.nolesen.value=="")
	{
		theMessage = theMessage + "\nNo Licence";
	}
	
	// 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 = "Please fill in following information: \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 + "\nState";
	}
	// 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 + "\nDistrict";
	}
	// 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 = "Please fill in following information: \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 + "\nState";
	}
	// 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 + "\nDistrict";
	}
	// 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 = "Please fill in following information: \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 + "\nState";
	}
	// 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 = "Please fill in following information: \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 + "\nState";
	}
	// 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 = "Please fill in following information: \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 + "\nState";
	}
	// 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 + "\nYears From";
	}
	// 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 + "\nYears Until ";
	}
	// 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 Offer ";
	}
	// 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 = "Please fill in following information: \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 + "\nState";
	}
	// 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 = "Please fill up at least one\nfrom the following";
	// 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 = "Please fill in following information: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.changepassword.kl_lama.value=="")
	{
		theMessage = theMessage + "\nPassword";
	}
	// make sure field is not blank
	if (document.changepassword.kl_baru.value=="")
	{
		theMessage = theMessage + "\nNew Password";
	}
	// make sure field is not blank
	if (document.changepassword.kl_baru_ulang.value=="")
	{
		theMessage = theMessage + "\nRepeat New Password";
	}
	// 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 = "Please fill in following information: \n";
	var noErrors = theMessage;
	// make sure field is not blank
	if (document.myform.katanama.value=="")
	{
		theMessage = theMessage + "\nUsername";
	}
	// make sure field is not blank
	if (document.myform.noic.value=="")
	{
		theMessage = theMessage + "\nIC No";
	}
	
	// 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 = "Please fill in following information: \n";
	var noErrors = theMessage
	// make sure field is not blank
	if (document.updateprofile.katanama.value=="")
	{
		theMessage = theMessage + "\nUsername";
	}
	// make sure field is not blank
	if (document.updateprofile.katalaluan.value=="")
	{
		theMessage = theMessage + "\nPassword";
	}
	if(document.updateprofile.katalaluan.value!=document.updateprofile.pengesahankatalaluan.value) 
	{
		theMessage = theMessage + "\nPassword and Confirmation Password should equivalent";
	}
	// make sure field is not blank
	if (document.updateprofile.pengesahankatalaluan.value=="")
	{
		theMessage = theMessage + "\nConfirmation Password";
	}
	// make sure field is not blank
	if (document.updateprofile.nama.value=="")
	{
		theMessage = theMessage + "\nName";
	}
	// make sure field is not blank
	if (document.updateprofile.nohp.value=="")
	{
		theMessage = theMessage + "\nTel No [HP]";
	}
	// make sure field is not blank
	if (document.updateprofile.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 ---------------------------------------*/
