String.prototype.isText = function (){
			return /^[\w\s]*$/.test(this)
}
//---------------------------------
function validateQuickPostJobForm(){
	$('div_job_title','div_description_skill').invoke('hide');	
	tinyMCE.triggerSave(true,true);
	var skill = tinyMCE.getContent();
	if(skill==""){
		$('div_description_skill').show();	
		$('div_description_skill').update('Please Enter Company Detail.').setStyle({ color: '#FF0000' });	
		focus();
 		return false;
	}
	tinyMCE.triggerSave(true,true);
	var description = tinyMCE.getContent();
	if(description==""){
		$('div_description_skill').show();	
		$('div_description_skill').update('Please Enter Job Detail.').setStyle({ color: '#FF0000' });	
		focus();
 		return false;
	}
}//validateQuickPostJobForm
//------------------------------------------------
function validatePostJobForm(){
	$('div_job_title','div_no_of_position','div_job_category','div_industry','div_job_type','div_location','div_city','div_degree_level','div_career_level','div_experience','div_description_skill' , 'div_expire_time' /*,'div_industry','div_job_type','div_location','div_city','div_gender','div_degree_level','div_career_level','div_experience','div_description_skill'*/).invoke('hide');
	/*var expire = $('expire_time').value;
	alert(expire);
	return false;*/
 	var job_title = $('job_title').value ; 
	if(job_title==""){
		$('div_job_title').show();	
		$('div_job_title').update('Please Enter Job Title.').setStyle({ color: '#FF0000' });	
		 $('job_title').focus();
		 return false;
	}
	
	var no_of_position = $('no_of_position').value ; 
	if(no_of_position==""){
		$('div_no_of_position').show();	
		$('div_no_of_position').update('Please select no of positions.').setStyle({ color: '#FF0000' });	
		 $('no_of_position').focus();
		 return false;
	}
/*	if(job_title!=""){
	 	if(!job_title.isText()){
		$('div_job_title').show();	;
		$('div_job_title').update('Special character are not allowed in Title.').setStyle({ color: '#FF0000' });	
				return false;
		}
	 }
*/ 	
	
	var job_cat = $('job_cat').value ; 
	if(job_cat==""){
		$('div_job_category').show();	
		$('div_job_category').update('Please Select Category.').setStyle({ color: '#FF0000' });	
		$('job_cat').focus();
		 return false;
	}
 	var industry = $('industry').value ; 
	if(industry==""){
		$('div_industry').show();	
		$('div_industry').update('Please Select Industry.').setStyle({ color: '#FF0000' });	
		$('industry').focus();
		 return false;
	}
	var job_type = $('job_type').value ; 
	if(job_type==""){
		$('div_job_type').show();	
		$('div_job_type').update('Please Select Job Type.').setStyle({ color: '#FF0000' });	
		$('job_type').focus();
		 return false;
	}
	var location = $('location').value ; 
	if(location==""){
		$('div_location').show();	
		$('div_location').update('Please Select Location.').setStyle({ color: '#FF0000' });	
		$('location').focus();
		 return false;
	}
	var city = $('city').value ; 
	if(city==""){
		$('div_city').show();	
		$('div_city').update('Please Select City.').setStyle({ color: '#FF0000' });	
		$('city').focus();
		 return false;
	}
	var gender = $('gender').value ; 
	if(gender==""){
		$('div_gender').show();	
		$('div_gender').update('Please Select Gender.').setStyle({ color: '#FF0000' });	
		$('gender').focus();
		 return false;
	}
	
	
	
	var degree_level = $('degree_level').value ; 
	if(degree_level==""){
		$('div_degree_level').show();	
		$('div_degree_level').update('Please Select Degree Level.').setStyle({ color: '#FF0000' });	
		$('degree_level').focus();
		 return false;
	}
 	var career_level = $('career_level').value ; 
	if(career_level==""){
		$('div_career_level').show();	
		$('div_career_level').update('Please Select Career Level.').setStyle({ color: '#FF0000' });	
		$('career_level').focus();
		 return false;
	}
  	var experience = $('experience').value ; 
	if(experience==""){
		$('div_experience').show();	
		$('div_experience').update('Please Select Experience.').setStyle({ color: '#FF0000' });	
		$('experience').focus();
		 return false;
	}
	/*var textarea = tinyMCE.get('cData').getContent(); 
    if ( (textarea=="") || (textarea==null) ) {
           alert("Please enter Link Details!");
           cData.focus();
            return false; 
       } */

	
	
	
	//tinyMCE.triggerSave(true,true);
	
	//$current_time = 
	var description = tinyMCE.get('description').getContent();
	if(description==""){
		
		$('div_description_skill').show();	
		$('div_description_skill').update('Please Enter Description.').setStyle({ color: '#FF0000' });	
		$("description").focus();
 		return false;
	}
}//validatePostJobForm  FUNCTION
function validateEditJobForm(){
	
	$('div_job_title','div_no_of_position','div_job_category','div_industry','div_job_type','div_location','div_city','div_degree_level','div_career_level','div_experience','div_description_skill').invoke('hide');
 	var job_title = $('job_title').value ; 
	
	if(job_title==""){
		$('div_job_title').show();	
		$('div_job_title').update('Please Enter Job Title.').setStyle({ color: '#FF0000' });	
		 $('job_title').focus();
		 return false;
	}
/*	if(job_title!=""){
	 	if(!job_title.isText()){
		$('div_job_title').show();	;
		$('div_job_title').update('Special character are not allowed in Title.').setStyle({ color: '#FF0000' });	
				return false;
		}
	 }
*/ 	
// ------------------------------------------- wasim change -----------------------

var no_of_position = $('no_of_position').value ; 
	if(no_of_position==""){
		$('div_no_of_position').show();	
		$('div_no_of_position').update('Please Select No. of Position.').setStyle({ color: '#FF0000' });	
		$('no_of_position').focus();
		 return false;
	}

// -------------------------------------------- end ----------------------
var job_cat = $('job_cat').value ; 
	if(job_cat==""){
		$('div_job_category').show();	
		$('div_job_category').update('Please Select Category.').setStyle({ color: '#FF0000' });	
		$('job_cat').focus();
		 return false;
	}
 	var industry = $('industry').value ; 
	if(industry==""){
		$('div_industry').show();	
		$('div_industry').update('Please Select Industry.').setStyle({ color: '#FF0000' });	
		$('industry').focus();
		 return false;
	}
	var job_type = $('job_type').value ; 
	if(job_type==""){
		$('div_job_type').show();	
		$('div_job_type').update('Please Select Job Type.').setStyle({ color: '#FF0000' });	
		$('job_type').focus();
		 return false;
	}
	var location = $('location').value ; 
	if(location==""){
		$('div_location').show();	
		$('div_location').update('Please Select Location.').setStyle({ color: '#FF0000' });	
		$('location').focus();
		 return false;
	}
	var city = $('city').value ; 
	if(city==""){
		$('div_city').show();	
		$('div_city').update('Please Select City.').setStyle({ color: '#FF0000' });	
		$('city').focus();
		 return false;
	}
	var gender = $('gender').value ; 
	if(gender==""){
		$('div_gender').show();	
		$('div_gender').update('Please Select Gender.').setStyle({ color: '#FF0000' });	
		$('gender').focus();
		 return false;
	}
	
	
	
	var degree_level = $('degree_level').value ; 
	if(degree_level==""){
		$('div_degree_level').show();	
		$('div_degree_level').update('Please Select Degree Level.').setStyle({ color: '#FF0000' });	
		$('degree_level').focus();
		 return false;
	}
 	var career_level = $('career_level').value ; 
	if(career_level==""){
		$('div_career_level').show();	
		$('div_career_level').update('Please Select Career Level.').setStyle({ color: '#FF0000' });	
		$('career_level').focus();
		 return false;
	}
  	var experience = $('experience').value ; 
	if(experience==""){
		$('div_experience').show();	
		$('div_experience').update('Please Select Experience.').setStyle({ color: '#FF0000' });	
		$('experience').focus();
		 return false;
	}
	/*var textarea = tinyMCE.get('cData').getContent(); 
    if ( (textarea=="") || (textarea==null) ) {
           alert("Please enter Link Details!");
           cData.focus();
            return false; 
       } */

	
	
	
	//tinyMCE.triggerSave(true,true);
	var description = tinyMCE.get('description').getContent();
	if(description==""){
		
		$('div_description_skill').show();	
		$('div_description_skill').update('Please Enter Description.').setStyle({ color: '#FF0000' });	
		$("description").focus();
 		return false;
	}
}//validatePostJobForm  FUNCTION
//---------------------------

function validateForwordJob(){
	$('div_field_validation').hide();	
	var uname = $('uname').value ; 
	if(uname==""){
		$('div_field_validation').show();	
		$('div_field_validation').update('Please Enter Name.').setStyle({ color: '#FF0000' });	
		$('uname').focus();
		 return false;
	}
	var email_from = $('email_from').value ; 
	if(email_from==""){
		$('div_field_validation').show();	
		$('div_field_validation').update('Please Enter Your Email Address.').setStyle({ color: '#FF0000' });	
		$('email_from').focus();
		 return false;
	}
	if(email_from!=""){
			if(!email_from.isEmail()){
				$('div_field_validation').show();	
			   $('div_field_validation').update("Error ! Invalid Email Address.");
			    $('email_from').focus();
 				return false;; 
			}	
	}
	var email_to = $('email_to').value ; 
	if(email_to==""){
		$('div_field_validation').show();	
		$('div_field_validation').update('Please Enter Your Friend Email Address.').setStyle({ color: '#FF0000' });	
		$('email_to').focus();
		 return false;
	}
	if(email_to!=""){
			if(!email_to.isEmail()){
				$('div_field_validation').show();	
			   $('div_field_validation').update("Error ! Invalid Email Address.");
			    $('email_to').focus();
 				return false;; 
			}	
	}
	var security_code = $('security_code').value ; 
	if(security_code==""){
		$('div_field_validation').show();	
		$('div_field_validation').update('Please Enter Security Code.').setStyle({ color: '#FF0000' });	
		$('security_code').focus();
		 return false;
	}

}//function end
//-----------------------------------------
function validateCoverLetter(){
	$('div_cover_letter').hide();	
	var content = $('content').value ; 
	if(content==""){
		$('div_cover_letter').show();	
		$('div_cover_letter').update('Please Enter Content.').setStyle({ color: '#FF0000' });	
		$('content').focus();
		 return false;
	}
	var security_code = $('security_code').value ; 
	if(security_code==""){
		$('div_cover_letter').show();	
		$('div_cover_letter').update('Please Enter Security Code.').setStyle({ color: '#FF0000' });	
		$('security_code').focus();
		 return false;
	}
}//validateCoverLetter
//-------------------------------
function validateInterviewForCall(){
	var message = $('message').value ; 
	
	if(message==""){
		$('div_interview_for_call').show();	
		$('div_interview_for_call').update('Please Enter Message.').setStyle({ color: '#FF0000' });	
		$('message').focus();
		 return false;
	}
	var security_code = $('security_code').value ; 
	if(security_code==""){
		$('div_interview_for_call').show();	
		$('div_interview_for_call').update('Please Enter Security Code.').setStyle({ color: '#FF0000' });	
		$('security_code').focus();
		 return false;
	}
}//function
//-----------------------------------------
function validateRequestHotJob(){ 
	$('div_request_hot_job').hide();
	var message = $('message').value ; 
	if(message==""){
		$('div_request_hot_job').show();	
		$('div_request_hot_job').update('Please Enter Message.').setStyle({ color: '#FF0000' });	
		$('message').focus();
		 return false;
	}
	var security_code = $('security_code').value ; 
	if(security_code==""){
		$('div_request_hot_job').show();	
		$('div_request_hot_job').update('Please Enter Security Code.').setStyle({ color: '#FF0000' });	
		$('security_code').focus();
		 return false;
	}
}//function validateRequestHotJob()
//--------------------------------------------
String.prototype.isEmail = function(){
    if (!this) {
        return false;
    }
    var iChars = "*|,\":<>[]{}`';()&$#% ";
    for (var i = 0; i<this.length; i++) {
        if (iChars.indexOf(this.charAt(i)) != -1) {
            return false;
        }
    }
    if (this.indexOf("@") == -1) {
        return false;
    }
    if (this.indexOf(".") == -1) {
        return false;
    }
    return true;
}//function end
//-------------------
function ValidateUserForgotPwd(){
	$('div_email_address').hide();
	var email = $('email').value ; 
	if(email==""){
		$('div_email_address').show();	
		$('div_email_address').update('Please Enter Email Address.').setStyle({ color: '#FF0000' });	
		$('email').focus();
		 return false;
	}
	if(email!=""){
			if(!email.isEmail()){
				$('div_email_address').show();	
			   $('div_email_address').update("Error ! Invalid Email Address.");
			    $('email').focus();
 				return false;; 
			}	
	}
}//ValidateUserForgotPwd
//---------------------------------------
function validateUploadCV(){
		$('div_upload_cv').show();
		var title = $('title').value ; 
		if(title==""){
			$('div_upload_cv').show();	
			$('div_upload_cv').update('Please Enter CV Title.').setStyle({ color: '#FF0000' });	
			$('title').focus();
			 return false;
		}
		var cv = $('cv').value ;
		var str_len = cv.length;
		var cv_ext = cv.substring((str_len-3),str_len);
		
		if(cv!=""){ 
			if((cv_ext!="doc") && (cv_ext!="pdf")){
				$('div_upload_cv').show();	
				$('div_upload_cv').update('You can upload only PDF or DOC file.').setStyle({ color: '#FF0000' });	
				$('cv').focus();
				 return false;
			}
		}
}//function 
//-------------------------------------
function validateSelfJobPost(){
	$('div_job_title','div_job_category','div_industry','div_job_type','div_location','div_city','div_gender','div_degree_level','div_career_level','div_experience','div_description_skill','div_employeer_msg').invoke('hide');
 	var job_title = $('job_title').value ; 
	if(job_title==""){
		$('div_job_title').show();	
		$('div_job_title').update('Please Enter Job Title.').setStyle({ color: '#FF0000' });	
		 $('job_title').focus();
		 return false;
	}
var job_cat = $('job_cat').value ; 
	if(job_cat==""){
		$('div_job_category').show();	
		$('div_job_category').update('Please Select Category.').setStyle({ color: '#FF0000' });	
		$('job_cat').focus();
		 return false;
	}
 	var industry = $('industry').value ; 
	if(industry==""){
		$('div_industry').show();	
		$('div_industry').update('Please Select Industry.').setStyle({ color: '#FF0000' });	
		$('industry').focus();
		 return false;
	}
	var job_type = $('job_type').value ; 
	if(job_type==""){
		$('div_job_type').show();	
		$('div_job_type').update('Please Select Job Type.').setStyle({ color: '#FF0000' });	
		$('job_type').focus();
		 return false;
	}
	var location = $('location').value ; 
	if(location==""){
		$('div_location').show();	
		$('div_location').update('Please Select Location.').setStyle({ color: '#FF0000' });	
		$('location').focus();
		 return false;
	}
	var city = $('city').value ; 
	if(city==""){
		$('div_city').show();	
		$('div_city').update('Please Select City.').setStyle({ color: '#FF0000' });	
		$('city').focus();
		 return false;
	}
	var gender = $('gender').value ; 
	if(gender==""){
		$('div_gender').show();	
		$('div_gender').update('Please Select Gender.').setStyle({ color: '#FF0000' });	
		$('gender').focus();
		 return false;
	}
	var degree_level = $('degree_level').value ; 
	if(degree_level==""){
		$('div_degree_level').show();	
		$('div_degree_level').update('Please Select Degree Level.').setStyle({ color: '#FF0000' });	
		$('degree_level').focus();
		 return false;
	}
 	var career_level = $('career_level').value ; 
	if(career_level==""){
		$('div_career_level').show();	
		$('div_career_level').update('Please Select Career Level.').setStyle({ color: '#FF0000' });	
		$('career_level').focus();
		 return false;
	}
  	var experience = $('experience').value ; 
	if(experience==""){
		$('div_experience').show();	
		$('div_experience').update('Please Select Experience.').setStyle({ color: '#FF0000' });	
		$('experience').focus();
		 return false;
	}
	tinyMCE.triggerSave(true,true);
	var description = tinyMCE.getContent();
	if(description==""){
		$('div_description_skill').show();	
		$('div_description_skill').update('Please Enter Description.').setStyle({ color: '#FF0000' });	
		focus();
 		return false;
	}
  	var chk_emp = $('chk_emp').value ; 
	var existing_company = $('existing_company').value ; 
	if(chk_emp=="old"){
		if(existing_company!=""){
			$('div_employeer_msg').show();	
			$('div_employeer_msg').update('Please Select Existing company.').setStyle({ color: '#FF0000' });	
			$('experience').focus();
			 return false;
		}
	}
	if(chk_emp=="new"){
		var username = $('username').value ; 
		if(username!=""){
			$('div_employeer_msg').show();	
			$('div_employeer_msg').update('Please Enter Employeer User Name.').setStyle({ color: '#FF0000' });	
			$('experience').focus();
			 return false;
		}
		var username = $('username').value ; 
		if(username!=""){
			$('div_employeer_msg').show();	
			$('div_employeer_msg').update('Please Enter Employeer User Name.').setStyle({ color: '#FF0000' });	
			$('username').focus();
			 return false;
		}
		var password = $('password').value ; 
		if(password!=""){
			$('div_employeer_msg').show();	
			$('div_employeer_msg').update('Please Enter Employeer Password.').setStyle({ color: '#FF0000' });	
			$('password').focus();
			 return false;
		}
		var email = $('email').value ; 
		if(email!=""){
			$('div_employeer_msg').show();	
			$('div_employeer_msg').update('Please Enter Enter.').setStyle({ color: '#FF0000' });	
			$('email').focus();
			 return false;
		}

		var comp_name = $('comp_name').value ; 
		if(comp_name!=""){
			$('div_employeer_msg').show();	
			$('div_employeer_msg').update('Please Enter Company Name.').setStyle({ color: '#FF0000' });	
			$('comp_name').focus();
			 return false;
		}

		var company_desc = $('company_desc').value ; 
		if(company_desc!=""){
			$('div_employeer_msg').show();	
			$('div_employeer_msg').update('Please Enter Company Description.').setStyle({ color: '#FF0000' });	
			$('company_desc').focus();
			 return false;
		}
 }
}//function
//------------------------------
function validateRefererEmail(){
	$('div_field_validation').hide();	
	var email_to1 = $('email_to1').value ; 
	if(email_to1==""){
		$('div_field_validation').show();	
		$('div_field_validation').update("Enter Friend's Email #1.");
		$('email_to1').focus();
		return false;; 
	}
	if(email_to1!=""){
				if(!email_to1.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #1.");
			    $('email_to1').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to2 = $('email_to2').value ; 
	if(email_to2!=""){
				if(!email_to2.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #2.");
			    $('email_to2').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to3 = $('email_to3').value ; 
	if(email_to3!=""){
				if(!email_to3.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #3.");
			    $('email_to3').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to4 = $('email_to4').value ; 
	if(email_to4!=""){
				if(!email_to4.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #4.");
			    $('email_to4').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to5 = $('email_to5').value ; 
	if(email_to5!=""){
				if(!email_to5.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #5.");
			    $('email_to5').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to6 = $('email_to6').value ; 
	if(email_to6!=""){
				if(!email_to6.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #6.");
			    $('email_to6').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to7 = $('email_to7').value ; 
	if(email_to7!=""){
				if(!email_to7.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #7.");
			    $('email_to7').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to8 = $('email_to8').value ; 
	if(email_to8!=""){
				if(!email_to8.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #8.");
			    $('email_to8').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to9 = $('email_to9').value ; 
	if(email_to9!=""){
				if(!email_to9.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #9.");
			    $('email_to9').focus();
 				return false;; 
			}	
 	}//if email 1
	var email_to10 = $('email_to10').value ; 
	if(email_to10!=""){
				if(!email_to10.isEmail()){
				$('div_field_validation').show();	
			    $('div_field_validation').update("Error ! Invalid Friend's Email #10.");
			    $('email_to10').focus();
 				return false;; 
			}	
 	}//if email 1
	var message = $('message').value ; 
	if(message==""){
 				$('div_field_validation').show();	
			    $('div_field_validation').update("Enter The Message.");
			    $('message').focus();
 				return false;; 
  	}//if email 1
}//function
