function validate()
{
	var frm = document.formmain;
	var errmsg = "";
	if (ValidatorTrim(frm.clscandidate_first_name.value)=='') errmsg += "First Name is required field.\r\n";
	if (ValidatorTrim(frm.clscandidate_last_name.value)=='') errmsg += "Last Name is required field.\r\n";
	if (ValidatorTrim(frm.clscandidate_address1.value)=='') errmsg += "Address1 is required.\r\n";
	if ((ValidatorTrim(frm.clscandidate_country.value)=='') || (ValidatorTrim(frm.clscandidate_country_id.value)=='') || (ValidatorTrim(frm.clscandidate_country_id.value)==0)  ) errmsg += "Country is required.\r\n";
	if ((ValidatorTrim(frm.clscandidate_state.value)=='') || (ValidatorTrim(frm.clscandidate_state_id.value)=='') || (ValidatorTrim(frm.clscandidate_state_id.value)==0) ) errmsg += "State is required.\r\n";
	if ((ValidatorTrim(frm.clscandidate_city.value)=='') || (ValidatorTrim(frm.clscandidate_city_id.value)=='') || (ValidatorTrim(frm.clscandidate_city_id.value)==0) ) errmsg += "City is required.\r\n";
	if (ValidatorTrim(frm.clscandidate_phone_day.value)=='' && ValidatorTrim(frm.clscandidate_phone_eve.value)=='' && ValidatorTrim(frm.clscandidate_phone_cell.value)=='') errmsg += 'At least one phone number is required.\r\n';
	if (ValidatorTrim(frm.clscandidate_email.value)!='') errmsg += checkEmail(frm.clscandidate_email.value);
	else errmsg += "Email is required field.\r\n";
	if (ValidatorTrim(frm.clscandidate_email.value)!='') 
	{
		var badEmail = checkEmail(frm.clscandidate_email.value);
		if (badEmail != "") errmsg += "Please Enter Valid Confirm Email Address.\r\n";
	}
	else errmsg += "Confirm Email Address is required field.\r\n";

	if ( ValidatorTrim(frm.clscandidate_email.value) != ValidatorTrim(frm.clscandidate_email_confirm.value) ) errmsg += "Email Address and Confirm Email Address Do Not Match.\r\n";
	if (ValidatorTrim(frm.clscandidate_para_recent_degree_type.value)=='') errmsg += "Recent Degree is required field.\r\n";
	if (ValidatorTrim(frm.clscandidate_recent_degree_year.value)=='') errmsg += "Recent Degree Year is required field.\r\n";
	if (ValidatorTrim(frm.clscandidate_password.value)=='') errmsg += "Password is required field.\r\n";
	if (ValidatorTrim(frm.clscandidate_confirmpassword.value)=='') errmsg += "Confirm Password is required field.\r\n";
	
	if (ValidatorTrim(frm.clscandidate_password.value) != ValidatorTrim(frm.clscandidate_confirmpassword.value)) errmsg += "Password mismatch.Both the password entered must be the same.\r\n";
	else if( (ValidatorTrim(frm.clscandidate_password.value)).length < 6 || (ValidatorTrim(frm.clscandidate_password.value)).length > 20 ) errmsg += "Password length must be between 6-20 characters.\r\n";	
	
	if(errmsg!="")
	{
		alert(errmsg);
		return false;
	}
	if(document.getElementById("isExit")) document.getElementById("isExit").value="false";
}