/**
 * Javascript for the applcation
 *
 * @package Eureka
 * @version 1.0
 **/
// Need to change... Path
var domainbase ="http://" + window.location.toString().split("//")[1].split("/")[0] + "/";
var site_url = domainbase + "ers/index.php/";
var base_url = domainbase + "ers/";
//var site_url = "http://mindzap.biz/ERSP/index.php/";
//var base_url = "http://mindzap.biz/ERSP/";
//var site_url = "http://192.168.0.1/ERSP/index.php/";
//var base_url = "http://192.168.0.1/ERSP/";
/******************************/
jQuery(document).ready(function() {
	/**
	 * Validate signup form on keyup and submit
	 *
	 */
	jQuery("#signupForm").validate({
		rules: {
			user_name: "required",
			user_email: {
				required: true,
				email: true,
				remote: site_url + "admin/chkmail"
				},
			user_password: {
				required: true,
				minlength: 5
			},
			confirm_password: {
				required: true,
				minlength: 5,
				equalTo: "#user_password"
			},
			user_type: {
				required: true,
				minlength:1
			},
			user_website: {
					url: true
			}
		
		},
		messages: {
			user_name: "Please enter your name",
			user_email: {
				required: "Please enter a valid email address",
				remote: jQuery.format("{0} is already in use")
			},
			user_password: {
				required: "Please provide a password",
				minlength: "Your password must be at least 5 characters long"
			},
			confirm_password: {
				required: "Please provide a password",
				minlength: "Your password must be at least 5 characters long",
				equalTo: "Please enter the same password as above"
			},
			user_type: "Please select atleast one role",
			user_website: "Please enter a valid url"
		},
		submitHandler: function(form) {
			  
     	 var foo = [];
       $('#user_type :selected').each(function(i, selected){
       foo[i] = $(selected).val();
       	});
           $('#user_roles').val(foo);
				jQuery(form).ajaxSubmit({
					target: "#result",
					resetForm: "true",
					 success: function(data) {
					 },
   				  debug:true 
				});
			}
		
	});
	/**
	 * Propose username by combining first- and lastname
	 *
	 */
	jQuery("#username").focus(function() {
		var firstname = jQuery("#firstname").val();
		var lastname = jQuery("#lastname").val();
		if(firstname && lastname && !this.value) {
			this.value = firstname + "." + lastname;
		}
	});
	/**
	 * validate edit users form on keyup and submit
	 *
	 */
	jQuery("#editUserForm").validate({
		rules: {
			user_name: {
				required: true
			},
			user_email: {
				required: true,
				email: true
				},
			user_password: {
				required: true,
				minlength: 5
			},
			confirm_password: {
				required: true,
				minlength: 5,
				equalTo: "#user_password"
			},
			user_type: {
				required: true
			},
			user_website: {
					url: true
			}
		},
		messages: {
			user_name: "Please enter your name",
			user_email: {
				required: "Please enter a valid email address"
			},
			user_password: {
				required: "Please provide a password",
				minlength: "Your password must be at least 5 characters long"
			},
			confirm_password: {
				required: "Please provide a password",
				minlength: "Your password must be at least 5 characters long",
				equalTo: "Please enter the same password as above"
			},
			user_type: "Please select the role",
			user_website: "Please enter a valid url"
			},
		submitHandler: function(form) {
			 var foo = [];
       $('#user_type :selected').each(function(i, selected){
       foo[i] = $(selected).val();
       	});
           $('#user_roles').val(foo);
				jQuery(form).ajaxSubmit({
					target: "#result",
					success: function(data) {
					 },
   				  debug:true 
				});
			}
		
	});
	
});
	/**
	 * Function support Update forget password
	 *
		*/
function func_forgetpwd() {
	var emailaddress = jQuery('#emailaddress').val();
		jQuery.post(site_url + "user/update_forgetpwd", { emailaddress: emailaddress},function(data){
		if(data == 'success'){
				jQuery('#div_err').html('<span style="color:red">Your new password has been activated.Please check your mailbox!</span>');
		 	jQuery('#emailaddress').val("");
		}else{
				jQuery('#div_err').html('<span style="color:red">'+data+'</span>');
		}
		});	
}
	/**
	 * Function support Enterkey press
	 *
		*/
function func_forgotpwdTextboxEnterKey(e) {
	  		var key;     
     if(window.event)
          key = window.event.keyCode; //IE
     else
          key = e.which; //firefox     
					if(key ==13) {
						func_forgetpwd();
					}
					return true;
}
	/**
	 * Function support Admin change password
	 *
		*/
function func_admin_changepassword() {
				 	var old_password		= jQuery('#old_password').val();
					var new_password		= jQuery('#new_password').val();
					var con_password		= jQuery('#con_password').val();
					jQuery.post(site_url +"admin/update_changepassword", { old_password : old_password,new_password :new_password,con_password :con_password},function(data){
			    									if(data=="success"){
			    										jQuery('#div_msg').html('<span style="color:red">Your password has been changed successfully</span>');
			    										//window.location.href = site_url + 'jobseeker/changepassword';
			    									}
			    										else{
			    												jQuery('#div_msg').html('<span style="color:red">'+data+'</span>');
							 		  	 					}
			 });
				
}
/**
	* Function Client change password
	*
	*/
function func_client_changepassword() {
				 	var old_password		= jQuery('#old_password').val();
					var new_password		= jQuery('#new_password').val();
					var con_password		= jQuery('#con_password').val();
					jQuery.post(site_url +"client/update_changepassword", { old_password : old_password,new_password :new_password,con_password :con_password},function(data){
			    									if(data=="success"){
			    										jQuery('#div_msg').html('<span style="color:red">Your password has been changed successfully</span>');
			    										//window.location.href = site_url + 'jobseeker/changepassword';
			    									}
			    										else{
			    												jQuery('#div_msg').html('<span style="color:red">'+data+'</span>');
							 		  	 					}
			 });
				
}
/**
	* Function support Scheduler change password
	*
	*/
function func_scheduler_changepassword() {
				 	var old_password		= jQuery('#old_password').val();
					var new_password		= jQuery('#new_password').val();
					var con_password		= jQuery('#con_password').val();
					jQuery.post(site_url +"scheduler/update_changepassword", { old_password : old_password,new_password :new_password,con_password :con_password},function(data){
			    									if(data=="success"){
			    										jQuery('#div_msg').html('<span style="color:red">Your password has been changed successfully</span>');
			    										//window.location.href = site_url + 'jobseeker/changepassword';
			    									}
			    										else{
			    												jQuery('#div_msg').html('<span style="color:red">'+data+'</span>');
							 		  	 					}
			 });
				
}
/**
	* Function support Interviewer change password
	*
	*/
function func_interviewer_changepassword() {
				 	var old_password		= jQuery('#old_password').val();
					var new_password		= jQuery('#new_password').val();
					var con_password		= jQuery('#con_password').val();
					jQuery.post(site_url +"interviewer/update_changepassword", { old_password : old_password,new_password :new_password,con_password :con_password},function(data){
			    									if(data=="success"){
			    										jQuery('#div_msg').html('<span style="color:red">Your password has been changed successfully</span>');
			    										//window.location.href = site_url + 'jobseeker/changepassword';
			    									}
			    										else{
			    												jQuery('#div_msg').html('<span style="color:red">'+data+'</span>');
							 		  	 					}
			 });
				
}
/**
	* Function support Recruiter change password
	*
	*/
function func_recruiter_changepassword() {
				 	var old_password		= jQuery('#old_password').val();
					var new_password		= jQuery('#new_password').val();
					var con_password		= jQuery('#con_password').val();
					jQuery.post(site_url +"recruiter/update_changepassword", { old_password : old_password,new_password :new_password,con_password :con_password},function(data){
			    									if(data=="success"){
			    										jQuery('#div_msg').html('<span style="color:red">Your password has been changed successfully</span>');
			    										//window.location.href = site_url + 'jobseeker/changepassword';
			    									}
			    										else{
			    												jQuery('#div_msg').html('<span style="color:red">'+data+'</span>');
							 		  	 					}
			 });
					 
}
/**
	* Function support user change password
	*
	*/
function func_user_changepassword() {
				 	var old_password		= jQuery('#old_password').val();
					var new_password		= jQuery('#new_password').val();
					var con_password		= jQuery('#con_password').val();
					jQuery.post(site_url +"user/update_changepassword", { old_password : old_password,new_password :new_password,con_password :con_password},function(data){
			    									if(data=="success"){
			    										jQuery('#div_msg').html('<span style="color:red">Your password has been changed successfully</span>');
			    										//window.location.href = site_url + 'jobseeker/changepassword';
			    									}
			    										else{
			    												jQuery('#div_msg').html('<span style="color:red">'+data+'</span>');
							 		  	 					}
			 });
					 
}
/**
	* Function support checking emailCheck
	*
	*/
function emailCheck (emailStr) {
				var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	    if(reg.test(emailStr) == false) {
	   	      return false;
	   	}else{
	   		return true;
	   	}
	}
	/**
	* Function to call "user/save_requisitionview" save client acess to requisition
	*
	*/
function func_saveclientacess(id) {
		//var reqid		= jQuery('#requisition').val();
		var emailids		= jQuery('#client_emails'+id).val();
		var reqTitle		= jQuery('#reqTitle'+id).val();
		if (!jQuery('#requisitionId'+id).is(':checked'))
		{
		alert("Please choose the requisition");
		}
		else {
			var reqid	 =jQuery('#requisitionId'+id).val();
			jQuery.post(site_url +"user/save_requisitionview", { reqid : reqid,emailids :emailids,reqTitle :reqTitle},function(data){
			    									if(data=="success"){
			    									 alert("Clients added Succussfully!");
			    										}
			    										else if(data=="del"){
			    									 	alert("Clients removed Succussfully!");
			    										}
			    										else{
			    											alert(data)	;
							 		  	 					}
			 });
		}
}
/**
	* Function to change display(Hide/show)
	*
	*/
function changeStyle(id1,id2)
{

	ID = document.getElementById(id1);
	ID1 = document.getElementById(id2);
	if(ID.style.display == "")
	{
		ID.style.display = "none";
	}
	else
	{
		ID.style.display = "";
	}
	
	if(ID1.style.display == "")
	{
		ID1.style.display = "none";
	}
	else
	{
		ID1.style.display = "";
	}
	return true;
}
/**
	* Function to change display(Hide/show)
	*
	*/
function changediv(id)
{
	ID = document.getElementById(id);
	if(ID.style.display == "")
	{
		ID.style.display = "none";
	}
	else
	{
		ID.style.display = "";
	}
	return true;
}
/**
	* Function to Hide Error div
	*
	*/
function hideErrordiv(id)
{
	ID = document.getElementById(id);
	ID.style.display = "none";
	return true;
}
/**
	* Function to Hide a control
	*
	*/
function hidectrl(id)
{
	ID = document.getElementById(id);
	ID.style.display = "none";
	return true;
}
/**
	* Function to Show a control
	*
	*/
function showctrl(id)
{
	ID = document.getElementById(id);
	ID.style.display = "";
	return true;
}
/**
	* Function to delete a Interview template
	*
	*/
function delete_interviewtemplate(interview_tempId){
    			 var res = confirm("Do you want to delete this template?");
    			 if(res){
    					jQuery.post(site_url + "admin/del_interviewtemplate", { interview_tempId: interview_tempId },function(data){
   									if (data == 1) {
    									alert("The selected Template  has been used with an interview can not be deleted");
    									} else {
	    									 if (data ==2) {
	    									 				alert("The selected Template has been deleted successfully !");
    															window.location.href  = site_url +"admin/interviewtemp_list";
	    									 }else {
	    									 	alert("Operation failed. Try again!");
	    									 }
    									 return false;
    								}
					 		   	 
		 	 		  });
    			 }else{
    			 		return false;
    			 }  
 }
 
 /**
	* Function support to delete assigned interview template of a requisition
	*
	*/
function delete_reqtemplate(req_tempId){
    			 var res = confirm("Do you want to remove this assigned interview template?");
    			 if(res){
    					jQuery.post(site_url + "admin/del_reqtemplate", { req_tempId: req_tempId },function(data){
    							
    								if (data == "1") {
    										alert("The assigned interview template has been removed successfully !");
    										window.location.href  = site_url +"admin/list_reqtemplate";
		    							} else {
	    									 if (data ==0) {
	    									 		alert("Operation failed. Try again!");
	    									 }else {
	    									 		alert(data);
	    									 }
    									 return false;
    								}
					 		   	 
		 	 		  });
    			 }else{
    			 		return false;
    			 }  
 }
 /**
	* Function support to Manage requisitions
	*
	*/
 function checkManageReq()
 {
 			// var res = confirm("You have made changes but not saved them");
 			 //var res = confirm("AYou have made changes but not saved them");
    			 //if(res){
 }
 /**
	* Function to set default Interview template
	*
	*/
function setDefault_interviewtemplate(interview_tempId){
    			 var res = confirm("Do you want to set this template as default ?");
    			 if(res){
    					jQuery.post(site_url + "admin/setdefault_interviewtemplate", { interview_tempId: interview_tempId },function(data){
   								
	    									 if (data ==1) {
	    									 					window.location.href  = site_url +"admin/interviewtemp_list";
	    									 }else {
	    									 	alert("Operation failed. Try again!");
	    									 }
    									 return false;
    	 		  });
    			 }else{
    			 		return false;
    			 }  
 }
  /**
	* Function to add comment on candidate profile
	*
	*/
 function func_addProfileComment() {
 	var requisitionId	 =jQuery('#requisitionId').val();
		var candidateId		= jQuery('#candidateId').val();
		var created_at		= jQuery('#created_at').val();
		var comment_body		= jQuery.trim(jQuery('#comment_body').val());
		if (comment_body =="") {
		alert("Please enter your comment");
		return false;
		}
			jQuery.post(site_url +"user/addProfileComment", { requisitionId : requisitionId,candidateId :candidateId,comment_body :comment_body,created_at :created_at},function(data){
			    									if(data=="0"){
			    									alert("Operation failed")
			    										}
			    											else{
			    																jQuery('#comment_body').val('');
			    															jQuery('#div_profcomment').prepend(data);
							 		  	 					}
			 });
		}
/**
	* Function support to delete comment
	*
	*/
function func_delcomment(commentId){
							var comment_id	= commentId;
    			 var res = confirm("Do you want to remove this comment?");
    			 if(res){
    					jQuery.post(site_url + "user/del_comment", { comment_id: comment_id },function(data){
    								if (data == 1) {
    									jQuery('#comment_'+comment_id).remove();
		    							} else {
	    										alert("Operation failed. Try again!");
    									 return false;
    								}
					 		   	 
		 	 		  });
    			 }else{
    			 		return false;
    			 }  
 }
 /**
	* Function support to send mail from feedback form
	*
	*/
function func_sendFeedback() 
{
		var feedback_body		= jQuery.trim(jQuery('#feedback_body').val());
		if (feedback_body =="") {
		jQuery('#div_msg').html("Please enter your feedback");
		return false;
		}
			jQuery.post(site_url +"user/sendFeedback", { feedback_body : feedback_body},function(data){
				jQuery('#div_msg').html('');
			 jQuery('#feedback_body').val('');
				toggleFeedback();
			 });
}

/**
	* Function to delete a News
	*
	*/
function delete_news(newsId){
    			 var res = confirm("Do you want to delete this News?");
    			 if(res){
    					jQuery.post(site_url + "admin/del_news", { newsId: newsId },function(data){
   									 if (data ==1) {
	    									 				alert("The selected News has been deleted successfully !");
    															window.location.href  = site_url +"admin/news_list";
	    									 }else {
	    									 	alert("Operation failed. Try again!");
	    									 }
    									 return false;
	 	 		  });
    			 }else{
    			 		return false;
    			 }  
 }
 /**
	* Function to Update requisition weblink
	*
	*/
 
   function func_saveWeblink(requisitionId){
    			 var res = confirm("Do you want to Create a Weblink?");
    			 if(res){
    					jQuery.post(site_url + "user/save_weblink", { requisitionId: requisitionId },function(data){
   									 if (data =="0") {
	    									 		alert("Operation failed. Try again!");
    										}else {
	    													var str ='<div class="multiple">'+data+'</div><input type="button" size="20" name="bttn_delweblink_'+requisitionId+'" id="bttn_delweblink_'+requisitionId+'" value="Disable" onclick="javascript:func_deleteWeblink('+requisitionId+');">';
    														jQuery('#div_weblink_content_'+requisitionId).html(str);
    														copyclipboardinit();
	    									 }
    									 return false;
	 	 		  });
    			 }else{
    			 		return false;
    			 }  
 } 	
 
 /**
	* Function support to delete weblink
	*
	*/
function func_deleteWeblink(requisitionId){
    			 var res = confirm("Do you want to remove this weblink?");
    			 if(res){
    					jQuery.post(site_url + "user/del_weblink", { requisitionId: requisitionId },function(data){
    							if (data == 1) {
    							jQuery('#div_weblink_content_'+requisitionId).html();
    							var str='<input type="button" size="20" name="bttn_saveweblink_'+requisitionId+'" id="bttn_saveweblink_'+requisitionId+'" value="Create link" onclick="javascript:func_saveWeblink('+requisitionId+');">';
    							jQuery('#div_weblink_content_'+requisitionId).html(str);
    								} else {
	    										alert("Operation failed. Try again!");
    									 return false;
    								}
    								 		   	 
		 	 		  });
    			 }else{
    			 		return false;
    			 }  
 }
  /**
	* Function to add to favorite 
	*
	*/
 function func_addToFavorite(candId,reqId) {
 	var requisitionId	 =reqId;
		var candidateId		= candId;
		 var res = confirm("Do you want to add to favorite?");
   if(res){
								jQuery.post(site_url +"user/addFavorite", { requisitionId : requisitionId,candidateId :candidateId},function(data){
								    									if(data=="0"){
								    									alert("Operation failed");
								    									 return false;
								    										}
								    											else{
								    															alert(data);
												 		  	 					}
								 });
			 	 }else{
    			 		return false;
    			 }  
		}
	/**
	* Function to implement user ratings on the profile page
	* when a user roles over a rating bar in the match,
	* they can change the rating by moving their mouse (javascript highlights position) and clicking
	*/
		function func_update_matchrate(clsgraph,newrate,orginalrate,candid,reqid,ratecat,divid)
		{
				var candidateId=candid;
				var requisitionId	= reqid;
				var rate_category	=ratecat;
				var graph_num	='';
				if (newrate <10){
					 graph_num = "0"+newrate;
				}
				else{
				  graph_num = newrate;
				}
				jQuery.post(site_url + "user/update_matchrating", { requisitionId: requisitionId,candidateId :candidateId, rate :newrate,rate_category :rate_category },function(data){
				if (data =="0") {
				  alert("Operation failed. Try again!");
				}else {
						jQuery("#"+divid).removeClass(clsgraph);
						jQuery("#"+divid).removeClass("gHover");
						jQuery("#"+divid).addClass("graph g"+graph_num);
						var str	= '<ul><li class="gr00"><i>'+newrate+'</i></li><li><a href="javascript:void(null);" class="gr01" title="1/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,1,'+orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>1</i></a></li><li><a href="javascript:void(null);" class="gr02" title="2/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,2,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>2</i></a></li><li><a href="javascript:void(null);" class="gr03" title="3/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,3,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>3</i></a></li><li><a href="javascript:void(null);" class="gr04" title="4/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,4,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>4</i></a></li><li><a href="javascript:void(null);" class="gr05" title="5/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,5,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>5</i></a></li><li><a href="javascript:void(null);" class="gr06" title="6/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,6,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>6</i></a></li><li><a href="javascript:void(null);" class="gr07" title="7/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,7,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>7</i></a></li><li><a href="javascript:void(null);" class="gr08" title="8/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,8,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>8</i></a></li><li><a href="javascript:void(null);" class="gr09" title="9/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,9,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>9</i></a></li><li><a href="javascript:void(null);" class="gr10" title="10/10" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,10,' +orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>10</i></a></li>';
						if (newrate >0){
						str	 +='<li><a href="javascript:void(null);" class="grXX" title="Undo" onclick="javascript:func_update_matchrate(&quot;gragh g'+graph_num+'&quot;,'+orginalrate+','+orginalrate+','+candidateId+',' +requisitionId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>undo</i></a></li>';
						}
						str	 +='</ul>';
						jQuery("#"+divid).html(str);
				}
				return false;
				});
		}
			/**
	* Function to implement user ratings on the profile page
	* when a user roles over a rating bar in the interview match section,
	* they can change the rating by moving their mouse (javascript highlights position) and clicking
	*/
		function func_update_interviewrate(clsgraph,newrate,orginalrate,candid,ratecat,divid)
		{
					var candidateId=candid;
					var rate_category	=ratecat;
					var graph_num	='';
					if (newrate <10){
					  graph_num = "0"+newrate;
					}
					else{
					  graph_num = newrate;
					}
					jQuery.post(site_url + "user/update_interviewrating", {candidateId :candidateId, rate :newrate,rate_category :rate_category },function(data){
							if (data =="0") {
							  return false;
							}else {
									jQuery("#"+divid).removeClass(clsgraph);
									jQuery("#"+divid).removeClass("gHover");
									jQuery("#"+divid).addClass("graph g"+graph_num);
									var str	= '<ul><li class="gr00"><i>'+newrate+'</i></li><li><a href="javascript:void(null);" class="gr01" title="1/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,1,'+candidateId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>1</i></a></li><li><a href="javascript:void(null);" class="gr02" title="2/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,2,' +candidateId+',&quot;'+rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>2</i></a></li><li><a href="javascript:void(null);" class="gr03" title="3/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,3,' +candidateId+',&quot;'+rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>3</i></a></li><li><a href="javascript:void(null);" class="gr04" title="4/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,4,' +candidateId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>4</i></a></li><li><a href="javascript:void(null);" class="gr05" title="5/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,5,' +candidateId+',&quot;'+rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>5</i></a></li><li><a href="javascript:void(null);" class="gr06" title="6/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,6,' +candidateId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>6</i></a></li><li><a href="javascript:void(null);" class="gr07" title="7/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,7,' +candidateId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>7</i></a></li><li><a href="javascript:void(null);" class="gr08" title="8/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,8,' +candidateId+',&quot;'+rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>8</i></a></li><li><a href="javascript:void(null);" class="gr09" title="9/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,9,' +candidateId+',&quot;'+rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>9</i></a></li><li><a href="javascript:void(null);" class="gr10" title="10/10" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,10,' +candidateId+',&quot;'+rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>10</i></a></li>';
									if (newrate >0){
									str	 +='<li><a href="javascript:void(null);" class="grXX" title="Undo" onclick="javascript:func_update_interviewrate(&quot;gragh g'+graph_num+'&quot;,'+orginalrate+','+orginalrate+','+candidateId+',&quot;' +rate_category+'&quot;,&quot;' +divid+'&quot;);"><i>undo</i></a></li>';
									}
									str	 +='</ul>';
									jQuery("#"+divid).html(str);
							}
					return false;
					});
		}