function validateCustomerLogin(form) {
	if (form.loginName.value.length < 1) {
		document.getElementById('div_username').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Your Login Name</font>";
		// alert('Please Enter your User Name!');
		form.loginName.focus();
		return false;
	}
	if (form.password.value == "") {
		document.getElementById('div_password').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Password</font>";
		// alert('Please Enter your Password!');
		form.password.focus();
		return false;
	}
}

/* Value Verfication Login Name*/
function verfiedLoginName(obj) {
	if (document.getElementById('loginName').length != 0) {
		document.getElementById('div_username').innerHTML = "<label></label>";
	}
}

/* Value Verfication Password*/
function verfiedPassword(obj) {
	if (document.getElementById('password').length != 0) {
		document.getElementById(obj).innerHTML = "<label></label>";
	}
}

/* Training Insterest*/
function verfiedTrainingInterest(obj) {
	if (document.getElementById('trainingInterest').length != 0) {
		document.getElementById(obj).innerHTML = "<label></label>";
	}
}

/*Terms and conditions*/
function checkTandC(obj) {
	if (document.getElementById('termsAndConditions').value != "") {
		document.getElementById(obj).innerHTML = '<label></label>';
	}
}
/*Edit Login Details*/
function editLoginDetails()
{
	window.location.href = './profile.do?action=edit';
}

/*Edit Login Details*/
function logOut()
{
	window.location.href = './custLogout.do';
}

function validateCustomerRegistration(form) {
	if (form.firstName.value.length < 1) {
		document.getElementById('div_firstname').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Your Name</font>";
		form.firstName.focus();
		return false;
	}
	regexpression = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if (form.email.value == "") {
		document.getElementById('div_email').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your E-mail address!</font>";
		form.email.focus();
		return false;
	} else if (!regexpression.test(form.email.value)) {
		document.getElementById('div_email').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Your Valid Email ID!</font>";
		form.email.focus();
		return false;
	}
	if (form.loginIds.value.length < 3 || form.loginIds.value == "") {
		document.getElementById('div_username').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Username!</font>";
		form.loginIds.focus();
		return false;
	}
	regexpression = /^[a-z0-9A-Z\_\.]+[a-z0-9A-Z]+$/;
	if (!regexpression.test(form.loginIds.value)) {
		document.getElementById('div_username').innerHTML = "<font size='2'px; style='color:red;'>Username must contain only letters, numbers and underscore !!</font>";
		form.loginIds.focus();
		return false;
	}
	// Password Validation.
	if (form.password.value != "") {
		if (form.password.value.length < 6) {
			document.getElementById('div_password').innerHTML = "<font size='2'px; style='color:red;'>Password must be 6 Letters!</font>";
			form.password.focus();
			return false;
		}
		regexpression = /^\w+$/;
		if (!regexpression.test(form.password.value)) {
			document.getElementById('div_password').innerHTML = "<font size='2'px; style='color:red;'>Password must contain letters and number!</font>";
			form.password.focus();
			return false;
		}
		if (form.password.value == form.loginIds.value) {
			document.getElementById('div_password').innerHTML = "<font size='2'px; style='color:red;'>Password must be different from User Name!</font>";
			form.password.focus();
			return false;
		}
	} else {
		document.getElementById('div_password').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Your Password!</font>";
		form.password.focus();
		return false;
	}
	// Retype Password Validation.
	if (form.repassword.value != "") {
		if (form.repassword.value.length < 6) {
			document.getElementById('div_conPassword').innerHTML = "<font size='2'px; style='color:red;'>RetypePassword must contain 6 letters!</font>";
			form.repassword.focus();
			return false;
		}
		if (form.repassword.value != form.password.value) {
			document.getElementById('div_conPassword').innerHTML = "<font size='2'px; style='color:red;'>Password and ReType Password must be same</font>";
			form.repassword.focus();
			return false;
		}
		regexpression = /^\w+$/;
		if (!regexpression.test(form.repassword.value)) {
			document.getElementById('div_conPassword').innerHTML = "<font size='2'px; style='color:red;'>RetypePassword must contain letters and numbers </font>";
			form.repassword.focus();
			return false;
		}
	} else {
		document.getElementById('div_conPassword').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Confirm Password </font>";
		form.repassword.focus();
		return false;
	}
	var testE = document.getElementById("div_email").innerHTML;
	if (testE != "") {
		form.email.focus();
		return false;
	}
	var test = document.getElementById("div_username").innerHTML;
	if (test != "") {
		form.loginIds.focus();
		return false;
	}
	
}

function on() {
	document.getElementById('loginIds').value = "";
}

function validateCustRegNext(form) {
	if (form.compName.value == "") {
		document.getElementById('div_org').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Company!</font>";
		form.compName.focus();
		return false;
	}
	regexpression = /^[a-zA-Z]+$/;
	if (!regexpression.test(form.compName.value)) {
		document.getElementById('div_org').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Valid Company!</font>";
		form.compName.focus();
		return false;
	}
	if (form.title.value == "") {
		document.getElementById('div_title').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Title!</font>";
		form.title.focus();
		return false;
	}
	regexpression = /^[a-zA-Z]+$/;
	if (!regexpression.test(form.title.value)) {
		document.getElementById('div_title').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Valid Title!</font>";
		form.title.focus();
		return false;
	}
	if (form.exp.value == "") {
		document.getElementById('div_exp').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Experience!</font>";
		form.exp.focus();
		return false;
	}
	regexpression = /^\d+$/;
	if (!regexpression.test(form.exp.value)) {
		document.getElementById('div_exp').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Valid Experience!</font>";
		form.exp.focus();
		return false;
	}

	if (form.mobile.value == "" && form.COUNTRYCODE.value == "091"
			&& form.AREACODE.value == "" && form.LANDLINE.value == "") {
		document.getElementById('div_mobile').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Mobile or Phone Number !!</font>";
		form.mobile.focus();
		return false;
	}

	if (form.mobile.value == "") {
		document.getElementById('div_mobile').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Mobile number !</font>";
		form.mobile.focus();
		return false;
	}

	if (form.countrycode.value == "") {
		document.getElementById('div_phone').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Country Code number !</font>";
		form.countrycode.focus();
		return false;
	}

	if (form.statecode.value == "") {
		document.getElementById('div_phone').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your State Code number !</font>";
		form.statecode.focus();
		return false;
	}

	if (form.landline.value == "") {
		document.getElementById('div_phone').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Landline number !</font>";
		form.landline.focus();
		return false;
	}
	if (form.country.value == 0) {
		document.getElementById('div_country').innerHTML = "<font size='2'px; style='color:red;'>Please Select Country!</font>";
		form.country.focus();
		return false;
	}

	if (form.state.value == 0) {
		document.getElementById('div_state').innerHTML = "<font size='2'px; style='color:red;'>Please Select State!</font>";
		form.state.focus();
		return false;
	}

	if (form.city.value == 0) {
		document.getElementById('div_city').innerHTML = "<font size='2'px; style='color:red;'>Please Select State!</font>";
		form.city.focus();
		return false;
	}

	regexpression = /^[\#\a-zA-Z0-9]+[\ \:\#\a-zA-Z0-9\,\.\-\/\r\n]+$/;
	if (form.address.value == "") {
		document.getElementById('div_add').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Address!</font>";
		form.address.focus();
		return false;
	} else if (form.address.value.length > 200) {
		document.getElementById('div_add').innerHTML = "<font size='2'px; style='color:red;'>Characters Should not excced more than 200!</font>";
		form.address.focus();
		return false;
	} else if (!regexpression.test(form.address.value)) {
		document.getElementById('div_add').innerHTML = "<font size='2'px; style='color:red;'>Address must contain only letters, numbers !</font>";
		form.address.focus();
		return false;
	}

	regexpression = /^\d+$/;
	if (form.pincode.value == "") {
		document.getElementById('div_pincode').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Pincode !</font>";
		form.pincode.focus();
		return false;
	} else if (!regexpression.test(form.pincode.value)) {
		document.getElementById('div_pincode').innerHTML = "<font size='2'px; style='color:red;'>Postal Code should contain Numbers!</font>";
		form.pincode.focus();
		return false;
	}

	if (form.trainingInterest.value == 0) {
		document.getElementById('div_trainingInterest').innerHTML = "<font size='2'px; style='color:red;'>Please Select Training!</font>";
		form.trainingInterest.focus();
		return false;
	}
	if (!form.termsAndConditions.checked) {
		document.getElementById('div_termConditions').innerHTML = "<font size='2'px; style='color:red;'>Please check the Terms and Conditions!</font>";
		return false;
	}
}

function verfiedFirstName(obj) {
	if (document.getElementById('firstName').length != 0) {
		document.getElementById('div_firstname').innerHTML = "<label></label>";
	}
}

function verfiedEmail(obj) {
	if (document.getElementById('email').length != 0) {
		document.getElementById('div_email').innerHTML = "<label></label>";
	}
}

function verfiedCountry(obj) {
	if (document.getElementById('country').length != 0) {
		document.getElementById('div_country').innerHTML = "<label></label>";
	}
}
function verfiedState(obj) {
	if (document.getElementById('state').length != 0) {
		document.getElementById('div_state').innerHTML = "<label></label>";
	}
}

function verfiedCity(obj) {
	if (document.getElementById('city').length != 0) {
		document.getElementById('div_city').innerHTML = "<label></label>";
	}
}

function verfiedAddress(obj) {
	if (document.getElementById('address').length != 0) {
		document.getElementById('div_add').innerHTML = "<label></label>";
	}
}

function verfiedPincode(obj) {
	if (document.getElementById('pincode').length != 0) {
		document.getElementById('div_pincode').innerHTML = "<label></label>";
	}
}

function checkMobileNumber(obj) {
	if (document.getElementById('mobile').length != 0) {
		document.getElementById('div_mobile').innerHTML = "<label></label>";
	}
}

function checkCountryCodePhone(obj) {
	if (document.getElementById('countrycode').length != 0) {
		document.getElementById('div_phone').innerHTML = "<label></label>";
	}
}

function checkStateCodePhone(obj) {
	if (document.getElementById('statecode').length != 0) {
		document.getElementById('div_phone').innerHTML = "<label></label>";
	}
}

function checkCityCodePhone(obj) {
	if (document.getElementById('landline').length != 0) {
		document.getElementById('div_phone').innerHTML = "<label></label>";
	}
}

function verfiedTitle(obj) {
	if (document.getElementById('title').length != 0) {
		document.getElementById('div_title').innerHTML = "<label></label>";
	}
}

function verfiedOrg(obj) {
	if (document.getElementById('compName').length != 0) {
		document.getElementById('div_org').innerHTML = "<label></label>";
	}
}

function verfiedExp(obj) {
	if (document.getElementById('exp').length != 0) {
		document.getElementById('div_exp').innerHTML = "<label></label>";
	}
}

function verfiedUsername(obj) {
	if (document.getElementById('loginIds').length != 0) {
		document.getElementById('div_username').innerHTML = "<label></label>";
	}
}

function verfiedRePassword(obj) {
	if (document.getElementById('repassword').length != 0) {
		document.getElementById('div_conPassword').innerHTML = "<label></label>";
	}
}

function validateContactForm(form) {
	if (form.firstName.value.length < 1) {
		//		alert('asdfasdf')
		document.getElementById('div_firstname').innerHTML = "<font size='2'px; style='color:red;'>Please Enter Your First Name</font>";
		return false;
	}
	//	if (form.password.value == "") {
	//		document.getElementById('div_password').innerHTML = "<font size='2'px; style='color:red;'>Please Enter your Password</font>";
	// // alert('Please Enter your Password!');
	// form.password.focus();
	// return false;
	// }
}

function verfiedFirstName(obj) {
	if (document.getElementById('firstName').length != 0) {
		document.getElementById('div_firstname').innerHTML = "<label></label>";
	}
}
