//START validate special characters

var r={
  'special':/[\W]/g,
  'quotes':/['\''&'\"']/g,
  'notnumbers':/[^\d]/g
}

function valid(o,w){
  o.value = o.value.replace(r[w],'');
}
//END validate special characters

//Member Registration Validation
function valMemberRegistration(){
	var cmbCategory=trim(document.frmRegistration.cmbCategory.value);
	var txtFirstName=trim(document.frmRegistration.txtFirstName.value);
	var txtMiddleName=trim(document.frmRegistration.txtMiddleName.value);
	var txtLastName=trim(document.frmRegistration.txtLastName.value);
	var txtEmailId=trim(document.frmRegistration.txtEmailId.value);
	var txtMobile=trim(document.frmRegistration.txtMobile.value);
        var cmbDay=trim(document.frmRegistration.cmbDay.value);
	var cmbMonth=trim(document.frmRegistration.cmbMonth.value);
	var cmbYear=trim(document.frmRegistration.cmbYear.value);	
	var txtPassword=trim(document.frmRegistration.txtPassword.value);
	var txtConPassword=trim(document.frmRegistration.txtConPassword.value);
	var cmbYOGraduation=trim(document.frmRegistration.cmbYOGraduation.value);
	var txtFirstName1=trim(document.frmRegistration.txtFirstName1.value);
	var txtLastName1=trim(document.frmRegistration.txtLastName1.value);
	var txtFirstName2=trim(document.frmRegistration.txtFirstName2.value);
	var txtLastName2=trim(document.frmRegistration.txtLastName2.value);
	var txtSecurityCode=trim(document.frmRegistration.txtSecurityCode.value);
	
	document.getElementById("errorCategorySelect").style.display="none";	
	if(cmbCategory == ""){
		document.getElementById("errorCategorySelect").style.display="block";
		document.frmRegistration.cmbCategory.focus();
		return false;
	}
	
	document.getElementById("errorFirstName").style.display="none";
	document.getElementById("errorFirstNameInvalid").style.display="none";	
	if(txtFirstName == ""){
		document.getElementById("errorFirstName").style.display="block";
		document.frmRegistration.txtFirstName.focus();
		return false;
	}
	if(isScriptTagStart(txtFirstName)||IsNumeric(txtFirstName)){
		document.getElementById("errorFirstNameInvalid").style.display="block";
		document.frmRegistration.txtFirstName.focus();
		return false;
	}	
	
	document.getElementById("errorMiddleNameInvalid").style.display="none";
	if(isScriptTagStart(txtMiddleName)||IsNumeric(txtMiddleName)){
		document.getElementById("errorMiddleNameInvalid").style.display="block";
		document.frmRegistration.txtMiddleName.focus();
		return false;
	}	
	
	document.getElementById("errorLastName").style.display="none";	
	document.getElementById("errorLastNameInvalid").style.display="none";
	if(txtLastName == ""){
		document.getElementById("errorLastName").style.display="block";
		document.frmRegistration.txtLastName.focus();
		return false;
	}
	if(isScriptTagStart(txtLastName)||IsNumeric(txtLastName)){
		document.getElementById("errorLastNameInvalid").style.display="block";
		document.frmRegistration.txtLastName.focus();
		return false;
	}
		
	document.getElementById("errorEmailId").style.display="none";	
	if(txtEmailId == ""){
		document.getElementById("errorEmailId").style.display="block";
		document.frmRegistration.txtEmailId.focus();
		return false;
	}
	
	document.getElementById("errorEmailId2").style.display="none";	
	if(isEmail(txtEmailId)==false){
		document.getElementById("errorEmailId2").style.display="block";
		document.frmRegistration.txtEmailId.focus();
		return false;
	}
	document.getElementById("errorMobile").style.display="none";
        if(txtMobile== ""){
                document.getElementById("errorMobile").style.display="block";
                document.frmRegistration.txtMobile.focus();
                return false;
        }
	document.getElementById("errorCmbDay").style.display="none";	
	if(cmbDay == "DD"){
		document.getElementById("errorCmbDay").style.display="block";
		document.frmRegistration.cmbDay.focus();
		return false;
	}
	
	document.getElementById("errorCmbMonth").style.display="none";	
	if(cmbMonth == ""){
		document.getElementById("errorCmbMonth").style.display="block";
		document.frmRegistration.cmbMonth.focus();
		return false;
	}
	
	document.getElementById("errorcmbYear").style.display="none";	
	if(cmbYear == "YYYY"){
		document.getElementById("errorcmbYear").style.display="block";
		document.frmRegistration.cmbYear.focus();
		return false;
	}
	
	document.getElementById('errorFebruary').style.display="none";	
	if(document.frmRegistration.cmbMonth.selectedIndex=='2'){
		if(daysInFebruary (cmbYear)==true){
			if(document.frmRegistration.cmbDay.selectedIndex>29){
				document.getElementById('errorFebruary').style.display="block";
				document.frmRegistration.cmbDay.focus();
				return false;
			}
		}else{
			if(document.frmRegistration.cmbDay.selectedIndex>28){
				document.getElementById('errorFebruary').style.display="block";
				document.frmRegistration.cmbDay.focus();
				return false;
			}
		}			
	}	
	
	document.getElementById("errorPassword").style.display="none";	
	if(txtPassword == ""){
		document.getElementById("errorPassword").style.display="block";
		document.frmRegistration.txtPassword.focus();
		return false;
	}
	
	document.getElementById("errorConfirmPassword").style.display="none";	
	if(txtConPassword == ""){
		document.getElementById("errorConfirmPassword").style.display="block";
		document.frmRegistration.txtConPassword.focus();
		return false;
	}
	
	document.getElementById("errorConfirm").style.display="none";	
	if(txtPassword!=txtConPassword){
		document.getElementById("errorConfirm").style.display="block";
		document.frmRegistration.txtConPassword.focus();
		return false;
	}
	
	if(cmbCategory == "PGP"){	
		document.getElementById("errorYearOfGraduation").style.display="none";	
		if(cmbYOGraduation == ""){
			document.getElementById("errorYearOfGraduation").style.display="block";
			document.frmRegistration.cmbYOGraduation.focus();
			return false;
		}
	
		document.getElementById("errorBatchmateFirstName1").style.display="none";
		document.getElementById("errorBatchmateFirstName1Invalid").style.display="none";
		if(txtFirstName1 == ""){
			document.getElementById("errorBatchmateFirstName1").style.display="block";
			document.frmRegistration.txtFirstName1.focus();
			return false;
		}
		if(isScriptTagStart(txtFirstName1)||IsNumeric(txtFirstName1)){
			document.getElementById("errorBatchmateFirstName1Invalid").style.display="block";
			document.frmRegistration.txtFirstName1.focus();
			return false;
		}		
	
		document.getElementById("errorBatchmateLastName1").style.display="none";	
		document.getElementById("errorBatchmateLastName1Invalid").style.display="none";
		if(txtLastName1 == ""){
			document.getElementById("errorBatchmateLastName1").style.display="block";
			document.frmRegistration.txtLastName1.focus();
			return false;
		}
		if(isScriptTagStart(txtLastName1)||IsNumeric(txtLastName1)){
			document.getElementById("errorBatchmateLastName1Invalid").style.display="block";
			document.frmRegistration.txtLastName1.focus();
			return false;
		}
			
		document.getElementById("errorBatchmateFirstName2").style.display="none";	
		document.getElementById("errorBatchmateFirstName2Invalid").style.display="none";
		if(txtFirstName2 == ""){
			document.getElementById("errorBatchmateFirstName2").style.display="block";
			document.frmRegistration.txtFirstName2.focus();
			return false;
		}
		if(isScriptTagStart(txtFirstName2)||(IsNumeric(txtFirstName2))){
			document.getElementById("errorBatchmateFirstName2Invalid").style.display="block";
			document.frmRegistration.txtFirstName2.focus();
			return false;
		}
	
		document.getElementById("errorBatchmateLastName2").style.display="none";	
		document.getElementById("errorBatchmateLastName2Invalid").style.display="none";
		if(txtLastName2 == ""){
			document.getElementById("errorBatchmateLastName2").style.display="block";
			document.frmRegistration.txtLastName2.focus();
			return false;
		}
		if(isScriptTagStart(txtLastName2)||(IsNumeric(txtLastName2))){
			document.getElementById("errorBatchmateLastName2Invalid").style.display="block";
			document.frmRegistration.txtLastName2.focus();
			return false;
		}
	}

	document.getElementById("errorSecurityCode").style.display="none";		
	if(txtSecurityCode == ""){
		document.getElementById("errorSecurityCode").style.display="block";
		document.frmRegistration.txtSecurityCode.focus();
		return false;
	}	
	//response = confirm("Please verify the details entered by you. If details are correct then click OK to continue");
	//return response;
	return true;	
}

function daysInFebruary (txtYear){
	if(txtYear % 100 == 0) {
		if(txtYear % 400 == 0){
			return true;
		}
	}else{
		if(txtYear % 4 == 0){
			return true;
		}
		return false;
	}  
}

function validateMemberVoteForm(){
	document.getElementById("errorOptionSelect").style.display="none";
	optionSelected = false;	
	for(i=0; i < document.frmVote.radOption.length; i++){
 		if(document.frmVote.radOption[i].checked){
 			optionSelected = true;
 			break;
 		}
 	} 
	if(optionSelected == false){
 		document.getElementById("errorOptionSelect").style.display="block";
 		return false;;
 	}
 	return true;		
}
 
//Recruiter Login Validation
 function valRecruiterLogin(){ 
	 var txtUsername=trim(document.frmRecruiterLogin.txtUsername.value);
	 var txtPassword=trim(document.frmRecruiterLogin.txtPassword.value);
	 document.getElementById("errorUsername").style.display="none";
	 document.getElementById("errorPassword").style.display="none";

	if(txtUsername== ""){
		document.getElementById("errorUsername").style.display="block";
		document.frmRecruiterLogin.txtUsername.focus();
		return false;
	}
	if(txtPassword== ""){
		document.getElementById("errorPassword").style.display="block";
		document.frmRecruiterLogin.txtPassword.focus();
		return false;
	}
	return true;
 }
 
 //Service Provider Login Validation
 function valServiceProviderLogin(){ 
 var txtUsername=trim(document.frmServiceProviderLogin.txtUsername.value);
 var txtPassword=trim(document.frmServiceProviderLogin.txtPassword.value);
 document.getElementById("errorUsername").style.display="none";
 document.getElementById("errorPassword").style.display="none";

	if(txtUsername== ""){
		document.getElementById("errorUsername").style.display="block";
		document.frmServiceProviderLogin.txtUsername.focus();
		return false;
	}
	if(txtPassword== ""){
		document.getElementById("errorPassword").style.display="block";
		document.frmServiceProviderLogin.txtPassword.focus();
		return false;
	}
	return true;
 } 
 //End Service Provider Login Validation
 
 //Service Provider Registration Validation 
function valServiceProviderRegistration(){ 
	var txtOrganisationName=trim(document.frmServiceProviderRegistration.txtOrganisationName.value);
	var fileUploadCompanyLogo=trim(document.frmServiceProviderRegistration.fileUploadCompanyLogo.value);
	var txtBusinessDetails=trim(document.frmServiceProviderRegistration.txtBusinessDetails.value);
	var txtAddLine1=trim(document.frmServiceProviderRegistration.txtAddLine1.value);
	var txtAddLine2=trim(document.frmServiceProviderRegistration.txtAddLine2.value);
	var txtCity=trim(document.frmServiceProviderRegistration.txtCity.value);
	var cmbCountry=trim(document.frmServiceProviderRegistration.cmbCountry.value);
	var txtPinCode=trim(document.frmServiceProviderRegistration.txtPinCode.value);
	var txtContactPersonName=trim(document.frmServiceProviderRegistration.txtContactPersonName.value);
	var txtContactPersonPhone=trim(document.frmServiceProviderRegistration.txtContactPersonPhone.value);
	var txtContactPersonAddress=trim(document.frmServiceProviderRegistration.txtContactPersonAddress.value);
	var txtEmail=trim(document.frmServiceProviderRegistration.txtEmail.value);
	var txtExpOfInterest=trim(document.frmServiceProviderRegistration.txtExpOfInterest.value);
	var txtModeOfServiceDelivery=trim(document.frmServiceProviderRegistration.txtModeOfServiceDelivery.value);
	var txtPGPBatch=trim(document.frmServiceProviderRegistration.txtPGPBatch.value);
	var txtReferralName=trim(document.frmServiceProviderRegistration.txtReferralName.value);
	var txtOthers=trim(document.frmServiceProviderRegistration.txtOthers.value);
	var txtUserName=trim(document.frmServiceProviderRegistration.txtUserName.value);
	var txtOthers=trim(document.frmServiceProviderRegistration.txtOthers.value);
	var txtPGPBatch=trim(document.frmServiceProviderRegistration.txtPGPBatch.value);
	var txtReferralName=trim(document.frmServiceProviderRegistration.txtReferralName.value);
	var txtSecurityCode=trim(document.frmServiceProviderRegistration.txtSecurityCode.value);
	
	document.getElementById("errorOrganisationName").style.display="none";
	document.getElementById("errorOrganisationNameInvalid").style.display="none";
	document.getElementById("errorUploadCompanyLogo").style.display="none";
	document.getElementById("errorBusinessDetails").style.display="none";
	document.getElementById("errorBusinessDetailsInvalid").style.display="none";
	document.getElementById("errorAddLine1").style.display="none";
	document.getElementById("errorAddLine1Invalid").style.display="none";
	document.getElementById("errorAddLine2").style.display="none";	
	document.getElementById("errorAddLine2Invalid").style.display="none";
	document.getElementById("errorCity").style.display="none";
	document.getElementById("errorCityInvalid").style.display="none";
	document.getElementById("errorCountry").style.display="none";
	document.getElementById("errorPinCode").style.display="none";
	document.getElementById("errorPinCodeInvalid").style.display="none";
	document.getElementById("errorContactPersonName").style.display="none";
	document.getElementById("errorContactPersonNameInvalid").style.display="none";
	document.getElementById("errorContactPersonPhone").style.display="none";
	document.getElementById("errorContactPersonPhoneInvalid").style.display="none";
	document.getElementById("errorContactPersonPhoneLength").style.display="none";
	document.getElementById("errorContactPersonAddress").style.display="none";
	document.getElementById("errorContactPersonAddressInvalid").style.display="none";
	document.getElementById("errorEmail").style.display="none";
	document.getElementById("errorEmailInvalid").style.display="none";
	document.getElementById("errorExpOfInterest").style.display="none";
	document.getElementById("errorExpOfInterestInvalid").style.display="none";
	document.getElementById("errorModeOfServiceDelivery").style.display="none";
	document.getElementById("errorModeOfServiceDeliveryInvalid").style.display="none";
	document.getElementById("errorHowDidYouKnow").style.display="none";
	document.getElementById("errorPGPBatch").style.display="none";
	document.getElementById("errorReferralName").style.display="none";
	document.getElementById("errorOthers").style.display="none";
	document.getElementById("errorOthersInvalid").style.display="none";
	document.getElementById("errorUserName").style.display="none";
	document.getElementById("errorUserNameInvalid").style.display="none";
	document.getElementById("errorSecurityCode").style.display="none";

	if(txtOrganisationName== ""){
		document.getElementById("errorOrganisationName").style.display="block";
		document.frmServiceProviderRegistration.txtOrganisationName.focus();
		return false;
	}
	if(isScriptTagStart(txtOrganisationName)||IsNumeric(txtOrganisationName)){
		document.getElementById("errorOrganisationNameInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtOrganisationName.focus();
		return false;
	}
	
	if(fileUploadCompanyLogo== ""){
		document.getElementById("errorUploadCompanyLogo").style.display="block";
		document.frmServiceProviderRegistration.fileUploadCompanyLogo.focus();
		return false;
	}
	
	if(txtBusinessDetails == ""){
		document.getElementById("errorBusinessDetails").style.display="block";
		document.frmServiceProviderRegistration.txtBusinessDetails.focus();
		return false;
	}
	if(isScriptTagStart(txtBusinessDetails)){
		document.getElementById("errorBusinessDetailsInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtBusinessDetails.focus();
		return false;
	}
	
	if(txtAddLine1 == ""){
		document.getElementById("errorAddLine1").style.display="block";
		document.frmServiceProviderRegistration.txtAddLine1.focus();
		return false;
	}
	if(isScriptTagStart(txtAddLine1)){
		document.getElementById("errorAddLine1Invalid").style.display="block";
		document.frmServiceProviderRegistration.txtAddLine1.focus();
		return false;
	}
	
	if(txtAddLine2 == ""){
		document.getElementById("errorAddLine2").style.display="block";
		document.frmServiceProviderRegistration.txtAddLine2.focus();
		return false;
	}
	if(isScriptTagStart(txtAddLine2)){
		document.getElementById("errorAddLine2Invalid").style.display="block";
		document.frmServiceProviderRegistration.txtAddLine2.focus();
		return false;
	}
	
	if(txtCity == ""){
		document.getElementById("errorCity").style.display="block";
		document.frmServiceProviderRegistration.txtCity.focus();
		return false;
	}
	if(isScriptTagStart(txtCity)||IsNumeric(txtCity)){
		document.getElementById("errorCityInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtCity.focus();
		return false;
	}

	if(cmbCountry == ""){
		document.getElementById("errorCountry").style.display="block";
		document.frmServiceProviderRegistration.cmbCountry.focus();
		return false;
	}
	
	if(txtPinCode == ""){
		document.getElementById("errorPinCode").style.display="block";
		document.frmServiceProviderRegistration.txtPinCode.focus();
		return false;
	}
	if(!IsNumeric(txtPinCode)){
		document.getElementById("errorPinCodeInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtPinCode.select();
		return false;
	}
	
	if(txtContactPersonName == ""){
		document.getElementById("errorContactPersonName").style.display="block";
		document.frmServiceProviderRegistration.txtContactPersonName.focus();
		return false;
	}
	if(isScriptTagStart(txtContactPersonName)||IsNumeric(txtContactPersonName)){
		document.getElementById("errorContactPersonNameInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtContactPersonName.focus();
		return false;
	}
	
	if(txtContactPersonPhone == ""){
		document.getElementById("errorContactPersonPhone").style.display="block";
		document.frmServiceProviderRegistration.txtContactPersonPhone.focus();
		return false;
	}
	if(!IsNumeric(txtContactPersonPhone)){
		document.getElementById("errorContactPersonPhoneInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtContactPersonPhone.select();
		return false;
	}
	if(txtContactPersonPhone.length<10){
		document.getElementById("errorContactPersonPhoneLength").style.display="block";
		document.frmServiceProviderRegistration.txtContactPersonPhone.select();
		return false;
	}
	
	if(txtContactPersonAddress == ""){
		document.getElementById("errorContactPersonAddress").style.display="block";
		document.frmServiceProviderRegistration.txtContactPersonAddress.focus();
		return false;
	}
	if(isScriptTagStart(txtContactPersonAddress)){
		document.getElementById("errorContactPersonAddressInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtContactPersonAddress.focus();
		return false;
	}
	
	if(txtEmail == ""){
		document.getElementById("errorEmail").style.display="block";
		document.frmServiceProviderRegistration.txtEmail.focus();
		return false;
	}
	if(isEmail(txtEmail)==false){
		document.getElementById("errorEmailInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtEmail.focus();
		return false;
	}
	
	if(txtExpOfInterest == ""){
		document.getElementById("errorExpOfInterest").style.display="block";
		document.frmServiceProviderRegistration.txtExpOfInterest.focus();
		return false;
	}
	if(isScriptTagStart(txtExpOfInterest)){
		document.getElementById("errorExpOfInterestInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtExpOfInterest.focus();
		return false;
	}
	
	if(txtModeOfServiceDelivery == ""){
		document.getElementById("errorModeOfServiceDelivery").style.display="block";
		document.frmServiceProviderRegistration.txtModeOfServiceDelivery.focus();
		return false;
	}
	if(isScriptTagStart(txtModeOfServiceDelivery)){
		document.getElementById("errorModeOfServiceDeliveryInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtModeOfServiceDelivery.focus();
		return false;
	}

	if(document.frmServiceProviderRegistration.radHowDidYouHear[0].checked==false && document.frmServiceProviderRegistration.radHowDidYouHear[1].checked==false){
		document.getElementById("errorHowDidYouKnow").style.display="block";
		return false;
	}

	if(document.frmServiceProviderRegistration.radHowDidYouHear[0].checked){	
		if((txtPGPBatch == "")||(isScriptTagStart(txtPGPBatch))){
			document.getElementById("errorPGPBatch").style.display="block";
			document.getElementById("errorReferralName").style.display="none";
			document.frmServiceProviderRegistration.txtPGPBatch.focus();
			return false;
		}		
		
		if((txtReferralName == "")||(isScriptTagStart(txtReferralName))||(IsNumeric(txtReferralName))){
			document.getElementById("errorReferralName").style.display="block";
			document.getElementById("errorPGPBatch").style.display="none";
			document.frmServiceProviderRegistration.txtReferralName.focus();
			return false;
		}		
	}	

	if(document.frmServiceProviderRegistration.radHowDidYouHear[1].checked){			
		if(txtOthers == ""){
			document.getElementById("errorOthers").style.display="block";
			document.frmServiceProviderRegistration.txtOthers.focus();
			return false;
		}
		if(isScriptTagStart(txtOthers)){
			document.getElementById("errorOthersInvalid").style.display="block";
			document.frmServiceProviderRegistration.txtOthers.focus();
			return false;
		}
	}
			
	if(txtUserName == ""){
		document.getElementById("errorUserName").style.display="block";
		document.frmServiceProviderRegistration.txtUserName.focus();
		return false;
	}
	if(isScriptTagStart(txtUserName)){
		document.getElementById("errorUserNameInvalid").style.display="block";
		document.frmServiceProviderRegistration.txtUserName.focus();
		return false;
	}
	
	if(txtSecurityCode == ""){
		document.getElementById("errorSecurityCode").style.display="block";
		document.frmServiceProviderRegistration.txtSecurityCode.focus();
		return false;
	}
	return true;
} 
 //End Service Provider Registration Validation 
 
//Recruiter Registration Validation 
function valRecruiterRegistration(){
	var txtOrgName=trim(document.frmRecruiterRegistration.txtOrgName.value);
	var txtAddressLine1=trim(document.frmRecruiterRegistration.txtAddressLine1.value);
	var txtAddressLine2=trim(document.frmRecruiterRegistration.txtAddressLine2.value);
	var txtCity=trim(document.frmRecruiterRegistration.txtCity.value);
	var cmbCountry=trim(document.frmRecruiterRegistration.cmbCountry.value);
	var txtPinCode=trim(document.frmRecruiterRegistration.txtPinCode.value);
	var txtPersonName=trim(document.frmRecruiterRegistration.txtPersonName.value);
	var txtPersonPhone=trim(document.frmRecruiterRegistration.txtPersonPhone.value);
	var txtPersonAddress=trim(document.frmRecruiterRegistration.txtPersonAddress.value);
	var txtEmail=trim(document.frmRecruiterRegistration.txtEmail.value);
	var txtExpOfInterest=trim(document.frmRecruiterRegistration.txtExpOfInterest.value);
	var txtPGPBatch=trim(document.frmRecruiterRegistration.txtPGPBatch.value);
	var txtReferralName=trim(document.frmRecruiterRegistration.txtReferralName.value);
	var txtOthers=trim(document.frmRecruiterRegistration.txtOthers.value);
	var txtUserName=trim(document.frmRecruiterRegistration.txtUserName.value);
	var txtSecurityCode=trim(document.frmRecruiterRegistration.txtSecurityCode.value);

	document.getElementById("errorOrganisationName").style.display="none";
	document.getElementById("errorOrganisationNameInvalid").style.display="none";
	document.getElementById("errorAddLine1").style.display="none";
	document.getElementById("errorAddLine1Invalid").style.display="none";
	document.getElementById("errorAddLine2").style.display="none";	
	document.getElementById("errorAddLine2Invalid").style.display="none";
	document.getElementById("errorCity").style.display="none";
	document.getElementById("errorCityInvalid").style.display="none";
	document.getElementById("errorCountry").style.display="none";
	document.getElementById("errorPinCodeBlank").style.display="none";
	document.getElementById("errorPinCode").style.display="none";
	document.getElementById("errorContactPersonName").style.display="none";
	document.getElementById("errorContactPersonNameInvalid").style.display="none";
	document.getElementById("errorContactPersonPhone").style.display="none";
	document.getElementById("errorContactPersonPhoneInvalid").style.display="none";
	document.getElementById("errorContactPersonPhoneLength").style.display="none";
	document.getElementById("errorContactPersonAddress").style.display="none";
	document.getElementById("errorContactPersonAddressInvalid").style.display="none";
	document.getElementById("errorEmail").style.display="none";
	document.getElementById("errorEmailInvalid").style.display="none";
	document.getElementById("errorExpOfInterest").style.display="none";
	document.getElementById("errorExpOfInterestInvalid").style.display="none";
	document.getElementById("errorReferral").style.display="none";
	document.getElementById("errorPGPBatch").style.display="none";
	document.getElementById("errorReferralName").style.display="none";
	document.getElementById("errorOthers").style.display="none";
	document.getElementById("errorOthersInvalid").style.display="none";
	document.getElementById("errorUserName").style.display="none";
	document.getElementById("errorUserNameInvalid").style.display="none";
	document.getElementById("errorSecurityCode").style.display="none";

	if(txtOrgName== ""){
		document.getElementById("errorOrganisationName").style.display="block";
		document.frmRecruiterRegistration.txtOrgName.focus();
		return false;
	}
	if(isScriptTagStart(txtOrgName)){
		document.getElementById("errorOrganisationNameInvalid").style.display="block";
		document.frmRecruiterRegistration.txtOrgName.focus();
		return false;
	}
	
	if(txtAddressLine1 == ""){
		document.getElementById("errorAddLine1").style.display="block";
		document.frmRecruiterRegistration.txtAddressLine1.focus();
		return false;
	}
	if(isScriptTagStart(txtAddressLine1)){
		document.getElementById("errorAddLine1Invalid").style.display="block";
		document.frmRecruiterRegistration.txtAddressLine1.focus();
		return false;
	}
	
	if(txtAddressLine2 == ""){
		document.getElementById("errorAddLine2").style.display="block";
		document.frmRecruiterRegistration.txtAddressLine2.focus();
		return false;
	}
	if(isScriptTagStart(txtAddressLine2)){
		document.getElementById("errorAddLine2Invalid").style.display="block";
		document.frmRecruiterRegistration.txtAddressLine2.focus();
		return false;
	}
	
	if(txtCity == ""){
		document.getElementById("errorCity").style.display="block";
		document.frmRecruiterRegistration.txtCity.focus();
		return false;
	}
	if(isScriptTagStart(txtCity)||IsNumeric(txtCity)){
		document.getElementById("errorCityInvalid").style.display="block";
		document.frmRecruiterRegistration.txtCity.focus();
		return false;
	}

	if(cmbCountry == ""){
		document.getElementById("errorCountry").style.display="block";
		document.frmRecruiterRegistration.cmbCountry.focus();
		return false;
	}
	
	if(txtPinCode == ""){
		document.getElementById("errorPinCodeBlank").style.display="block";
		document.frmRecruiterRegistration.txtPinCode.focus();
		return false;
	}

	if(!IsNumeric(txtPinCode)){
		document.getElementById("errorPinCode").style.display="block";
		document.frmRecruiterRegistration.txtPinCode.select();
		return false;
	}
	
	if(txtPersonName == ""){
		document.getElementById("errorContactPersonName").style.display="block";
		document.frmRecruiterRegistration.txtPersonName.focus();
		return false;
	}
	if(isScriptTagStart(txtPersonName)||IsNumeric(txtPersonName)){
		document.getElementById("errorContactPersonNameInvalid").style.display="block";
		document.frmRecruiterRegistration.txtPersonName.focus();
		return false;
	}
	
	if(txtPersonPhone == ""){
		document.getElementById("errorContactPersonPhone").style.display="block";
		document.frmRecruiterRegistration.txtPersonPhone.focus();
		return false;
	}

	if(!IsNumeric(txtPersonPhone)){
		document.getElementById("errorContactPersonPhoneInvalid").style.display="block";
		document.frmRecruiterRegistration.txtPersonPhone.select();
		return false;
	}
	
	if(txtPersonPhone.length<8){
		document.getElementById("errorContactPersonPhoneLength").style.display="block";
		document.frmRecruiterRegistration.txtPersonPhone.select();
		return false;
	}
	
	if(txtPersonAddress == ""){
		document.getElementById("errorContactPersonAddress").style.display="block";
		document.frmRecruiterRegistration.txtPersonAddress.focus();
		return false;
	}
	if(isScriptTagStart(txtPersonAddress)){
		document.getElementById("errorContactPersonAddressInvalid").style.display="block";
		document.frmRecruiterRegistration.txtPersonAddress.focus();
		return false;
	}

	if(txtEmail == ""){
		document.getElementById("errorEmail").style.display="block";
		document.frmRecruiterRegistration.txtEmail.focus();
		return false;
	}

	if(isEmail(txtEmail)==false){
		document.getElementById("errorEmailInvalid").style.display="block";
		document.frmRecruiterRegistration.txtEmail.focus();
		return false;
	}

	if(txtExpOfInterest == ""){
		document.getElementById("errorExpOfInterest").style.display="block";
		document.frmRecruiterRegistration.txtExpOfInterest.focus();
		return false;
	}
	if(isScriptTagStart(txtExpOfInterest)){
		document.getElementById("errorExpOfInterestInvalid").style.display="block";
		document.frmRecruiterRegistration.txtExpOfInterest.focus();
		return false;
	}
	
	if(document.frmRecruiterRegistration.radReferral[0].checked==false && document.frmRecruiterRegistration.radReferral[1].checked==false){
		document.getElementById("errorReferral").style.display="block";
		return false;
	}

	if(document.frmRecruiterRegistration.radReferral[0].checked){	
		if((txtPGPBatch == "")||(isScriptTagStart(txtPGPBatch))){
			document.getElementById("errorPGPBatch").style.display="block";
			document.getElementById("errorReferralName").style.display="none";
			document.frmRecruiterRegistration.txtPGPBatch.focus();
			return false;
		}
			
		if((txtReferralName == "")||(isScriptTagStart(txtReferralName))||(IsNumeric(txtReferralName))){
			document.getElementById("errorReferralName").style.display="block";
			document.getElementById("errorPGPBatch").style.display="none";
			document.frmRecruiterRegistration.txtReferralName.focus();
			return false;
		}		
	}	

	if(document.frmRecruiterRegistration.radReferral[1].checked){			
		if(txtOthers == ""){
			document.getElementById("errorOthers").style.display="block";
			document.frmRecruiterRegistration.txtOthers.focus();
			return false;
		}
		if(isScriptTagStart(txtOthers)){
			document.getElementById("errorOthersInvalid").style.display="block";
			document.frmRecruiterRegistration.txtOthers.focus();
			return false;
		}
	}		

	if(txtUserName == ""){
		document.getElementById("errorUserName").style.display="block";
		document.frmRecruiterRegistration.txtUserName.focus();
		return false;
	}
	if(isScriptTagStart(txtUserName)){
		document.getElementById("errorUserNameInvalid").style.display="block";
		document.frmRecruiterRegistration.txtUserName.focus();
		return false;
	}
	
	if(txtSecurityCode == ""){
		document.getElementById("errorSecurityCode").style.display="block";
		document.frmRecruiterRegistration.txtSecurityCode.focus();
		return false;
	}
	return true;
}
//End Recruiter Registration Validation
 
//Start new notice validation
function valNewNotice(){
	var txtTitle=trim(document.frmNewNotice.txtTitle.value);
	var txtDescription=trim(document.frmNewNotice.txtDescription.value);
	var txtExpiryDate=trim(document.frmNewNotice.txtExpiryDate.value);
	var txtContactDetails=trim(document.frmNewNotice.txtContactDetails.value);
	var txtLocation=trim(document.frmNewNotice.txtLocation.value);
	document.getElementById("errorTitle").style.display="none";
	document.getElementById("errorDescription").style.display="none";
	document.getElementById("errorExpiryDate").style.display="none";
	document.getElementById("errorContactDetails").style.display="none";
	document.getElementById("errorLocation").style.display="none";
	
	if(txtTitle== ""){
		document.getElementById("errorTitle").style.display="block";
		document.frmNewNotice.txtTitle.focus();
		return false;
	}
	
 	if(txtDescription== ""){
		document.getElementById("errorDescription").style.display="block";
		document.frmNewNotice.txtDescription.focus();
		return false;
	}
	
 	if(txtExpiryDate== ""){
		document.getElementById("errorExpiryDate").style.display="block";
		document.frmNewNotice.txtExpiryDate.focus();
		return false;
	}
	
 	if(txtContactDetails== ""){
		document.getElementById("errorContactDetails").style.display="block";
		document.frmNewNotice.txtContactDetails.focus();
		return false;
	}
	
 	if(txtLocation== ""){
		document.getElementById("errorLocation").style.display="block";
		document.frmNewNotice.txtLocation.focus();
		return false;
	}
 	return true;
}	 
//end new notice validation

function refreshImage(){
 	var today = new Date();
 	var x = today.getMilliseconds();
 	bgImageURL = "/images/bg.jpg";
 	securityImageURL = "/common/securimage_show.php?"+x;
 	document.body.style.cursor="wait";
 	//document.getElementById("securityCode").src=bgImageURL;
	setTimeout('document.getElementById("securityCode").src = securityImageURL',500);
	setTimeout('document.body.style.cursor="default"',500);
}
 
//Ask Question Validation
function valAskQuestion(){
	var cmbCategory=trim(document.frmAskQuestion.cmbCategory.value);
	var txtHeader=trim(document.frmAskQuestion.txtHeader.value);
	var txtDescription=trim(document.frmAskQuestion.txtDescription.value);
	document.getElementById("errorHeader").style.display="none";
	document.getElementById("errorDescription").style.display="none";
	document.getElementById("errorCategorySelect").style.display="none";
	
	if(cmbCategory == ""){
		document.getElementById("errorCategorySelect").style.display="block";
		document.frmAskQuestion.cmbCategory.focus();
		return false;
	}	
	if(txtHeader== ""){
		document.getElementById("errorHeader").style.display="block";
		document.frmAskQuestion.txtHeader.focus();
		return false;
	}
 	if(txtDescription== ""){
		document.getElementById("errorDescription").style.display="block";
		document.frmAskQuestion.txtDescription.focus();
		return false;
	}
	return true;
}	 
//End Ask Question Validation

//Start post news Validation
function valPostNews(){
 	var txtTitle=trim(document.frmPostNews.txtTitle.value);
 	var txtDescription=trim(document.frmPostNews.txtDescription.value);
 	var txtDate=document.frmPostNews.txtDate.value;
 	var cmbCategory=trim(document.frmPostNews.cmbCategory.value);
 	 	
 	document.getElementById("errorTitle").style.display="none";
 	document.getElementById("errorDescription").style.display="none";
 	document.getElementById("errorDate").style.display="none";
 	document.getElementById("errorCategorySelect").style.display="none";
	
	if(txtTitle.length == 0){
		document.getElementById("errorTitle").style.display="block";
		document.frmPostNews.txtTitle.focus();
		return false;
	}
	
 	if(txtDescription.length == 0){
		document.getElementById("errorDescription").style.display="block";
		document.frmPostNews.txtDescription.focus();
		return false;
	}
	
	if(txtDate.length == 0){
		document.getElementById("errorDate").style.display="block";
		document.frmPostNews.txtDate.focus();
		return false;
	}
	
	if(cmbCategory == ""){
		document.getElementById("errorCategorySelect").style.display="block";
		document.frmPostNews.cmbCategory.focus();
		return false;
	}
	return true;	
}	 
//End post news Validation

//Edit Personal Info Validation
function valEditPersonalInfo(){
	var txtFirstName=trim(document.frmEditPersonalInfo.txtFirstName.value);
	var txtLastName=trim(document.frmEditPersonalInfo.txtLastName.value);
	var txtEmail=trim(document.frmEditPersonalInfo.txtEmail.value);
	var txtCity=trim(document.frmEditPersonalInfo.txtCity.value);
	var cmbCountry=trim(document.frmEditPersonalInfo.cmbCountry.value);
	var txtAltEmail=trim(document.frmEditPersonalInfo.txtAltEmail.value);
	var txtAddress1=trim(document.frmEditPersonalInfo.txtAddress1.value);
	var txtLandline1=trim(document.frmEditPersonalInfo.txtLandline1.value);
	var txtLandline2=trim(document.frmEditPersonalInfo.txtLandline2.value);
	var txtLandline3=trim(document.frmEditPersonalInfo.txtLandline3.value);
	var txtMobile2=trim(document.frmEditPersonalInfo.txtMobile2.value);
      	 
	document.getElementById("errorFirstName").style.display="none";
	document.getElementById("errorMiddleName").style.display="none";
	document.getElementById("errorLastName").style.display="none";
	document.getElementById("errorEmail").style.display="none";
	document.getElementById("errorEmailInvalid").style.display="none";
	document.getElementById("errorCity").style.display="none";
	document.getElementById("errorCountry").style.display="none";
	document.getElementById("errorLandline1").style.display="none";
	document.getElementById("errorLandline2").style.display="none";
	document.getElementById("errorLandline3").style.display="none";
	document.getElementById("errorMobile").style.display="none";
        document.getElementById("errorAltEmail").style.display="none";
	document.getElementById("errorAltEmailInvalid").style.display="none";
	document.getElementById("errorAddress1").style.display="none";
	
	if(txtFirstName== ""){
		document.getElementById("errorFirstName").style.display="block";
		document.frmEditPersonalInfo.txtFirstName.focus();
		return false;
	}
	
 	if(txtLastName == ""){
		document.getElementById("errorLastName").style.display="block";
		document.frmEditPersonalInfo.txtLastName.focus();
		return false;
	}
	
	if(txtEmail == ""){
		document.getElementById("errorEmail").style.display="block";
		document.frmEditPersonalInfo.txtEmail.focus();
		return false;
	}	
	
	if(isEmail(txtEmail) == false){
		document.getElementById("errorEmailInvalid").style.display="block";
		document.frmEditPersonalInfo.txtEmail.focus();
		return false;
	}
	
	if(txtAltEmail == ""){
		document.getElementById("errorAltEmail").style.display="block";
		document.frmEditPersonalInfo.txtAltEmail.focus();
		return false;
	}
	
	if(isEmail(txtAltEmail) == false){
		document.getElementById("errorAltEmailInvalid").style.display="block";
		document.frmEditPersonalInfo.txtAltEmail.focus();
		return false;
	}
	
	if(txtAddress1 == ""){
		document.getElementById("errorAddress1").style.display="block";
		document.frmEditPersonalInfo.txtAddress1.focus();
		return false;
	}
	
	if(txtCity == ""){
		document.getElementById("errorCity").style.display="block";
		document.frmEditPersonalInfo.txtCity.focus();
		return false;
	}
	
	if(cmbCountry == ""){
		document.getElementById("errorCountry").style.display="block";
		document.frmEditPersonalInfo.cmbCountry.focus();
		return false;
	}
	
	if(txtLandline1 == ""){
		document.getElementById("errorLandline1").style.display="block";
		document.frmEditPersonalInfo.txtLandline1.focus();
		return false;
	}
	
	if(txtLandline2 == ""){
		document.getElementById("errorLandline2").style.display="block";
		document.frmEditPersonalInfo.txtLandline2.focus();
		return false;
	}
	
	if(txtLandline3 == ""){
		document.getElementById("errorLandline3").style.display="block";
		document.frmEditPersonalInfo.txtLandline3.focus();
		return false;
	}		
	if(txtMobile2== ""){
                document.getElementById("errorMobile").style.display="block";
                document.frmEditPersonalInfo.txtMobile2.focus();
                return false;
        }  	
	return true;	
}	 
//End Edit Personal Info Validation

//Start Change Password Validation
function valChangePassword(){
	var txtOldPassword=trim(document.frmChangePassword.txtOldPassword.value);
	var txtNewPassword=trim(document.frmChangePassword.txtNewPassword.value);
	var txtConfirmPassword=trim(document.frmChangePassword.txtConfirmPassword.value);
	
	document.getElementById("errorOldPassword").style.display="none";
	document.getElementById("errorNewPassword").style.display="none";
	document.getElementById("errorConfirmPassword").style.display="none";
	document.getElementById("errorMatchPassword").style.display="none";

	if(txtOldPassword == ""){
		document.getElementById("errorOldPassword").style.display="block";
		document.frmChangePassword.txtOldPassword.focus();
		return false;
	}
	
	if(txtNewPassword == ""){
		document.getElementById("errorNewPassword").style.display="block";
		document.frmChangePassword.txtNewPassword.focus();
		return false;
	}
	if(txtConfirmPassword == ""){
		document.getElementById("errorConfirmPassword").style.display="block";
		document.frmChangePassword.txtConfirmPassword.focus();
		return false;
	}
	if(txtNewPassword != txtConfirmPassword){
		document.getElementById("errorMatchPassword").style.display="block";
		document.frmChangePassword.txtNewPassword.select();
		return false;
	}
	return true;
}	
//End Change Password Validation

//Start Forgot Password Validation
function valForgotPassword(){
	var txtUsername=trim(document.frmForgotPassword.txtUsername.value);
	var txtEmail=trim(document.frmForgotPassword.txtEmail.value);
	var txtFirstname=trim(document.frmForgotPassword.txtFirstname.value);
	var txtLastname=trim(document.frmForgotPassword.txtLastname.value);
	
	document.getElementById("errorUsername").style.display="none";
	document.getElementById("errorEmail").style.display="none";
	document.getElementById("errorEmailInvalid").style.display="none";
	document.getElementById("errorFirstname").style.display="none";
	document.getElementById("errorLastname").style.display="none";

	if(txtUsername == ""){
		document.getElementById("errorUsername").style.display="block";
		document.frmForgotPassword.txtUsername.focus();
		return false;
	}
	
	if(txtEmail == ""){
		document.getElementById("errorEmail").style.display="block";
		document.frmForgotPassword.txtEmail.focus();
		return false;
	}
	if(isEmail(txtEmail)==false){
		document.getElementById("errorEmailInvalid").style.display="block";
		document.frmForgotPassword.txtEmail.focus();
		return false;
	}
	if(txtFirstname == ""){
		document.getElementById("errorFirstname").style.display="block";
		document.frmForgotPassword.txtFirstname.focus();
		return false;
	}
	if(txtLastname == ""){
		document.getElementById("errorLastname").style.display="block";
		document.frmForgotPassword.txtLastname.focus();
		return false;
	}
	return true;
}	
//End Change Password Validation

//Start Forgot Username Validation
function valForgotUsername(){
	var txtEmail=trim(document.frmForgotUsername.txtEmail.value);
	var txtFirstname=trim(document.frmForgotUsername.txtFirstname.value);
	var txtLastname=trim(document.frmForgotUsername.txtLastname.value);
	
	document.getElementById("errorEmail").style.display="none";
	document.getElementById("errorEmailInvalid").style.display="none";
	document.getElementById("errorFirstname").style.display="none";
	document.getElementById("errorLastname").style.display="none";

	if(txtEmail == ""){
		document.getElementById("errorEmail").style.display="block";
		document.frmForgotUsername.txtEmail.focus();
		return false;
	}
	
	if(isEmail(txtEmail)==false){
		document.getElementById("errorEmailInvalid").style.display="block";
		document.frmForgotUsername.txtEmail.focus();
		return false;
	}
	
	if(txtFirstname == ""){
		document.getElementById("errorFirstname").style.display="block";
		document.frmForgotUsername.txtFirstname.focus();
		return false;
	}
	
	if(txtLastname == ""){
		document.getElementById("errorLastname").style.display="block";
		document.frmForgotUsername.txtLastname.focus();
		return false;
	}
	return true;
}	
//End Change Username Validation

//Start New Chapter Validation
function valNewChapter(){
	var txtChapter=trim(document.frmNewChapter.txtChapter.value);
	var txtDescription=trim(document.frmNewChapter.txtDescription.value);
	
	document.getElementById("errorChapter").style.display="none";
	document.getElementById("errorDescription").style.display="none";

	if(txtChapter == ""){
		document.getElementById("errorChapter").style.display="block";
		document.frmNewChapter.txtChapter.focus();
		return false;
	}
	
	if(txtDescription==""){
		document.getElementById("errorDescription").style.display="block";
		document.frmNewChapter.txtDescription.focus();
		return false;
	}
	return true;
}	
//End New Chapter Validation

//Start special page Validation
function valSpecialPage(){
var txtPageName=trim(document.frmSpecialPage.txtPageName.value);
var txtRemarks=trim(document.frmSpecialPage.txtRemarks.value);

document.getElementById("errorPagename").style.display="none";
document.getElementById("errorRemarks").style.display="none";

	if(txtPageName == ""){
		document.getElementById("errorPagename").style.display="block";
		document.frmSpecialPage.txtPageName.focus();
		return false;
	}
	
	if(txtRemarks==""){
		document.getElementById("errorRemarks").style.display="block";
		document.frmSpecialPage.txtRemarks.focus();
		return false;
	}
	return true;
}	
//End special page Validation

//Start new Alumni Service Validation
function valNewAlumniService(){
	var txtTitle=trim(document.frmNewAlumniService.txtTitle.value);
	var txtDescription=trim(document.frmNewAlumniService.txtDescription.value);
	
	document.getElementById("errorTitle").style.display="none";
	document.getElementById("errorDescription").style.display="none";

	if(txtTitle == ""){
		document.getElementById("errorTitle").style.display="block";
		document.frmNewAlumniService.txtTitle.focus();
		return false;
	}
	
	if(txtDescription==""){
		document.getElementById("errorDescription").style.display="block";
		document.frmNewAlumniService.txtDescription.focus();
		return false;
	}
	return true;
}	
//End new Alumni Service Validation

//Start notice report abuse Validation
function valNoticeReportAbuse(){
	var txtHeader=trim(document.frmReportAbuse.txtHeader.value);
	var txtDescription=trim(document.frmReportAbuse.txtDescription.value);
	
	document.getElementById("errorHeader").style.display="none";
	document.getElementById("errorDescription").style.display="none";

	if(txtHeader == ""){
		document.getElementById("errorHeader").style.display="block";
		document.frmReportAbuse.txtHeader.focus();
		return false;
	}
	if(txtDescription==""){
		document.getElementById("errorDescription").style.display="block";
		document.frmReportAbuse.txtDescription.focus();
		return false;
	}
	return true;
}	
//End notice report abuse Validation

//Start knowledge repository  Validation
function valKR(){
	var cmbSection=trim(document.frmKR.cmbSection.value);
	var txtAuthor=trim(document.frmKR.txtAuthor.value);
	var txtTitle=trim(document.frmKR.txtTitle.value);
	var txtDescription=trim(document.frmKR.txtDescription.value);
	var txtPublicationDate=trim(document.frmKR.txtPublicationDate.value);
	var uploadedFile=trim(document.frmKR.uploadedFile.value);
	 
	document.getElementById("errorSectionSelect").style.display="none";
	document.getElementById("errorAuthor").style.display="none";
	document.getElementById("errorTitle").style.display="none";
	document.getElementById("errorDescription").style.display="none";
	document.getElementById("errorPublicationDate").style.display="none";
	document.getElementById("errorUploadFile").style.display="none";

	if(cmbSection == ""){
		document.getElementById("errorSectionSelect").style.display="block";
		document.frmKR.cmbSection.focus();
		return false;
	}
	
	if(txtAuthor==""){
		document.getElementById("errorAuthor").style.display="block";
		document.frmKR.txtAuthor.focus();
		return false;
	}
	
	if(txtTitle == ""){
		document.getElementById("errorTitle").style.display="block";
		document.frmKR.txtTitle.focus();
		return false;
	}
	
	if(txtDescription==""){
		document.getElementById("errorDescription").style.display="block";
		document.frmKR.txtDescription.focus();
		return false;
	}
	
	if(txtPublicationDate==""){
		document.getElementById("errorPublicationDate").style.display="block";
		document.frmKR.txtPublicationDate.focus();
		return false;
	}
	
	if(uploadedFile==""){
		document.getElementById("errorUploadFile").style.display="block";
		document.frmKR.uploadedFile.focus();
		return false;
	}	
	return true;
}	
//End knowledge repository Validation

//Start event calender validation
	function valCalender(){
	var cmbMonth=trim(document.frmCalendar.cmbMonth.value);
	var cmbYear=trim(document.frmCalendar.cmbYear.value);
	
	document.getElementById("errorMonthSelection").style.display="none";
	document.getElementById("errorYearSelection").style.display="none";

	if(cmbMonth == ""){
		document.getElementById("errorMonthSelection").style.display="block";
		document.frmCalendar.cmbMonth.focus();
		return false;
	}
	
	if(cmbYear==""){
		document.getElementById("errorYearSelection").style.display="block";
		document.frmCalendar.cmbYear.focus();
		return false;
	}
	return true;
}	
//End event calender validation

//Delete Validation
function valDelete(){
	return confirm("Are you sure you want to delete this information?");
}
//end Delete Validation

//Start network member validation
function validateMemberNetwork(){
	var txtOrganizationName = trim(document.frmMemberNetwork.txtOrganizationName.value);
	var txtAddress1 = trim(document.frmMemberNetwork.txtAddress1.value);
	var txtAddress2 = trim(document.frmMemberNetwork.txtAddress2.value);
	var txtCity = trim(document.frmMemberNetwork.txtCity.value);
	var cmbCountry = trim(document.frmMemberNetwork.cmbCountry.value);
	var txtFromDate = trim(document.frmMemberNetwork.txtFromDate.value);
	var txtToDate = trim(document.frmMemberNetwork.txtToDate.value);
	var txtDesignation = trim(document.frmMemberNetwork.txtDesignation.value);
	 
	document.getElementById("errorOrganizationName").style.display = "none";
	document.getElementById("errorAddress1").style.display = "none";
	document.getElementById("errorAddress2").style.display = "none";
	document.getElementById("errorCity").style.display = "none";
	document.getElementById("errorCountry").style.display = "none";
	document.getElementById("errorFromDate").style.display = "none";
	document.getElementById("errorToDate").style.display = "none";
	document.getElementById("errorPresentJob").style.display = "none";
	document.getElementById("errorDesignation").style.display = "none";
 
	if(txtOrganizationName == ""){
		document.getElementById("errorOrganizationName").style.display = "block";
		document.frmMemberNetwork.txtOrganizationName.focus();
		return false;
	}
 
	if(txtAddress1 == ""){
		document.getElementById("errorAddress1").style.display = "block";
		document.frmMemberNetwork.txtAddress1.focus();
		return false;
	}
	
	if(txtAddress2 == ""){
		document.getElementById("errorAddress2").style.display = "block";
		document.frmMemberNetwork.txtAddress2.focus();
		return false;
	}
	
	if(txtCity == ""){
		document.getElementById("errorCity").style.display = "block";
		document.frmMemberNetwork.txtCity.focus();
		return false;
	}
	
	if(cmbCountry == ""){
		document.getElementById("errorCountry").style.display = "block";
		document.frmMemberNetwork.cmbCountry.focus();
		return false;
	}
	
	if(txtFromDate == ""){
		document.getElementById("errorFromDate").style.display = "block";
		document.frmMemberNetwork.txtFromDate.focus();
		return false;
	}
			
	if(txtToDate == ""){
		if(document.frmMemberNetwork.presentJob.checked==false){
			document.getElementById("errorPresentJob").style.display = "block";
			return false;
		}			
	}
	
	if(txtDesignation == ""){
		document.getElementById("errorDesignation").style.display = "block";
		document.frmMemberNetwork.txtDesignation.focus();
		return false;
	}	
	return true;	
}
//End network member validation

//Start vanture member validation
function validateMemberVenture(){
	var txtName = trim(document.frmVenture.txtName.value);
	var txtNature = trim(document.frmVenture.txtNature.value);
	var txtDetails = trim(document.frmVenture.txtDetails.value);
	 
	document.getElementById("errorName").style.display = "none";
	document.getElementById("errorNature").style.display = "none";
	document.getElementById("errorDetails").style.display = "none";
 
	if(txtName == ""){
		document.getElementById("errorName").style.display = "block";
		document.frmVenture.txtName.focus();
		return false;
	}
	
	if(txtNature == ""){
		document.getElementById("errorNature").style.display = "block";
		document.frmVenture.txtNature.focus();
		return false;
	}
	
	if(txtDetails == ""){
		document.getElementById("errorDetails").style.display = "block";
		document.frmVenture.txtDetails.focus();
		return false;
	}	
	return true;	
}
//End mamber venture validation

//Start contact member validation
function validateMemberContact(){
	var txtName = trim(document.frmMemberContact.txtName.value);
	var txtAddress = trim(document.frmMemberContact.txtAddress.value);
	var txtNumber1 = trim(document.frmMemberContact.txtNumber1.value);
	var txtCity = trim(document.frmMemberContact.txtCity.value);
	var txtEmail = trim(document.frmMemberContact.txtEmail.value);
	var txtBirthdate = trim(document.frmMemberContact.txtBirthdate.value);
	var txtDesignation = trim(document.frmMemberContact.txtDesignation.value);
	//var txtWebpage = trim(document.frmMemberContact.txtWebpage.value);  
	
	document.getElementById("errorName").style.display = "none";
	document.getElementById("errorAddress").style.display = "none";
	document.getElementById("errorNumber1").style.display = "none";
	document.getElementById("errorCity").style.display = "none";
	document.getElementById("errorEmail1").style.display = "none";
	document.getElementById("errorEmail2").style.display = "none";
	document.getElementById("errorBirthdate").style.display = "none";
	document.getElementById("errorDesignation").style.display = "none";
	//document.getElementById("errorWebpage").style.display = "none";
  
 	if(txtName == ""){
 		document.getElementById("errorName").style.display = "block";
 		document.frmMemberContact.txtName.focus();
 		return false;
 	}
 	
 	if(txtAddress == ""){
 		document.getElementById("errorAddress").style.display = "block";
 		document.frmMemberContact.txtAddress.focus();
 		return false;
 	}
 	
 	if(txtNumber1 == ""){
 		document.getElementById("errorNumber1").style.display = "block";
 		document.frmMemberContact.txtNumber1.focus();
 		return false;
 	}
 	
 	if(isNaN(txtNumber1)){
 		document.getElementById("errorNumber1").style.display="block";
 		document.frmMemberContact.txtNumber1.select();
 		return false;
 	}
 	
 	if(txtCity == ""){
 		document.getElementById("errorCity").style.display = "block";
 		document.frmMemberContact.txtCity.focus();
 		return false;
 	}
 		
 	if(txtEmail == ""){
 		document.getElementById("errorEmail1").style.display = "block";
 		document.frmMemberContact.txtEmail.focus();
 		return false;
 	}
 	
 	if(isEmail(txtEmail)== false){
 		document.getElementById("errorEmail2").style.display = "block";
 		document.frmMemberContact.txtEmail.select();
 		return false;
 	}
 	
 	if(txtBirthdate == ""){
 		document.getElementById("errorBirthdate").style.display = "block";
 		document.frmMemberContact.txtBirthdate.focus();
 		return false;
 	}
 	
 	if(txtDesignation == ""){
 		document.getElementById("errorDesignation").style.display = "block";
 		document.frmMemberContact.txtDesignation.focus();
 		return false;
 	}
 	
 	/*if(txtWebpage == ""){
 		document.getElementById("errorWebpage").style.display = "block";
 		document.frmMemberContact.txtWebpage.focus();
 		return false;
 	}*/
 	return true;
 }
//End contact member validation

//Start new job validation
function valJobPosting(){
	var cmbCategory=trim(document.frmJobPosting.cmbCategory.value);
	var txtTitle=trim(document.frmJobPosting.txtTitle.value);
	var txtBriefDescription=trim(document.frmJobPosting.txtBriefDescription.value);
	var txtDetailedDescription=trim(document.frmJobPosting.txtDetailedDescription.value);
	var uploadedFile=document.frmJobPosting.uploadedFile.value;
	var txtUrl=trim(document.frmJobPosting.txtUrl.value);
	var txtEndDate=document.frmJobPosting.txtEndDate.value;
	
	document.getElementById("errorCategorySelect").style.display = "none";
	document.getElementById("errorTitle").style.display = "none";
	document.getElementById("errorBriefDescription").style.display = "none";
	document.getElementById("errorDetailedDescription").style.display = "none";
	document.getElementById("errorFile").style.display = "none";
	document.getElementById("errorExternalUrl").style.display = "none";
	document.getElementById("errorEndDate").style.display = "none";
	 
	if(cmbCategory == ""){
 		document.getElementById("errorCategorySelect").style.display = "block";
 		document.frmJobPosting.cmbCategory.focus();
 		return false;
 	}
 	
 	if(txtTitle == ""){
 		document.getElementById("errorTitle").style.display = "block";
 		document.frmJobPosting.txtTitle.focus();
 		return false;
 	}
 	
 	if(txtBriefDescription == ""){
 		document.getElementById("errorBriefDescription").style.display = "block";
 		document.frmJobPosting.txtBriefDescription.focus();
 		return false;
 	}
 	
 	if(txtDetailedDescription == ""){
 		document.getElementById("errorDetailedDescription").style.display = "block";
 		document.frmJobPosting.txtDetailedDescription.focus();
 		return false;
 	}
 	
 	if(uploadedFile == ""){
 		document.getElementById("errorFile").style.display = "block";
 		document.frmJobPosting.uploadedFile.focus();
 		return false;
 	}
 	
 	if(txtUrl == ""){
 		document.getElementById("errorExternalUrl").style.display = "block";
 		document.frmJobPosting.txtUrl.focus();
 		return false;
 	}
 	if(txtEndDate == ""){
 		document.getElementById("errorEndDate").style.display = "block";
 		document.frmJobPosting.txtEndDate.focus();
 		return false;
 	}
}
//End new job validation

//Start ConfigureEmail validation
function valConfigureEmail(){
	var cmbEmail=document.frmConfigureEmail.cmbEmail.value;	
	document.getElementById("errorEmailIdSelect").style.display = "none";
 	if(cmbEmail == ""){
 		document.getElementById("errorEmailIdSelect").style.display = "block";
 		document.frmConfigureEmail.cmbEmail.focus();
 		return false;
 	}
 	return true;
 }
//End ConfigureEmail validation

//Start ConfigureEmail1 validation
function valConfigureEmail1(){
	var txtAdd=document.frmConfigureEmail1.txtAdd.value;	
	document.getElementById("errorAdd").style.display = "none";
	document.getElementById("errorAddValid").style.display = "none";

  	if(txtAdd == ""){
 		document.getElementById("errorAdd").style.display = "block";
 		document.frmConfigureEmail1.txtAdd.focus();
 		return false;
 	}
 	
 	if(isEmail(txtAdd) == false){
 		document.getElementById("errorAddValid").style.display = "block";
 		document.frmConfigureEmail1.txtAdd.focus();
 		return false;
 	}
 	return true;
 }
//End ConfigureEmail1 validation

//Start MemberInterest validation
function valMemberInterestList(){
	var txtNewInterest=trim(document.frmMemberInterestCheck.txtNewInterest.value);	
	document.getElementById("errorNewInterest").style.display = "none";	
	if(document.frmMemberInterestCheck.chkNewInterest.checked==true){
		if(txtNewInterest.length == 0){
			document.getElementById("errorNewInterest").style.display = "block";
 			document.frmMemberInterestCheck.txtNewInterest.focus();
 			return false;
 		}	
	}
	if(document.frmMemberInterestCheck.chkInstruction.checked==true){
		var newInterest=trim(document.frmMemberInterestCheck.newInterest.value);
		document.getElementById("errorNewInterestAdd").style.display = "none";
		if(document.frmMemberInterestCheck.cmbInterestsArea.value == ""){
			if(newInterest.length == 0){
				document.getElementById("errorNewInterestAdd").style.display = "block";
				document.frmMemberInterestCheck.newInterest.focus();
 				return false;
			}
		}		
	}
	return true;
}

function valMemberInterest(){
	var cmbInterestsArea=document.frmAddInterests.cmbInterestsArea.value;
	var txtArea=document.frmAddInterests.txtArea.value;
	var txtYear=document.frmAddInterests.txtYear.value;
	var txtInstitutes=document.frmAddInterests.txtInstitutes.value;
	var txtSubject=document.frmAddInterests.txtSubject.value;
	
	document.getElementById("errorAreaCategory").style.display = "none";
	document.getElementById("errorArea").style.display = "none";
	document.getElementById("errorYear").style.display = "none";
	document.getElementById("errorInstitute").style.display = "none";
	document.getElementById("errorSubject").style.display = "none";
	
	if(cmbInterestsArea == ""){
 		document.getElementById("errorAreaCategory").style.display = "block";
 		document.frmAddInterests.cmbInterestsArea.focus();
 		return false;
 	}
 	
 	if(cmbInterestsArea == "others"){
 		if(txtArea == ""){
	 		document.getElementById("errorArea").style.display = "block";
	 		document.frmAddInterests.txtArea.focus();
	 		return false;
 		}
 	}
 	
 	if(txtYear == ""){
 		document.getElementById("errorYear").style.display = "block";
 		document.frmAddInterests.txtYear.focus();
 		return false;
 	}
 	
 	if(txtInstitutes == ""){
 		document.getElementById("errorInstitute").style.display = "block";
 		document.frmAddInterests.txtInstitutes.focus();
 		return false;
 	}
 	
 	if(txtSubject == ""){
 		document.getElementById("errorSubject").style.display = "block";
 		document.frmAddInterests.txtSubject.focus();
 		return false;
 	}
 	return true;
}
//End MemberInterest validation

//Start SpecialPages validation
function valSpecialPages(){
	var txtPageName=trim(document.frmSpecialPage.txtPageName.value);
	var txtRemarks=trim(document.frmSpecialPage.txtRemarks.value);
	
	document.getElementById("errorPageName").style.display = "none";
	document.getElementById("errorRemarks").style.display="none";
	
	if(txtPageName==""){
		document.getElementById("errorPageName").style.display="block";
		document.frmSpecialPage.txtPageName.focus();
		return false;
	}
	
	if(txtRemarks==""){
		document.getElementById("errorRemarks").style.display="block";
		document.frmSpecialPage.txtRemarks.focus();
		return false;
	}
	return true;
}
//End SpecialPages validation

//Start AlumniServiceAbuse validation
function valAlumniServiceAbuse(){
	var txtHeader=document.frmAlumniServiceAbuse.txtHeader.value;
 	var txtDescription=document.frmAlumniServiceAbuse.txtDescription.value;
 	
 	document.getElementById("errorHeader").style.display="none";
 	document.getElementById("errorDescription").style.display="none";
 	
 	if(txtHeader==""){
 		document.getElementById("errorHeader").style.display="block";
 		document.frmAlumniServiceAbuse.txtHeader.focus();
 		return false;
 	}
 	
 	if(txtDescription==""){
 		document.getElementById("errorDescription").style.display="block";
 		document.frmAlumniServiceAbuse.txtDescription.focus();
 		return false;
 	}
 	return true;
}
//End AlumniServiceAbuse validation

//Start GyanMangtaAbuseReport validation
function valGyanMangtaAbuseReport(){
	var txtHeader=document.frmGyanMangtaAbuseReport.txtHeader.value;
	var txtDescription=document.frmGyanMangtaAbuseReport.txtDescription.value;
	
	document.getElementById("errorHeader").style.display="none";
	document.getElementById("errorDescription").style.display="none";
	
	if(txtHeader==""){
		document.getElementById("errorHeader").style.display="block";
		document.frmGyanMangtaAbuseReport.txtHeader.focus();
		return false;
	}
	
	if(txtDescription==""){
		document.getElementById("errorDescription").style.display="block";
		document.frmGyanMangtaAbuseReport.txtDescription.focus();
		return false;
	}
	return true;
}
//End GyanMangtaAbuseReport validation

//Start GyanMangtaReply validation
function valGyanMangtaReply(){
	var txtReply=document.frmGyanMangtaReply.txtReply.value;	
	document.getElementById("errorReply").style.display="none";	
	if(txtReply==""){
		document.getElementById("errorReply").style.display="block";
		document.frmGyanMangtaReply.txtReply.focus();
		return false;
	}
	return true;
}
//End GyanMangtaReply validation

//numeric validation
function digit(evt){
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57)){
		return false;
	}
	return true;
}
//end numeric validation

//Start Donation Details validation
function validateDonationDetails(){
	 var txtAmount=trim(document.frmDonation.txtAmount.value);
	 var txtChequeNo=trim(document.frmDonation.txtChequeNo.value);
	 var txtBankDetails=trim(document.frmDonation.txtBankDetails.value);
	 var txtChequeDate=trim(document.frmDonation.txtChequeDate.value);
	 var txtComment=trim(document.frmDonation.txtComment.value);
 
	 document.getElementById("errorAmount").style.display="none";
	 document.getElementById("errorChequeNo").style.display="none";
	 document.getElementById("errorBankDetails").style.display="none";
	 document.getElementById("errorChequeDate").style.display="none";
	 document.getElementById("errorComment").style.display="none";

	if(txtAmount.length == 0){
		document.getElementById("errorAmount").style.display="block";
		document.frmDonation.txtAmount.focus();
		return false;
	}
	
	if(txtChequeNo.length == 0){
		document.getElementById("errorChequeNo").style.display="block";
		document.frmDonation.txtChequeNo.focus();
		return false;
	}
	if(txtBankDetails.length == 0){
		document.getElementById("errorBankDetails").style.display="block";
		document.frmDonation.txtBankDetails.focus();
		return false;
	}
	if(txtChequeDate.length == 0){
		document.getElementById("errorChequeDate").style.display="block";
		document.frmDonation.txtChequeDate.focus();
		return false;
	}
	if(txtComment.length == 0){
		document.getElementById("errorComment").style.display="block";
		document.frmDonation.txtComment.focus();
		return false;
	}
	return true;
}	
//End Donation Details validation

//Start AlumniService Comment validation
function valAlumniServiceComment(){
	var txtComment=trim(document.frmAlumniServiceComment.txtComment.value);	
	document.getElementById("errorComment").style.display="none";	
	if(txtComment.length == 0){
		document.getElementById("errorComment").style.display="block";
		document.frmAlumniServiceComment.txtComment.focus();
		return false;
	}
	return true;
}
//End AlumniService Comment validation

//Start Service post by serviceprovider
function valServicePost(){
	var txtTitle=trim(document.frmAddNewService.txtTitle.value);
	var txtDescription=trim(document.frmAddNewService.txtDescription.value);
	var txtOffer=trim(document.frmAddNewService.txtOffer.value);
	var txtRestriction=trim(document.frmAddNewService.txtRestriction.value);
	var txtUrl=trim(document.frmAddNewService.txtUrl.value);
	var txtEndDate=document.frmAddNewService.txtEndDate.value;
	
	document.getElementById("errorTitle").style.display="none";
	document.getElementById("errorDescription").style.display="none";
	document.getElementById("errorOffer").style.display="none";
	document.getElementById("errorRestriction").style.display="none";
	document.getElementById("errorExternalUrl").style.display="none";
	document.getElementById("errorEndDate").style.display="none";
	
	if(txtTitle==""){
		document.getElementById("errorTitle").style.display="block";
		document.frmAddNewService.txtTitle.focus();
		return false;
	}
	
	if(txtDescription==""){
		document.getElementById("errorDescription").style.display="block";
		document.frmAddNewService.txtDescription.focus();
		return false;
	}
	
	if(txtOffer==""){
		document.getElementById("errorOffer").style.display="block";
		document.frmAddNewService.txtOffer.focus();
		return false;
	}
	
	if(txtRestriction==""){
		document.getElementById("errorRestriction").style.display="block";
		document.frmAddNewService.txtRestriction.focus();
		return false;
	}
	
	if(txtUrl==""){
		document.getElementById("errorExternalUrl").style.display="block";
		document.frmAddNewService.txtUrl.focus();
		return false;
	}
	
	if(txtEndDate==""){
		document.getElementById("errorEndDate").style.display="block";
		document.frmAddNewService.txtEndDate.focus();
		return false;
	}
	return true;
}

//End Service post by serviceprovider

//New Section of member web page
function valMemberWebPageSection(){
	var txtSection=document.frmSection1.txtSection.value;
	document.getElementById("errorNewSection").style.display="none";
	if(txtSection==""){
		document.getElementById("errorNewSection").style.display="block";
		document.frmSection1.txtSection.focus();
		return false;
	}
	return true;
}

function valSendEcard(){	
	var recipient=document.frmSendEcard1.noOfRecipients.value;
	var txtName1=trim(document.frmSendEcard1.txtName1.value);
	var txtEmailId1=trim(document.frmSendEcard1.txtEmailId1.value);
	var txtName2=trim(document.frmSendEcard1.txtName2.value);
	var txtEmailId2=trim(document.frmSendEcard1.txtEmailId2.value);
	var txtName3=trim(document.frmSendEcard1.txtName3.value);
	var txtEmailId3=trim(document.frmSendEcard1.txtEmailId3.value);
	var txtCardTitle=trim(document.frmSendEcard1.txtCardTitle.value);
	var txtMessage=trim(document.frmSendEcard1.txtMessage.value);
	var txtSignature=trim(document.frmSendEcard1.txtSignature.value);			
	
	document.getElementById("errorName1").style.display="none";
	document.getElementById("errorEmailId1").style.display="none";		
	document.getElementById("errorName2").style.display="none";
	document.getElementById("errorEmailId2").style.display="none";
	document.getElementById("errorName3").style.display="none";
	document.getElementById("errorEmailId3").style.display="none";
	document.getElementById("errorCardTitle").style.display="none";		
	document.getElementById("errorMessage").style.display="none";			
	document.getElementById("errorSignature").style.display="none";		
	
	if(txtName1==""){
		document.getElementById("errorName1").style.display="block";
		document.frmSendEcard1.txtName1.focus();
		return false;
	}
	
	if(txtEmailId1==""){
		document.getElementById("errorEmailId1").style.display="block";
		document.frmSendEcard1.txtEmailId1.focus();
		return false;
	}
	
	if(recipient=="2"){
		if(txtName2==""){
			document.getElementById("errorName2").style.display="block";
			document.frmSendEcard1.txtName2.focus();
			return false;
		}
		
		if(txtEmailId2==""){
			document.getElementById("errorEmailId2").style.display="block";
			document.frmSendEcard1.txtEmailId2.focus();
			return false;
		}
	}
	
	if(recipient=="3"){
		if(txtName3==""){
			document.getElementById("errorName3").style.display="block";
			document.frmSendEcard1.txtName3.focus();
			return false;
		}
		
		if(txtEmailId3==""){
			document.getElementById("errorEmailId3").style.display="block";
			document.frmSendEcard1.txtEmailId3.focus();
			return false;
		}
	}
	
	if(txtCardTitle==""){
		document.getElementById("errorCardTitle").style.display="block";
		document.frmSendEcard1.txtCardTitle.focus();
		return false;
	}
	
	if(txtMessage==""){
		document.getElementById("errorMessage").style.display="block";
		document.frmSendEcard1.txtMessage.focus();
		return false;
	}
	
	if(txtSignature==""){
		document.getElementById("errorSignature").style.display="block";
		document.frmSendEcard1.txtSignature.focus();
		return false;
	}
	return true;
}
