var invalidImageUrl = base_url+"images/arrow.png";

var invalidImage = '<img src="'+invalidImageUrl+'"> &nbsp;'; 
invalidImage='';
var global=1;
var global1=0;
var global2=1;
var global3=1;
function checkAllValidation()
{
	var validateAllFlag = 0;
	
	var fname=$('#FNameText').val();
	if ($.trim($('#FNameText').val()) == "" || $.trim($('#FNameText').val()) == "First Name")
	{
		$("#FNameTextError").hide().html(invalidImage+"Enter your First Name").show("slow");
		validateAllFlag=1;
	}
	else
	{
		var re_digit=/^([a-zA-Z])+$/;
		if (!re_digit.test($.trim($('#FNameText').val()))) 
		{
			$("#FNameTextError").hide().html(invalidImage+"Enter appropriate name").show("slow");
			validateAllFlag=1;
		 
		}
		else
		{
			if(fname.length>20)
			{
				$("#FNameTextError").hide().html(invalidImage+"Maximum Length is 20").show("slow");
				validateAllFlag=1;
			}
			else
			{
				$("#FNameTextError").html("");
		
			}	
		}
		
	}
	var lname=$('#LNameText').val();
	if ($.trim($('#LNameText').val()) == "" || $.trim($('#LNameText').val()) == "Last Name")
	{
		$("#LNameTextError").hide().html(invalidImage+"Enter your Last Name").show("slow");
		validateAllFlag=1;
		 
	}
	else
	{
		var re_digit=/^([a-zA-Z])+$/;
		if (!re_digit.test($.trim($('#LNameText').val()))) 
		{
			$("#LNameTextError").hide().html(invalidImage+"Enter appropriate name").show("slow");
			validateAllFlag=1;
		   
		}
		else
		{
			if(lname.length>15)
			{
				$("#LNameTextError").hide().html(invalidImage+"Maximum Length is 15").show("slow");
				validateAllFlag=1;
			}
			else
			{
				$("#LNameTextError").html("");

			}	
		}
		
	}
	var mname=$('#MNameText').val();
	if ($.trim($('#MNameText').val()) == "" || $.trim($('#MNameText').val()) == "Middle Name")
	{
		//$("#MNameTextError").hide().html(invalidImage+"Enter your Middle Name").show("slow");
		//validateAllFlag=1;
		
	}
	else
	{
		var re_digit=/^([a-zA-Z])+$/;
		if (!re_digit.test($.trim($('#MNameText').val()))) 
		{
			$("#MNameTextError").hide().html(invalidImage+"Enter appropriate name").show("slow");
			validateAllFlag=1;
		   
		}
		else
		{
			if(mname.length>15)
			{
				$("#MNameTextError").hide().html(invalidImage+"Maximum Length is 15").show("slow");
				validateAllFlag=1;
			}
			else
			{
				$("#MNameTextError").html("");

			}		
		}
		
	}

								
	if($('#tr_salary').css('display')=='block' && $('#tr_notice').css('display')=='block')
	{

								
		if ($.trim($('#notice').val()) == "" || $.trim($('#notice').val()) == "Notice Period")
		{
			$("#noticeTextError").hide().html(invalidImage+"Enter Notice Period").show("slow");
			validateAllFlag=1;
		}
		else
		{
	
			var reg = /^[0-9]*$/;
			if (!reg.test($.trim($('#notice').val()))) 
			{
				$("#notice").focus();
				$("#noticeTextError").hide().html(invalidImage+"Enter valid Notice Period").show("slow");
				validateAllFlag=1;
			}
			else
			{
				$("#noticeTextError").html("");
			}	
			
		}
		if ($.trim($('#salary').val()) == "" || $.trim($('#salary').val()) == "Salary")
		{
			$("#salaryTextError").hide().html(invalidImage+"Enter Salary").show("slow");
			validateAllFlag=1;
		}
		else
		{
	
			var reg = /^[0-9,]*$/;
			if (!reg.test($.trim($('#salary').val()))) 
			{
				$("#salary").focus();
				$("#salaryTextError").hide().html(invalidImage+"Enter valid Salary").show("slow");
				validateAllFlag=1;
			}
			else
			{
				$("#salaryTextError").html("");
	
			}	
			
		}
	}

	var emailId=$('#emailIdText').val();
	if ($.trim($('#emailIdText').val()) == "" || $.trim($('#emailIdText').val()) == "Email Address")
	{
		$("#emailIdTextError").hide().html(invalidImage+"Enter Email Address").show("slow");
		validateAllFlag=1;
	}
	else
	{
		var re_mail = /^(([\w-]{1,})+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (!re_mail.test($.trim($('#emailIdText').val()))) 
		{
			$("#emailIdTextError").hide().html(invalidImage+"Enter valid Email Address").show("slow");
			validateAllFlag=1;
		}
		else
		{
			
			var base = base_url+'careers/checkemailAvailability';
			$.post(base,{emailId: $('#emailIdText').val()},function(data){
				if (data == 0)
				{
					$("#emailIdTextError").html("");
					
				}
				else
				{	
					$('#emailIdTextError').css('color', '#FF0000');
					$("#emailIdTextError").hide().html(invalidImage+"Email Id Already Exist").show("slow");
					validateAllFlag=1;
					
				}
			});
		}
			
	}

	
	if ($('#mobileNo').val() == "" || $('#mobileNo').val() == "Mobile Number")
	{
		$("#mobileNoError").hide().html(invalidImage+"Enter Mobile Number").show("slow");
		validateAllFlag=1;
	}
	else
	{
		var re_mobileNo = /^[9,8,7]\d{9}$/;
		if (!re_mobileNo.test($.trim($('#mobileNo').val()))) 
		{
			$("#mobileNo").focus();
			$("#mobileNoError").hide().html(invalidImage+"Enter valid Mobile Number").show("slow");
			validateAllFlag=1;
		}
		else
		{
			var base = base_url+'careers/checkmobileNoAvailability';
			$.post(base,{mobileNo: $('#mobileNo').val()},function(data){
				if (data == 0)
				{
					$("#mobileNoError").html("");
					
				}
				else
				{	
					$('#mobileNoError').css('color', '#FF0000');
					$("#mobileNoError").hide().html(invalidImage+"Mobile Number is not available.").show("slow");
					validateAllFlag=1;
					
				}
			});
				
			

		}	
	}

	if ($('#phoneNo').val() == "" || $('#phoneNo').val() == "Landline Number")
	{
		//$("#phoneNoError").hide().html(invalidImage+"Enter Mobile Number").show("slow");
		//validateAllFlag=1;
		$("#phoneNoError").html("");
	}
	else
	{
		var re_phoneNo = /^[0-9-]*$/;
		if (!re_phoneNo.test($.trim($('#phoneNo').val()))) 
		{
			$("#phoneNo").focus();
			$("#phoneNoError").hide().html(invalidImage+"Enter valid Landline Number").show("slow");
			validateAllFlag=1;
		}
		else
		{
			$("#phoneNoError").html("");

		}	
	}



							
	var address=$.trim($('#address').val());
	if ($.trim($('#address').val()) == "" || $.trim($('#address').val()) == "Postal Address")
	{
		$("#addressTextError").hide().html(invalidImage+"Enter your Address").show("slow");
		validateAllFlag=1;
	}
	else
	{
		$("#addressTextError").html("");

	}


							
	if ($.trim($('#pincode').val()) == "" || $.trim($('#pincode').val()) == "Pincode Number")
	{
		$("#pincodeTextError").hide().html(invalidImage+"Enter Pincode").show("slow");
		//$("#pincodeTextError").html("");
		validateAllFlag=1;
	}
	else
	{

		var reg = /^[0-9]*$/;
		if (!reg.test($.trim($('#pincode').val()))) 
		{
			$("#pincode").focus();
			$("#pincodeTextError").hide().html(invalidImage+"Enter valid Pincode").show("slow");
			validateAllFlag=1;
		}
		else
		{
			$("#pincodeTextError").html("");
		}	
		
	}



	if ($.trim($('#city').val()) == "" || $.trim($('#city').val()) == "City")
	{
		$("#cityError").hide().html(invalidImage+"Enter your City").show("slow");
		validateAllFlag=1;
	}
	else
	{
		var re_digit = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
		if (!re_digit.test($.trim($('#city').val()))) 
		{
			$("#cityError").hide().html(invalidImage+"Enter appropriate city").show("slow");
			validateAllFlag=1;
		}
		else
		{
			$("#cityError").html("");

		}
		
	}
	 



	if ($.trim($('#state').val()) == "" || $.trim($('#state').val()) == "State")
	{
		$("#stateError").hide().html(invalidImage+"Enter your State").show("slow");
		validateAllFlag=1;
	}
	else
	{
		var re_digit = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
		if (!re_digit.test($.trim($('#state').val()))) 
		{
			$("#stateError").hide().html(invalidImage+"Enter appropriate state").show("slow");
			validateAllFlag=1;
		}
		else
		{
			$("#stateError").html("");

		}
		
	}
	 



	if ($.trim($('#country').val()) == "" || $.trim($('#country').val()) == "Country")
	{
		$("#countryError").hide().html(invalidImage+"Enter your Country").show("slow");
		validateAllFlag=1;
	}
	else
	{
		var re_digit = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
		if (!re_digit.test($.trim($('#country').val()))) 
		{
			$("#countryError").hide().html(invalidImage+"Enter appropriate country").show("slow");
			validateAllFlag=1;
		}
		else
		{
			$("#countryError").html("");

		}
		
	}
	 

	if ($.trim($('#age').val()) == ""  || $.trim($('#age').val()) == "Age")
	{
		$("#ageTextError").hide().html(invalidImage+"Enter Age").show("slow");
		validateAllFlag=1;
	}
	else
	{

		var reg = /^[0-9]*$/;
		if (!reg.test($.trim($('#age').val()))) 
		{
			$("#age").focus();
			$("#ageTextError").hide().html(invalidImage+"Enter valid Age").show("slow");
			validateAllFlag=1;
		}
		else
		{
			$("#ageTextError").html("");

		}	
		
	}
	
	if($('#userfile').val()!='')
	{
		var fileName = $('#userfile').val();
		var arr = fileName.split(".");
		var extension = $.trim(arr[1]);
		if (  extension.toString() == "jpg" || extension.toString() == "png" || extension.toString() == "gif" || extension.toString() == "JPG" || extension.toString() == "PNG" || extension.toString() == "GIF")
	   {
			$("#userfileTextError").html("");
	   }
	   else
	   {	
			$("#userfileTextError").hide().html(invalidImage+"Please upload valid format of file").show("slow");
			validateAllFlag = 1;
	   }
	}
	if($('#resume').val()!='')
	{
		var fileName = $('#resume').val();
		var arr = fileName.split(".");
		var extension = $.trim(arr[1]);
		if (  extension.toString() == "doc" || extension.toString() == "docx" || extension.toString() == "rtf")
	   {
			$("#resumeTextError").html("");
	   }
	   else
	   {	
			$("#resumeTextError").hide().html(invalidImage+"Please upload valid format of file").show("slow");
			validateAllFlag = 1;
	   }
	}
	$("input[id^='skillName_s_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Skill Name" )
		{
			$("#skillNameTextError_s_"+id).hide().html(invalidImage+"Enter Skill Name").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#skillNameTextError_s_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#skillNameTextError_s_"+id).html("");
			}
		}
	});
	
	$("select[id^='expMonth_s_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($(this).val() == -1 && $('#expYear_s_'+id).val() == -1)
		{
			$("#expTextError_s_"+id).hide().html(invalidImage+"Enter Experience").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			$("#expTextError_s_"+id).html("");
		}
	});
	$("select[id^='expYear_s_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($(this).val() == -1 && $('#expMonth_s_'+id).val() == -1)
		{
			$("#expTextError_s_"+id).hide().html(invalidImage+"Enter Experience").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			$("#expTextError_s_"+id).html("");
		}
	});
	
	$("input[id^='insName_e_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Institute Name")
		{
			$("#insNameTextError_e_"+id).hide().html(invalidImage+"Enter your Institute Name").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#insNameTextError_e_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#insNameTextError_e_"+id).html("");
			}
		}
	});
	$("input[id^='degree_e_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Degree Name")
		{
			//$("#degreeTextError_e_"+id).hide().html(invalidImage+"Enter your Degree Name").show("slow");
			//validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#degreeTextError_e_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#degreeTextError_e_"+id).html("");
			}
		}
	});
	$("input[id^='course_e_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Course Name")
		{
			$("#courseTextError_e_"+id).hide().html(invalidImage+"Enter your Course Name").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#courseTextError_e_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#courseTextError_e_"+id).html("");
			}
		}
	});
	$("input[id^='location_e_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Location")
		{
			$("#locationTextError_e_"+id).hide().html(invalidImage+"Enter your Location").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#locationTextError_e_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#locationTextError_e_"+id).html("");
			}
		}
	});
										
	$("input[id^='percentage_e_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Percentage / Grade")
		{
			$("#percentageTextError_e_"+id).hide().html(invalidImage+"Enter your Percentage / Grade").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z0-9][\w\ .%+-]*[a-zA-Z0-9]*$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#percentageTextError_e_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#percentageTextError_e_"+id).html("");
			}
		}
	});
	$("select[id^='fromYear_e_']").each(function(event){
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			validateAllFlag = 1;
		}
		else if (parseInt($('#fromMonth_e_'+id).val()) != 0 && parseInt($(this).val()) != 0)
		{
			$("#fromTextError_e_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#fromMonth_e_'+id).val()) == 0)
			{
				$("#fromTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#fromTextError_e_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && parseInt($('#fromMonth_e_'+id).val()) != 0 && parseInt($('#toYear_e_'+id).val()) != 0 && parseInt($('#toMonth_e_'+id).val()) != 0)
		{
			if(parseInt($(this).val())!=parseInt($('#toYear_e_'+id).val()))
			{
				
				if(parseInt($(this).val()) > parseInt($('#toYear_e_'+id).val()))
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_e_'+id).val()) >= parseInt($('#toMonth_e_'+id).val()) )
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
		}
	
	});
	$("select[id^='fromMonth_e_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if (parseInt($(this).val()) == 0)
		{

			$("#fromTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
			validateAllFlag = 1;
		}
		else if (parseInt($(this).val()) != 0 && $('#fromYear_e_'+id).val() != 0)
		{
			$("#fromTextError_e_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if ($('#fromYear_e_'+id).val() == 0)
			{
				$("#fromTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#fromTextError_e_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_e_'+id).val() != 0 && parseInt($('#toYear_e_'+id).val()) != 0 && parseInt($('#toMonth_e_'+id).val()) != 0)
		{
		
			if($('#fromYear_e_'+id).val()!=parseInt($('#toYear_e_'+id).val()))
			{
				
				if($('#fromYear_e_'+id).val() > parseInt($('#toYear_e_'+id).val()))
				{
					
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
			else
			{
				if(parseInt($(this).val()) >= parseInt($('#toMonth_e_'+id).val()))
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
		}
	
		});
	$("select[id^='toYear_e_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#toTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			validateAllFlag = 1;
		}
		else if ($('#toMonth_e_'+id) != 0 && parseInt($(this).val()) != 0)
		{
			$("#toTextError_e_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#toMonth_e_'+id).val()) == 0)
			{
				$("#toTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#toTextError_e_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_e_'+id).val() != 0 && parseInt($('#fromMonth_e_'+id).val()) != 0 && parseInt($('#toMonth_e_'+id).val()) != 0)
		{
			if($('#fromYear_e_'+id).val()!=parseInt($(this).val()))
			{
				if($('#fromYear_e_'+id).val() > parseInt($(this).val()))
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_e_'+id).val()) >= parseInt($('#toMonth_e_'+id).val()))
				{

					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
		}
	
	});
	$("select[id^='toMonth_e_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
	
		if (parseInt($(this).val()) == 0)
		{
			$("#toTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
			validateAllFlag = 1;
		}
		else if (parseInt($(this).val()) != 0 && parseInt($('#toYear_e_'+id).val()) != 0)
		{
			$("#toTextError_e_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#toYear_e_'+id).val()) == 0)
			{
				$("#toTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#toTextError_e_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_e_'+id).val() != 0 && parseInt($('#fromMonth_e_'+id).val()) != 0 && parseInt($('#toYear_e_'+id).val()) != 0)
		{
			if($('#fromYear_e_'+id).val()!= parseInt($('#toYear_e_'+id).val()))
			{
				if($('#fromYear_e_'+id).val() > parseInt($('#toYear_e_'+id).val()))
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_e_'+id).val()) >= parseInt($(this).val()))
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
		}
	
	});
	$("input[id^='empName_w_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Employer Name")
		{
			$("#empNameTextError_w_"+id).hide().html(invalidImage+"Enter Employer Name").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#empNameTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#empNameTextError_w_"+id).html("");
			}
		}
	});

	$("input[id^='location_w_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Work Location")
		{
			$("#locationTextError_w_"+id).hide().html(invalidImage+"Enter Work Location").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#locationTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#locationTextError_w_"+id).html("");
			}
		}
	});

	$("input[id^='jobrole_w_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Job Role")
		{
			$("#jobroleTextError_w_"+id).hide().html(invalidImage+"Enter Job Role").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#jobroleTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#jobroleTextError_w_"+id).html("");
			}
		}
	});
		$("select[id^='fromYear_w_']").each(function(event){
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			validateAllFlag = 1;
		}
		else if (parseInt($('#fromMonth_w_'+id).val()) != 0 && parseInt($(this).val()) != 0)
		{
			$("#fromTextError_w_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#fromMonth_w_'+id).val()) == 0)
			{
				$("#fromTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#fromTextError_w_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && parseInt($('#fromMonth_w_'+id).val()) != 0 && parseInt($('#toYear_w_'+id).val()) != 0 && parseInt($('#toMonth_w_'+id).val()) != 0)
		{
			if(parseInt($(this).val())!=parseInt($('#toYear_w_'+id).val()))
			{
				
				if(parseInt($(this).val()) > parseInt($('#toYear_w_'+id).val()))
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_w_'+id).val()) >= parseInt($('#toMonth_w_'+id).val()) )
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
		}
	
	});
	$("select[id^='fromMonth_w_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if (parseInt($(this).val()) == 0)
		{

			$("#fromTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
			validateAllFlag = 1;
		}
		else if (parseInt($(this).val()) != 0 && $('#fromYear_w_'+id).val() != 0)
		{
			$("#fromTextError_w_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if ($('#fromYear_w_'+id).val() == 0)
			{
				$("#fromTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#fromTextError_w_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_w_'+id).val() != 0 && parseInt($('#toYear_w_'+id).val()) != 0 && parseInt($('#toMonth_w_'+id).val()) != 0)
		{
		
			if($('#fromYear_w_'+id).val()!=parseInt($('#toYear_w_'+id).val()))
			{
				
				if($('#fromYear_w_'+id).val() > parseInt($('#toYear_w_'+id).val()))
				{
					
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
			else
			{
				if(parseInt($(this).val()) >= parseInt($('#toMonth_w_'+id).val()))
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
		}
	
		});
	$("select[id^='toYear_w_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#toTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			validateAllFlag = 1;
		}
		else if ($('#toMonth_w_'+id) != 0 && parseInt($(this).val()) != 0)
		{
			$("#toTextError_w_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#toMonth_w_'+id).val()) == 0)
			{
				$("#toTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#toTextError_w_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_w_'+id).val() != 0 && parseInt($('#fromMonth_w_'+id).val()) != 0 && parseInt($('#toMonth_w_'+id).val()) != 0)
		{
			if($('#fromYear_w_'+id).val()!=parseInt($(this).val()))
			{
				if($('#fromYear_w_'+id).val() > parseInt($(this).val()))
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_w_'+id).val()) >= parseInt($('#toMonth_w_'+id).val()))
				{

					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
		}
	
	});
	$("select[id^='toMonth_w_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
	
		if (parseInt($(this).val()) == 0)
		{
			$("#toTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
			validateAllFlag = 1;
		}
		else if (parseInt($(this).val()) != 0 && parseInt($('#toYear_w_'+id).val()) != 0)
		{
			$("#toTextError_w_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#toYear_w_'+id).val()) == 0)
			{
				$("#toTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#toTextError_w_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_w_'+id).val() != 0 && parseInt($('#fromMonth_w_'+id).val()) != 0 && parseInt($('#toYear_w_'+id).val()) != 0)
		{
			if($('#fromYear_w_'+id).val()!= parseInt($('#toYear_w_'+id).val()))
			{
				if($('#fromYear_w_'+id).val() > parseInt($('#toYear_w_'+id).val()))
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_w_'+id).val()) >= parseInt($(this).val()))
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
		}
	
	});
	$("input[id^='projName_p_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Project Name")
		{
			$("#projNameTextError_p_"+id).hide().html(invalidImage+"Enter Project Name").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#projNameTextError_p_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#projNameTextError_p_"+id).html("");
			}
		}
	});
	
	$("input[id^='yourrole_p_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Your Role")
		{
			$("#yourroleTextError_p_"+id).hide().html(invalidImage+"Enter Your Role").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#yourroleTextError_p_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#yourroleTextError_p_"+id).html("");
			}
		}
	});
	$("select[id^='fromYear_p_']").each(function(event){
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			validateAllFlag = 1;
		}
		else if (parseInt($('#fromMonth_p_'+id).val()) != 0 && parseInt($(this).val()) != 0)
		{
			$("#fromTextError_p_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#fromMonth_p_'+id).val()) == 0)
			{
				$("#fromTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#fromTextError_p_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && parseInt($('#fromMonth_p_'+id).val()) != 0 && parseInt($('#toYear_p_'+id).val()) != 0 && parseInt($('#toMonth_p_'+id).val()) != 0)
		{
			if(parseInt($(this).val())!=parseInt($('#toYear_p_'+id).val()))
			{
				
				if(parseInt($(this).val()) > parseInt($('#toYear_p_'+id).val()))
				{
					
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_p_'+id).val()) >= parseInt($('#toMonth_p_'+id).val()) )
				{
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
		}
	
	});
	$("select[id^='fromMonth_p_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
			validateAllFlag = 1;
		}
		else if (parseInt($(this).val()) != 0 && $('#fromYear_p_'+id).val() != 0)
		{
			$("#fromTextError_p_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if ($('#fromYear_p_'+id).val() == 0)
			{
				$("#fromTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#fromTextError_p_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_p_'+id).val() != 0 && parseInt($('#toYear_p_'+id).val()) != 0 && parseInt($('#toMonth_p_'+id).val()) != 0)
		{
		
			if($('#fromYear_p_'+id).val()!=parseInt($('#toYear_p_'+id).val()))
			{
				
				if($('#fromYear_p_'+id).val() > parseInt($('#toYear_p_'+id).val()))
				{
					
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
			else
			{

				if(parseInt($(this).val()) >= parseInt($('#toMonth_p_'+id).val()))
				{
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
		}
	
		});
	$("select[id^='toYear_p_']").each(function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#toTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			validateAllFlag = 1;
		}
		else if ($('#toMonth_p_'+id) != 0 && parseInt($(this).val()) != 0)
		{
			$("#toTextError_p_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#toMonth_p_'+id).val()) == 0)
			{
				$("#toTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#toTextError_p_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_p_'+id).val() != 0 && parseInt($('#fromMonth_p_'+id).val()) != 0 && parseInt($('#toMonth_p_'+id).val()) != 0)
		{
			if($('#fromYear_p_'+id).val()!=parseInt($(this).val()))
			{
				if($('#fromYear_p_'+id).val() > parseInt($(this).val()))
				{
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_p_'+id).val()) >= parseInt($('#toMonth_p_'+id).val()))
				{

					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					validateAllFlag = 1;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
		}
	
});
$("select[id^='toMonth_p_']").each(function(event){
	
	var str=$(this).attr('id');
	var a=str.split("_");
	var id=a[2];

	if (parseInt($(this).val()) == 0)
	{
		$("#toTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
		validateAllFlag = 1;
	}
	else if (parseInt($(this).val()) != 0 && parseInt($('#toYear_p_'+id).val()) != 0)
	{
		$("#toTextError_p_"+id).html("");
	}
	else if(parseInt($(this).val()) != 0)
	{
		if (parseInt($('#toYear_p_'+id).val()) == 0)
		{
			$("#toTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			$("#toTextError_p_"+id).html("");
		}
	}
	if (parseInt($(this).val()) != 0 && parseInt($('#toYear_p_'+id).val()) != 0 && parseInt($('#fromMonth_p_'+id).val())!= 0 && parseInt($('#toYear_p_'+id).val()) != 0)
	{
		if(parseInt($('#fromYear_p_'+id).val())!= parseInt($('#toYear_p_'+id).val()))
		{
			if(parseInt($('#fromYear_p_'+id).val()) > parseInt($('#toYear_p_'+id).val()))
			{
				$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#toTextError_p_"+id).html("");
			}
		}
		else
		{
			if(parseInt($('#fromMonth_p_'+id).val())>= parseInt($(this).val()))
			{
				$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#toTextError_p_"+id).html("");
			}
		}
	}
	
	});
	$("input[id^='skillUsed_p_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Skills Used")
		{
			$("#skillUsedTextError_p_"+id).hide().html(invalidImage+"Enter Skills").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. ,-]*[a-zA-Z]$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#skillUsedTextError_p_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#skillUsedTextError_p_"+id).html("");
			}
		}
	});
	
	$("textarea[id^='responsibility_p_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Your Responsibility")
		{
			$("#responsibilityTextError_p_"+id).hide().html(invalidImage+"Enter Responsibilities").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. ,-]*[a-zA-Z]$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#responsibilityTextError_p_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#responsibilityTextError_p_"+id).html("");
			}
		}
	});
	
	$("input[id^='skillUsed_w_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Skills Used")
		{
			$("#skillUsedTextError_w_"+id).hide().html(invalidImage+"Enter Skills").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. ,-]*[a-zA-Z]$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#skillUsedTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#skillUsedTextError_w_"+id).html("");
			}
		}
	});
	
	$("textarea[id^='responsibility_w_']").each(function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "" || $.trim($(this).val()) == "Your Responsibility")
		{
			$("#responsibilityTextError_w_"+id).hide().html(invalidImage+"Enter Responsibilities").show("slow");
			validateAllFlag = 1;
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. ,-]*[a-zA-Z]$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#responsibilityTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				validateAllFlag = 1;
			}
			else
			{
				$("#responsibilityTextError_w_"+id).html("");
			}
		}
	});
	if($('#captchaText').val()=='')
	{
		$("#captchaTextError").hide().html(invalidImage+"Please Enter Captcha").show("slow");
		validateAllFlag = 1;
	}
	else
	{
		$("#captchaTextError").html("").show("slow");
	}
	
	
	if (validateAllFlag == 1)
	{
		return false;
	}
	else
	{
		$("#loader3").css("display","block");	
		return true;
	}
}
$(document).ready(function(){


	/*
	$(".successMessage").fadeOut(3000);
	$(".failureMessage").fadeOut(3000);*/
	
	$('#emailIdText').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Email Address")
		{
			$(this).attr("value","");
		}
    });
	$('#emailIdText').live("blur",function(){
		var emailId=$('#emailIdText').val();
		
		if ($.trim($('#emailIdText').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Email Address");
			$("#emailIdTextError").hide().html(invalidImage+"Enter Email Address").show("slow");
		}
		else
		{
			var re_mail = /^(([\w-]{1,})+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
			if (!re_mail.test($.trim($('#emailIdText').val()))) 
			{
				$("#emailIdTextError").hide().html(invalidImage+"Enter valid Email Address").show("slow");
			}
			else
			{
				var base = base_url+'careers/checkemailAvailability';
				$.post(base,{emailId: $('#emailIdText').val()},function(data){
					if (data == 0)
					{
						$("#emailIdTextError").html("");
						return ;
					}
					else
					{	
						$('#emailIdTextError').css('color', '#FF0000');
						$("#emailIdTextError").hide().html(invalidImage+"Email Id Already Exist").show("slow");
						return ;
					}
				});
				
			}	
		}
		 
	});
	$('#FNameText').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="First Name")
		{
			$(this).attr("value","");
		}
    });
	$('#FNameText').live("blur",function(){
		var fname=$.trim($('#FNameText').val());
		
		if ($.trim($('#FNameText').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","First Name");
			$("#FNameTextError").hide().html(invalidImage+"Enter your First Name").show("slow");
			return ; 
		}
		else
		{
			var re_digit=/^([a-zA-Z])+$/;
			if (!re_digit.test($.trim($('#FNameText').val()))) 
			{
				$("#FNameTextError").hide().html(invalidImage+"Enter appropriate name").show("slow");
			    return ; 
			}
			else
			{
				if(fname.length>20)
				{
					
					$("#FNameTextError").hide().html(invalidImage+"Maximum Length is 20").show("slow");
				    return ; 
				}
				else
				{
					$("#FNameTextError").html("");

				}		
			}
			
		}
		 
	});
	$('#LNameText').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Last Name")
		{
			$(this).attr("value","");
		}
    });
	$('#LNameText').live("blur",function(){
		var lname=$.trim($('#LNameText').val());
		if ($.trim($('#LNameText').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Last Name");
			$("#LNameTextError").hide().html(invalidImage+"Enter your Last Name").show("slow");
			return ; 
		}
		else
		{
			var re_digit=/^([a-zA-Z])+$/;
			if (!re_digit.test($.trim($('#LNameText').val()))) 
			{
				$("#LNameTextError").hide().html(invalidImage+"Enter appropriate name").show("slow");
			    return ; 
			}
			else
			{
				if(lname.length>15)
				{
					$("#LNameTextError").hide().html(invalidImage+"Maximum Length is 15").show("slow");
				    return ; 
				}
				else
				{
					$("#LNameTextError").html("");

				}		
			}
			
		}
		 
	});
	$('#MNameText').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Middle Name")
		{
			$(this).attr("value","");
		}
    });
	$('#MNameText').live("blur",function(){
		var mname=$.trim($('#MNameText').val());
		if ($.trim($('#MNameText').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Middle Name");
			//$("#MNameTextError").hide().html(invalidImage+"Enter your Middle Name").show("slow");
			//return ; 
		}
		else
		{
			var re_digit=/^([a-zA-Z])+$/;
			if (!re_digit.test($.trim($('#MNameText').val()))) 
			{
				$("#MNameTextError").hide().html(invalidImage+"Enter appropriate name").show("slow");
			    return ; 
			}
			else
			{
				if(mname.length>15)
				{
					$("#MNameTextError").hide().html(invalidImage+"Maximum Length is 15").show("slow");
				    return ; 
				}
				else
				{
					$("#MNameTextError").html("");

				}		
			}
			
		}
	});
	$('#mobileNo').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Mobile Number")
		{
			$(this).attr("value","");
		}
    });
	$('#mobileNo').live("blur" , function(event){
		
		var mobileNo=$('#mobileNo').val();	
		if ($('#mobileNo').val() == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Mobile Number");
			$("#mobileNoError").hide().html(invalidImage+"Enter Mobile Number").show("slow");
			
		}
		else
		{
			var re_mobileNo = /^[9,8,7]\d{9}$/;
			if (!re_mobileNo.test($.trim($('#mobileNo').val()))) 
			{
				$("#mobileNoError").hide().html(invalidImage+"Enter valid Mobile Number").show("slow");
			}
			else
			{
				var base = base_url+'careers/checkmobileNoAvailability';
				$.post(base,{mobileNo: $('#mobileNo').val()},function(data){
						if (data == 0)
						{
							$("#mobileNoError").html("");
							
						}
						else
						{	
							$('#mobileNoError').css('color', '#FF0000');
							$("#mobileNoError").hide().html(invalidImage+"Mobile Number is not available.").show("slow");
							return;
						}
				});
				

			}	
		}
		 
	});
	$('#phoneNo').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Landline Number")
		{
			$(this).attr("value","");
		}
    });
		$('#phoneNo').live("blur" , function(event){
		
		var phoneNo=$('#phoneNo').val();	
		if ($('#phoneNo').val() == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Landline Number");
			$("#phoneNoError").html("");
			
		}
		else
		{
			var re_phoneNo = /^[0-9-]*$/;
			if (!re_phoneNo.test($.trim($('#phoneNo').val()))) 
			{
				$("#phoneNoError").hide().html(invalidImage+"Enter valid Landline Number").show("slow");
			}
			else
			{
				$("#phoneNoError").html("");

			}	
		}
		 
	});

	$('#address').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Postal Address")
		{
			$(this).attr("value","");
		}
    });
	$('#address').live("blur",function(){
								
		var address=$.trim($('#address').val());
		if ($.trim($('#address').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Postal Address");
			$("#addressTextError").hide().html(invalidImage+"Enter your Address").show("slow");
			return ; 
		}
		else
		{
			$("#addressTextError").html("");

		}
	});
	$('#pincode').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Pincode Number")
		{
			$(this).attr("value","");
		}
    });

	$('#pincode').live("blur",function(){
								
		if ($.trim($('#pincode').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Pincode Number");
			$("#pincodeTextError").hide().html(invalidImage+"Enter Pincode").show("slow");
			return ; 
		}
		else
		{

			var reg = /^[0-9]*$/;
			if (!reg.test($.trim($('#pincode').val()))) 
			{
				$("#pincode").focus();
				$("#pincodeTextError").hide().html(invalidImage+"Enter valid Pincode").show("slow");
			}
			else
			{
				$("#pincodeTextError").html("");
			}	
			
		}
	});
	$("#otherdesc").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Other Description")
		{
			$(this).attr("value","");
		}
		
	});														
	$("#otherdesc").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Other Description");
			//$("#otherdesc").hide().html(invalidImage+"Enter your Percentage / Grade").show("slow");
			return ; 
		}
		else
		{
			/*var chk = /^[a-zA-Z0-9][\w\ %+-]*[a-zA-Z0-9]*$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#descTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{*/
				$("#otherdesc").html("");
			//}
		}
	});
	$('#notice').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Notice Period")
		{
			$(this).attr("value","");
		}
    });

	$('#notice').live("blur",function(){	
								
		if ($.trim($('#notice').val()) == "")
		{
			$("#noticeTextError").hide().html(invalidImage+"Enter Notice Period").show("slow");
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Notice Period");
			return ; 
		}
		else
		{

			var reg = /^[0-9]*$/;
			if (!reg.test($.trim($('#notice').val()))) 
			{
				$("#notice").focus();
				$("#noticeTextError").hide().html(invalidImage+"Enter valid Notice Period").show("slow");
			}
			else
			{
				$("#noticeTextError").html("");
			}	
			
		}
	});

	$('#city').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="City")
		{
			$(this).attr("value","");
		}
    });
	$('#city').live("blur",function(){

		if ($.trim($('#city').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","City");
			$("#cityError").hide().html(invalidImage+"Enter your City").show("slow");
			return ; 
		}
		else
		{
			var re_digit = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!re_digit.test($.trim($('#city').val()))) 
			{
				$("#cityError").hide().html(invalidImage+"Enter appropriate city").show("slow");
			    return ; 
			}
			else
			{
				$("#cityError").html("");
			}
			
		}
		 
	});
	$('#state').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="State")
		{
			$(this).attr("value","");
		}
    });
	$('#state').live("blur",function(){

		if ($.trim($('#state').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","State");
			$("#stateError").hide().html(invalidImage+"Enter your State").show("slow");
			return ; 
		}
		else
		{
			var re_digit = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!re_digit.test($.trim($('#state').val()))) 
			{
				$("#stateError").hide().html(invalidImage+"Enter appropriate state").show("slow");
			    return ; 
			}
			else
			{
				$("#stateError").html("");

			}
			
		}
		 
	});
	$('#country').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Country")
		{
			$(this).attr("value","");
		}
    });
	$('#country').live("blur",function(){

		if ($.trim($('#country').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Country");
			$("#countryError").hide().html(invalidImage+"Enter your Country").show("slow");
			return ; 
		}
		else
		{
			var re_digit = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!re_digit.test($.trim($('#country').val()))) 
			{
				$("#countryError").hide().html(invalidImage+"Enter appropriate country").show("slow");
			    return ; 
			}
			else
			{
				$("#countryError").html("");

			}
			
		}
		 
	});
	$('#age').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Age")
		{
			$(this).attr("value","");
		}
    });
	$('#age').live("blur",function(){
								
		if ($.trim($('#age').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Age");
			$("#ageTextError").hide().html(invalidImage+"Enter Age").show("slow");
			return ; 
		}
		else
		{
			var reg = /^[0-9]*$/;
			if (!reg.test($.trim($('#age').val()))) 
			{
				$("#age").focus();
				$("#ageTextError").hide().html(invalidImage+"Enter valid Age").show("slow");
			}
			else
			{
				$("#ageTextError").html("");

			}	
			
		}
	});
	$('#salary').live("focus",function(){
		$(this).css("color","#000");
		if($(this).attr("value")=="Salary")
		{
			$(this).attr("value","");
		}
    });
	$('#salary').live("blur",function(){
								
		if ($.trim($('#salary').val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Salary");
			$("#salaryTextError").hide().html(invalidImage+"Enter Salary").show("slow");
			return ; 
		}
		else
		{

			var reg = /^[0-9,]*$/;
			if (!reg.test($.trim($('#salary').val()))) 
			{
				$("#salary").focus();
				$("#salaryTextError").hide().html(invalidImage+"Enter valid Salary").show("slow");
			}
			else
			{
				$("#salaryTextError").html("");

			}	
			
		}
	});
	 $('#userfile').live("blur",function(){	
							  
		if($('#userfile').val()!='')
		{
			var fileName = $('#userfile').val();
			var arr = fileName.split(".");
			var extension = $.trim(arr[1]);
			if (  extension.toString() == "jpg" || extension.toString() == "png" || extension.toString() == "gif" || extension.toString() == "JPG" || extension.toString() == "PNG" || extension.toString() == "GIF")
		   {
				$("#userfileTextError").html("");
		   }
		   else
		   {	
				$("#userfileTextError").hide().html(invalidImage+"Please upload valid format of file").show("slow");
				return;
		   }
		}
	});
	 $('#resume').live("blur",function(){	
							  
		if($('#resume').val()!='')
		{
			var fileName = $('#resume').val();
			var arr = fileName.split(".");
			var extension = $.trim(arr[1]);
			if (  extension.toString() == "doc" || extension.toString() == "docx" || extension.toString() == "rtf")
		   {
				$("#resumeTextError").html("");
		   }
		   else
		   {	
				$("#resumeTextError").hide().html(invalidImage+"Please upload valid format of file").show("slow");
				return;
		   }
		}
	});
	$('#addeduInfo').live("click",function(event){
			
		$("#loader1").css("display","block");	
		var base = base_url+'talentPool/getViewforEduInfo';
		$.post(base,{global:global},function(data){
											 
			$('#educationInfo').append(data);
			$("#loader1").css("display","none");
			global++;
			
		});
		
	});
	$("a[id^='delete_e_']").live("click", function(event){
				
		event.preventDefault();		
		var id=$(this).attr('id');
		var a=id.split("_");												 
		$('#e_'+a[2]).html('');
		$('#e_'+a[2]).hide();
	});
	$('#addworkexpInfo').live("click",function(){
			
		$("#loader2").css("display","block");
		var base = base_url+'talentPool/getViewforWorkExpInfo';
		$.post(base,{global1:global1},function(data){
											 
			$('#workexpInfo').append(data);
			$("#loader2").css("display","none");
			global1++;
			
		});
		
	});
	
	$("a[id^='delete_w_']").live("click", function(event){

		event.preventDefault();		
		var id=$(this).attr('id');
		var a=id.split("_");												 
		$('#w_'+a[2]).html('');
		$('#w_'+a[2]).hide();
	});
	$('#projInfolink').live("click",function(){
			
		$("#loader5").css("display","block");
		var base = base_url+'talentPool/getViewforprojectInfo';
		$.post(base,{global3:global3},function(data){
											 
			$('#projInfo').append(data);
			$("#loader5").css("display","none");
			global3++;
			
		});
		
	});
	
	$("a[id^='delete_p_']").live("click", function(event){
							
		event.preventDefault();									
		var id=$(this).attr('id');
		var a=id.split("_");												 
		$('#p_'+a[2]).html('');
		$('#p_'+a[2]).hide();
	});
	$('#addskillInfo').live("click",function(){
			
		$("#loader4").css("display","block");
		var base = base_url+'talentPool/getViewforskillInfo';
		$.post(base,{global2:global2},function(data){
											 
			$('#skillInfo').append(data);
			$("#loader4").css("display","none");
			global2++;
			
		});
		
	});
	$("a[id^='delete_s_']").live("click", function(event){
					
		event.preventDefault();		
		var id=$(this).attr('id');
		var a=id.split("_");												 
		$('#s_'+a[2]).html('');
		$('#s_'+a[2]).hide();
	});
	$("input[id^='insName_e_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Institute Name")
		{
			$(this).attr("value","");
		}
		
	});														
	$("input[id^='insName_e_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Institute Name");
			$("#insNameTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Institute Name").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#insNameTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#insNameTextError_e_"+a[2]).html("");
			}
		}
	});
	$("input[id^='degree_e_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Degree Name")
		{
			$(this).attr("value","");
		}
		
	});														
	$("input[id^='degree_e_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Degree Name");
			//$("#degreeTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Degree Name").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#degreeTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#degreeTextError_e_"+a[2]).html("");
			}
		}
	});
	$("input[id^='course_e_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Course Name")
		{
			$(this).attr("value","");
		}
		
	});														
	$("input[id^='course_e_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Course Name");
			$("#courseTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Course Name").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#courseTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#courseTextError_e_"+a[2]).html("");
			}
		}
	});
	$("input[id^='location_e_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Location")
		{
			$(this).attr("value","");
		}
		
	});														
	$("input[id^='location_e_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Location");
			$("#locationTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Location").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#locationTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#locationTextError_e_"+a[2]).html("");
			}
		}
	});
	$("input[id^='percentage_e_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Percentage / Grade")
		{
			$(this).attr("value","");
		}
		
	});														
	$("input[id^='percentage_e_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Percentage / Grade");
			$("#percentageTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Percentage / Grade").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z0-9][\w\ .%+-]*[a-zA-Z0-9]*$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#percentageTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#percentageTextError_e_"+a[2]).html("");
			}
		}
	});
	$("textarea[id^='desc_e_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Other Description")
		{
			$(this).attr("value","");
		}
		
	});														
	$("textarea[id^='desc_e_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Other Description");
			//$("#descTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Percentage / Grade").show("slow");
			return ; 
		}
		else
		{
			/*var chk = /^[a-zA-Z0-9][\w\ %+-]*[a-zA-Z0-9]*$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#descTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{*/
				$("#descTextError_e_"+a[2]).html("");
			//}
		}
	});
	$("textarea[id^='desc_w_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Other Description")
		{
			$(this).attr("value","");
		}
		
	});														
	$("textarea[id^='desc_w_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Other Description");
			//$("#descTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Percentage / Grade").show("slow");
			return ; 
		}
		else
		{
			/*var chk = /^[a-zA-Z0-9][\w\ %+-]*[a-zA-Z0-9]*$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#descTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{*/
				$("#descTextError_w_"+a[2]).html("");
			//}
		}
	});
	$("select[id^='fromYear_e_']").live("focus change" , function(event){
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else if (parseInt($('#fromMonth_e_'+id).val()) != 0 && parseInt($(this).val()) != 0)
		{
			$("#fromTextError_e_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#fromMonth_e_'+id).val()) == 0)
			{
				$("#fromTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				return;
			}
			else
			{
				$("#fromTextError_e_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && parseInt($('#fromMonth_e_'+id).val()) != 0 && parseInt($('#toYear_e_'+id).val()) != 0 && parseInt($('#toMonth_e_'+id).val()) != 0)
		{
			if(parseInt($(this).val())!=parseInt($('#toYear_e_'+id).val()))
			{
				
				if(parseInt($(this).val()) > parseInt($('#toYear_e_'+id).val()))
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_e_'+id).val()) >= parseInt($('#toMonth_e_'+id).val()) )
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
		}
	
	});
	$("select[id^='fromMonth_e_']").live("focus change" , function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
			return;
		}
		else if (parseInt($(this).val()) != 0 && $('#fromYear_e_'+id).val() != 0)
		{
			$("#fromTextError_e_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if ($('#fromYear_e_'+id).val() == 0)
			{
				$("#fromTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
				return;
			}
			else
			{
				$("#fromTextError_e_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_e_'+id).val() != 0 && parseInt($('#toYear_e_'+id).val()) != 0 && parseInt($('#toMonth_e_'+id).val()) != 0)
		{
		
			if($('#fromYear_e_'+id).val()!=parseInt($('#toYear_e_'+id).val()))
			{
				
				if($('#fromYear_e_'+id).val() > parseInt($('#toYear_e_'+id).val()))
				{
					
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
			else
			{
				if(parseInt($(this).val()) >= parseInt($('#toMonth_e_'+id).val()))
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
		}
	
		});
	$("select[id^='toYear_e_']").live("focus change" , function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		//alert(id);
		//alert(parseInt($('#toMonth_e_'+id)));
		if (parseInt($(this).val()) == 0)
		{
			$("#toTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else if (parseInt($('#toMonth_e_'+id)) != 0 && parseInt($(this).val()) != 0)
		{
			$("#toTextError_e_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#toMonth_e_'+id).val()) == 0)
			{
				$("#toTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				return;
			}
			else
			{
				$("#toTextError_e_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_e_'+id).val() != 0 && parseInt($('#fromMonth_e_'+id).val()) != 0 && parseInt($('#toMonth_e_'+id).val()) != 0)
		{
			if($('#fromYear_e_'+id).val()!=parseInt($(this).val()))
			{
				if($('#fromYear_e_'+id).val() > parseInt($(this).val()))
				{
					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_e_'+id).val()) >= parseInt($('#toMonth_e_'+id).val()))
				{

					$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_e_"+id).html("");
				}
			}
		}
	
});
$("select[id^='toMonth_e_']").live("focus change" , function(event){
	
	var str=$(this).attr('id');
	var a=str.split("_");
	var id=a[2];

	if (parseInt($(this).val()) == 0)
	{
		$("#toTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
		return;
	}
	else if (parseInt($(this).val()) != 0 && parseInt($('#toYear_e_'+id).val()) != 0)
	{
		$("#toTextError_e_"+id).html("");
	}
	else if(parseInt($(this).val()) != 0)
	{
		if (parseInt($('#toYear_e_'+id).val()) == 0)
		{
			$("#toTextError_e_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else
		{
			$("#toTextError_e_"+id).html("");
		}
	}
	if (parseInt($(this).val()) != 0 && $('#fromYear_e_'+id).val() != 0 && parseInt($('#fromMonth_e_'+id).val()) != 0 && parseInt($('#toYear_e_'+id).val()) != 0)
	{
		if($('#fromYear_e_'+id).val()!= parseInt($('#toYear_e_'+id).val()))
		{
			if($('#fromYear_e_'+id).val() > parseInt($('#toYear_e_'+id).val()))
			{
				$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
				return;
			}
			else
			{
				$("#toTextError_e_"+id).html("");
			}
		}
		else
		{
			if(parseInt($('#fromMonth_e_'+id).val()) >= parseInt($(this).val()))
			{
				$("#toTextError_e_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
				return;
			}
			else
			{
				$("#toTextError_e_"+id).html("");
			}
		}
	}
	
	});
	$("input[id^='empName_w_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Employer Name")
		{
			$(this).attr("value","");
		}
		
	});		
	$("input[id^='empName_w_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Employer Name");
			$("#empNameTextError_w_"+id).hide().html(invalidImage+"Enter Employer Name").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#empNameTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#empNameTextError_w_"+id).html("");
			}
		}
	});
	$("input[id^='projName_p_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Project Name")
		{
			$(this).attr("value","");
		}
		
	});		
	$("input[id^='projName_p_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Project Name");
			$("#projNameTextError_p_"+id).hide().html(invalidImage+"Enter Project Name").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#projNameTextError_p_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#projNameTextError_p_"+id).html("");
			}
		}
	});
	$("input[id^='yourrole_p_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Your Role")
		{
			$(this).attr("value","");
		}
		
	});		
	$("input[id^='yourrole_p_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Your Role");
			$("#yourroleTextError_p_"+id).hide().html(invalidImage+"Enter Your Role").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#yourroleTextError_p_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#yourroleTextError_p_"+id).html("");
			}
		}
	});
	$("select[id^='fromYear_p_']").live("focus change" , function(event){
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else if (parseInt($('#fromMonth_p_'+id).val()) != 0 && parseInt($(this).val()) != 0)
		{
			$("#fromTextError_p_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#fromMonth_p_'+id).val()) == 0)
			{
				$("#fromTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				return;
			}
			else
			{
				$("#fromTextError_p_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && parseInt($('#fromMonth_p_'+id).val()) != 0 && parseInt($('#toYear_p_'+id).val()) != 0 && parseInt($('#toMonth_p_'+id).val()) != 0)
		{
			if(parseInt($(this).val())!=parseInt($('#toYear_p_'+id).val()))
			{
				
				if(parseInt($(this).val()) > parseInt($('#toYear_p_'+id).val()))
				{
					
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_p_'+id).val()) >= parseInt($('#toMonth_p_'+id).val()) )
				{
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
		}
	
	});
	$("select[id^='fromMonth_p_']").live("focus change" , function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
			return;
		}
		else if (parseInt($(this).val()) != 0 && $('#fromYear_p_'+id).val() != 0)
		{
			$("#fromTextError_p_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if ($('#fromYear_p_'+id).val() == 0)
			{
				$("#fromTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
				return;
			}
			else
			{
				$("#fromTextError_p_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_p_'+id).val() != 0 && parseInt($('#toYear_p_'+id).val()) != 0 && parseInt($('#toMonth_p_'+id).val()) != 0)
		{
		
			if($('#fromYear_p_'+id).val()!=parseInt($('#toYear_p_'+id).val()))
			{
				
				if($('#fromYear_p_'+id).val() > parseInt($('#toYear_p_'+id).val()))
				{
					
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
			else
			{

				if(parseInt($(this).val()) >= parseInt($('#toMonth_p_'+id).val()))
				{
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
		}
	
		});
	$("select[id^='toYear_p_']").live("focus change" , function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#toTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else if ($('#toMonth_p_'+id) != 0 && parseInt($(this).val()) != 0)
		{
			$("#toTextError_p_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#toMonth_p_'+id).val()) == 0)
			{
				$("#toTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				return;
			}
			else
			{
				$("#toTextError_p_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_p_'+id).val() != 0 && parseInt($('#fromMonth_p_'+id).val()) != 0 && parseInt($('#toMonth_p_'+id).val()) != 0)
		{
			if($('#fromYear_p_'+id).val()!=parseInt($(this).val()))
			{
				if($('#fromYear_p_'+id).val() > parseInt($(this).val()))
				{
					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_p_'+id).val()) >= parseInt($('#toMonth_p_'+id).val()))
				{

					$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_p_"+id).html("");
				}
			}
		}
	
});
$("select[id^='toMonth_p_']").live("focus change" , function(event){
	
	var str=$(this).attr('id');
	var a=str.split("_");
	var id=a[2];

	if (parseInt($(this).val()) == 0)
	{
		$("#toTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
		return;
	}
	else if (parseInt($(this).val()) != 0 && parseInt($('#toYear_p_'+id).val()) != 0)
	{
		$("#toTextError_p_"+id).html("");
	}
	else if(parseInt($(this).val()) != 0)
	{
		if (parseInt($('#toYear_p_'+id).val()) == 0)
		{
			$("#toTextError_p_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else
		{
			$("#toTextError_p_"+id).html("");
		}
	}
	if (parseInt($(this).val()) != 0 && parseInt($('#toYear_p_'+id).val()) != 0 && parseInt($('#fromMonth_p_'+id).val())!= 0 && parseInt($('#toYear_p_'+id).val()) != 0)
	{
		if(parseInt($('#fromYear_p_'+id).val())!= parseInt($('#toYear_p_'+id).val()))
		{
			if(parseInt($('#fromYear_p_'+id).val()) > parseInt($('#toYear_p_'+id).val()))
			{
				$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
				return;
			}
			else
			{
				$("#toTextError_p_"+id).html("");
			}
		}
		else
		{
			if(parseInt($('#fromMonth_p_'+id).val())>= parseInt($(this).val()))
			{
				$("#toTextError_p_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
				return;
			}
			else
			{
				$("#toTextError_p_"+id).html("");
			}
		}
	}
	
	});
	$("textarea[id^='projdesc_p_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Project Description")
		{
			$(this).attr("value","");
		}
		
	});														
$("textarea[id^='projdesc_p_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Project Description");
			//$("#noteTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Percentage / Grade").show("slow");
			return ; 
		}
		else
		{
			/*var chk = /^[a-zA-Z0-9][\w\ %+-]*[a-zA-Z0-9]*$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#noteTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{*/
				//$("#noteTextError_s_"+a[2]).html("");
			//}
		}
	});
	$("input[id^='location_w_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Work Location")
		{
			$(this).attr("value","");
		}
		
	});		
	$("input[id^='location_w_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Work Location");
			$("#locationTextError_w_"+id).hide().html(invalidImage+"Enter Work Location").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#locationTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#locationTextError_w_"+id).html("");
			}
		}
	});
	$("input[id^='jobrole_w_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Job Role")
		{
			$(this).attr("value","");
		}
		
	});		
	$("input[id^='jobrole_w_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Job Role");
			$("#jobroleTextError_w_"+id).hide().html(invalidImage+"Enter Job Role").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#jobroleTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#jobroleTextError_w_"+id).html("");
			}
		}
	});
	$("select[id^='fromYear_w_']").live("focus change" , function(event){
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else if (parseInt($('#fromMonth_w_'+id).val()) != 0 && parseInt($(this).val()) != 0)
		{
			$("#fromTextError_w_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#fromMonth_w_'+id).val()) == 0)
			{
				$("#fromTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				return;
			}
			else
			{
				$("#fromTextError_w_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && parseInt($('#fromMonth_w_'+id).val()) != 0 && parseInt($('#toYear_w_'+id).val()) != 0 && parseInt($('#toMonth_w_'+id).val()) != 0)
		{
			if(parseInt($(this).val())!=parseInt($('#toYear_w_'+id).val()))
			{
				
				if(parseInt($(this).val()) > parseInt($('#toYear_w_'+id).val()))
				{
					
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_w_'+id).val()) >= parseInt($('#toMonth_w_'+id).val()) )
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
		}
	
	});
	$("select[id^='fromMonth_w_']").live("focus change" , function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if (parseInt($(this).val()) == 0)
		{
			$("#fromTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
			return;
		}
		else if (parseInt($(this).val()) != 0 && $('#fromYear_w_'+id).val() != 0)
		{
			$("#fromTextError_w_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if ($('#fromYear_w_'+id).val() == 0)
			{
				$("#fromTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
				return;
			}
			else
			{
				$("#fromTextError_w_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_w_'+id).val() != 0 && parseInt($('#toYear_w_'+id).val()) != 0 && parseInt($('#toMonth_w_'+id).val()) != 0)
		{
		
			if($('#fromYear_w_'+id).val()!=parseInt($('#toYear_w_'+id).val()))
			{
				
				if($('#fromYear_w_'+id).val() > parseInt($('#toYear_w_'+id).val()))
				{
					
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
			else
			{

				if(parseInt($(this).val()) >= parseInt($('#toMonth_w_'+id).val()))
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
		}
	
		});
	$("select[id^='toYear_w_']").live("focus change" , function(event){
	
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if (parseInt($(this).val()) == 0)
		{
			$("#toTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else if ($('#toMonth_w_'+id) != 0 && parseInt($(this).val()) != 0)
		{
			$("#toTextError_w_"+id).html("");
		}
		else if(parseInt($(this).val()) != 0)
		{
			if (parseInt($('#toMonth_w_'+id).val()) == 0)
			{
				$("#toTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
				return;
			}
			else
			{
				$("#toTextError_w_"+id).html("");
			}
		}
		if (parseInt($(this).val()) != 0 && $('#fromYear_w_'+id).val() != 0 && parseInt($('#fromMonth_w_'+id).val()) != 0 && parseInt($('#toMonth_w_'+id).val()) != 0)
		{
			if($('#fromYear_w_'+id).val()!=parseInt($(this).val()))
			{
				if($('#fromYear_w_'+id).val() > parseInt($(this).val()))
				{
					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
			else
			{
				if(parseInt($('#fromMonth_w_'+id).val()) >= parseInt($('#toMonth_w_'+id).val()))
				{

					$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
					return;
				}
				else
				{
					$("#toTextError_w_"+id).html("");
				}
			}
		}
	
});
$("select[id^='toMonth_w_']").live("focus change" , function(event){
	
	var str=$(this).attr('id');
	var a=str.split("_");
	var id=a[2];

	if (parseInt($(this).val()) == 0)
	{
		$("#toTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Month").show("slow");
		return;
	}
	else if (parseInt($(this).val()) != 0 && parseInt($('#toYear_w_'+id).val()) != 0)
	{
		$("#toTextError_w_"+id).html("");
	}
	else if(parseInt($(this).val()) != 0)
	{
		if (parseInt($('#toYear_w_'+id).val()) == 0)
		{
			$("#toTextError_w_"+id).hide().html(invalidImage+"Choose a valid option for Year").show("slow");
			return;
		}
		else
		{
			$("#toTextError_w_"+id).html("");
		}
	}
	if (parseInt($(this).val()) != 0 && parseInt($('#toYear_w_'+id).val()) != 0 && parseInt($('#fromMonth_w_'+id).val())!= 0 && parseInt($('#toYear_w_'+id).val()) != 0)
	{
		if(parseInt($('#fromYear_w_'+id).val())!= parseInt($('#toYear_w_'+id).val()))
		{
			if(parseInt($('#fromYear_w_'+id).val()) > parseInt($('#toYear_w_'+id).val()))
			{
				$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
				return;
			}
			else
			{
				$("#toTextError_w_"+id).html("");
			}
		}
		else
		{
			if(parseInt($('#fromMonth_w_'+id).val())>= parseInt($(this).val()))
			{
				$("#toTextError_w_"+id).hide().html(invalidImage+"Enter Proper Duration").show("slow");
				return;
			}
			else
			{
				$("#toTextError_w_"+id).html("");
			}
		}
	}
	
	});
	$("input[id^='skillName_s_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Skill Name")
		{
			$(this).attr("value","");
		}
		
	});		
	$("input[id^='skillName_s_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Skill Name");
			$("#skillNameTextError_s_"+id).hide().html(invalidImage+"Enter Skill Name").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. -]*[a-zA-Z]/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#skillNameTextError_s_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#skillNameTextError_s_"+id).html("");
			}
		}
	});
	$("select[id^='expMonth_s_']").live("focus change" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($(this).val() == -1 && $('#expYear_s_'+id).val() == -1)
		{
			$("#expTextError_s_"+id).hide().html(invalidImage+"Enter Experience").show("slow");
			return ; 
		}
		else
		{
			$("#expTextError_s_"+id).html("");
		}
	});
	$("select[id^='expYear_s_']").live("focus change" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($(this).val() == -1 && $('#expMonth_s_'+id).val() == -1)
		{
			$("#expTextError_s_"+id).hide().html(invalidImage+"Enter Experience").show("slow");
			return ; 
		}
		else
		{
			$("#expTextError_s_"+id).html("");
		}
	});
	$("textarea[id^='note_s_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Other Description")
		{
			$(this).attr("value","");
		}
		
	});														
	$("textarea[id^='note_s_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];
		
		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Other Description");
			//$("#noteTextError_e_"+a[2]).hide().html(invalidImage+"Enter your Percentage / Grade").show("slow");
			return ; 
		}
		else
		{
			/*var chk = /^[a-zA-Z0-9][\w\ %+-]*[a-zA-Z0-9]*$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#noteTextError_e_"+a[2]).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{*/
				$("#noteTextError_s_"+a[2]).html("");
			//}
		}
	});
	$("input[id^='skillUsed_p_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Skills Used")
		{
			$(this).attr("value","");
		}
		
	});		
	$("input[id^='skillUsed_p_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Skills Used");
			$("#skillUsedTextError_p_"+id).hide().html(invalidImage+"Enter Skills").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. ,-]*[a-zA-Z]$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#skillUsedTextError_p_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#skillUsedTextError_p_"+id).html("");
			}
		}
	});
	$("textarea[id^='responsibility_p_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Your Responsibility")
		{
			$(this).attr("value","");
		}
		
	});		
	$("textarea[id^='responsibility_p_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Your Responsibility");
			$("#responsibilityTextError_p_"+id).hide().html(invalidImage+"Enter Responsibilities").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. ,-]*[a-zA-Z]$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#responsibilityTextError_p_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#responsibilityTextError_p_"+id).html("");
			}
		}
	});
	$("input[id^='skillUsed_w_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Skills Used")
		{
			$(this).attr("value","");
		}
		
	});		
	$("input[id^='skillUsed_w_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Skills Used");
			$("#skillUsedTextError_w_"+id).hide().html(invalidImage+"Enter Skills").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. ,-]*[a-zA-Z]$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#skillUsedTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#skillUsedTextError_w_"+id).html("");
			}
		}
	});
	$("textarea[id^='responsibility_w_']").live("focus" , function(event){
		
		$(this).css("color","#000");
		if($(this).attr("value")=="Your Responsibility")
		{
			$(this).attr("value","");
		}
		
	});		
	$("textarea[id^='responsibility_w_']").live("blur" , function(event){
		
		var str=$(this).attr('id');
		var a=str.split("_");
		var id=a[2];

		if ($.trim($(this).val()) == "")
		{
			$(this).css("color","#CCCCCC");
			$(this).attr("value","Your Responsibility");
			$("#responsibilityTextError_w_"+id).hide().html(invalidImage+"Enter Responsibilities").show("slow");
			return ; 
		}
		else
		{
			var chk = /^[a-zA-Z][\w\. ,-]*[a-zA-Z]$/;
			if (!chk.test($.trim($(this).val()))) 
			{
				$("#responsibilityTextError_w_"+id).hide().html(invalidImage+"Enter into proper format").show("slow");
				return ; 
			}
			else
			{
				$("#responsibilityTextError_w_"+id).html("");
			}
		}
	});
	$("input[name^='option']").live("click" , function(event){
																
		var val=$(this).val();
		global1=0;
		if(val == 2)
		{
			$('#tr_salary').css("display","table-row");
			$('#tr_period').css("display","table-row");
			$('#projInfo').html('');
			$('#projprofile').css("display","none");
			var base = base_url+'talentPool/getViewforWorkExpInfo';
			$.post(base,{global1:global1},function(data){
												 
				$('#workexpInfo').html(data);
				$('#workExp').css("display","block");
				global1++;
				
			});
		}
		else
		{
			
			if(val == 1 )
			{
				$('#workexpInfo').html('');
				$('#workExp').css("display","none");
				$('#projprofile').css("display","block");
				global3=0;
				var base = base_url+'talentPool/getViewforprojectInfo';
				$.post(base,{global3:global3},function(data){
													 
					$('#projInfo').append(data);
					$('#projprofile').css("display","block");
					global3++;
					
				});
			}
			else
			{
				$('#workexpInfo').html('');
				$('#workExp').css("display","none");
				$('#projInfo').html('');
				$('#projprofile').css("display","none");

				var base = base_url+'talentPool/getViewforWorkExpInfo';
				$.post(base,{global1:global1},function(data){
													 
					$('#workexpInfo').html(data);
					$('#workExp').css("display","block");
					global1++;
					
				});
			}
			$('#tr_salary').css("display","none");
			$('#tr_period').css("display","none");
		}
	});		
	$('#captchaText').live("blur" , function(event){
	if($('#captchaText').val()=='')
		{
			$("#captchaTextError").hide().html(invalidImage+"Please Enter Captcha").show("slow");
			
		}
		else
		{
			$("#captchaTextError").html("").show("slow");
		}
	});
	$('#refresh').live("click" , function(event){
			var base = base_url+'talentPool/refreshCaptcha';
			$.post(base,{},function(data){
				$('#captcha').html(data);														  
    		});
	});
	$("#resetForm").click(function(event){
		$(".Error").hide().html("").animate({"opacity":"toggle" , "height":"toggle"} , 200);
		/*
		$("#UserRegistration :input").not(':button, :submit, :reset, :hidden, :checkbox') .val('') .removeAttr('selected');
		$("#UserRegistration :input").removeAttr('checked');*/
		
		if($("#FNameText").attr("value")!="First Name")
		{
			$("#FNameText").css("color","#CCCCCC");
			$("#FNameText").attr("value","First Name");
		}
		if($("#MNameText").attr("value")!="Middle Name")
		{
			$("#MNameText").css("color","#CCCCCC");
			$("#MNameText").attr("value","Middle Name");
		}
		if($("#LNameText").attr("value")!="Last Name")
		{
			$("#LNameText").css("color","#CCCCCC");
			$("#LNameText").attr("value","Last Name");
		}
		if($("#age").attr("value")!="Age")
		{
			$("#age").css("color","#CCCCCC");
			$("#age").attr("value","Age");
		}
		if($("#emailIdText").attr("value")!="Age")
		{
			$("#emailIdText").css("color","#CCCCCC");
			$("#emailIdText").attr("value","Age");
		}
		if($("#mobileNo").attr("value")!="Mobile Number")
		{
			$("#mobileNo").css("color","#CCCCCC");
			$("#mobileNo").attr("value","Mobile Number");
		}
		if($("#phoneNo").attr("value")!="Landline Number")
		{
			$("#phoneNo").css("color","#CCCCCC");
			$("#phoneNo").attr("value","Landline Number");
		}
		if($("#address").attr("value")!="Postal Address")
		{
			$("#address").css("color","#CCCCCC");
			$("#address").attr("value","Postal Address");
		}
		if($("#pincode").attr("value")!="Pincode Number")
		{
			$("#pincode").css("color","#CCCCCC");
			$("#pincode").attr("value","Pincode Number");
		}
		if($("#city").attr("value")!="City")
		{
			$("#city").css("color","#CCCCCC");
			$("#city").attr("value","City");
		}
		if($("#state").attr("value")!="State")
		{
			$("#state").css("color","#CCCCCC");
			$("#state").attr("value","State");
		}
		if($("#country").attr("value")!="Country")
		{
			$("#country").css("color","#CCCCCC");
			$("#country").attr("value","Country");
		}
		if($("#salary").attr("value")!="Salary")
		{
			$("#salary").css("color","#CCCCCC");
			$("#salary").attr("value","Salary");
		}
		if($("#notice").attr("value")!="Notice Period")
		{
			$("#notice").css("color","#CCCCCC");
			$("#notice").attr("value","Notice Period");
		}
		if($("#otherdesc").attr("value")!="Other Description")
		{
			$("#otherdesc").css("color","#CCCCCC");
			$("#otherdesc").attr("value","Other Description");
		}

		$("#userfile").attr("value","");
		$("#resume").attr("value","");
		$("#resumeText").attr("value","");
		$("select[id^='fromYear_e_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Year')").attr("selected","selected");	
		});	
		$("select[id^='fromYear_w_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Year')").attr("selected","selected");	
		});	
		$("select[id^='fromYear_p_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Year')").attr("selected","selected");	
		});	
		$("select[id^='toYear_e_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Year')").attr("selected","selected");	
		});	
		$("select[id^='toYear_w_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Year')").attr("selected","selected");	
		});	
		$("select[id^='toYear_p_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Year')").attr("selected","selected");	
		});	
		$("select[id^='fromMonth_e_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Month')").attr("selected","selected");	
		});	
		$("select[id^='fromMonth_w_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Month')").attr("selected","selected");	
		});	
		$("select[id^='fromMonth_p_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Month')").attr("selected","selected");	
		});	
		$("select[id^='toMonth_e_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Month')").attr("selected","selected");	
		});	
		$("select[id^='toMonth_w_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Month')").attr("selected","selected");	
		});	
		$("select[id^='toMonth_p_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Month')").attr("selected","selected");	
		});	
		$("select[id^='expYear_s_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Year')").attr("selected","selected");	
		});	
		$("select[id^='expMonth_s_']").each(function(event){
				
			var id=$(this).attr('id');		
			$("#"+id+" option:contains('Month')").attr("selected","selected");	
		});
		$("input[id^='insName_e_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Institute Name")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Institute Name");
			}
		});	
		$("input[id^='degree_e_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Degree Name")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Degree Name");
			}
		});	
		$("input[id^='courseName_e_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Course Name")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Course Name");
			}
		});	
		$("input[id^='location_e_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Location")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Location");
			}
		});	
		$("input[id^='percentage_e_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Percentage / Grade")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Percentage / Grade");
			}
		});	
		$("textarea[id^='desc_e_']").each(function(event){
												   
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Other Description")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Other Description");
			}
												   
		});	
		$("textarea[id^='desc_w_']").each(function(event){
												   
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Other Description")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Other Description");
			}
												   
		});	
		$("input[id^='projName_p_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Project Name")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Project Name");
			}
		});	
		$("input[id^='yourrole_p_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Your Role")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Your Role");
			}									   
    	});
		$("textarea[id^='projdesc_p_']").each(function(event){
												   
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Project Description")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Project Description");
			}
												   
		});	
		$("input[id^='empName_w_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Employer Name")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Employer Name");
			}									   
    	});
		$("input[id^='skillName_s_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Skill Name")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Skill Name");
			}									   
    	});
		$("textarea[id^='note_s_']").each(function(event){
												   
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Other Description")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Other Description");
			}
												   
		});	
		$("input[id^='jobrole_w_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Job Role")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Job Role");
			}									   
    	});

		$("input[id^='location_w_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Work Location")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Work Location");
			}
		});	
		$("input[id^='skillUsed_w_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Skills Used")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Skills Used");
			}									   
    	});
		$("textarea[id^='responsibility_w_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Your Responsibility")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Your Responsibility");
			}									   
    	});
		$("input[id^='skillUsed_p_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Skills Used")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Skills Used");
			}									   
    	});
		$("textarea[id^='responsibility_p_']").each(function(event){
			var id=$(this).attr('id');	
			if($("#"+id).attr("value")!="Your Responsibility")
			{
				$("#"+id).css("color","#CCCCCC");
				$("#"+id).attr("value","Your Responsibility");
			}									   
    	});
		$("input[name^='duration_s_']").each(function(event){
											
			var val=$(this).val();		
			if(val!='6 Months')
			{
				$(this).removeAttr('checked');
			}
			else
			{
				$(this).attr('checked','checked');
			}
			
		});
		$("input[name^='rating_s_']").each(function(event){
											
			var val=$(this).val();		
			if(val!='1')
			{
				$(this).removeAttr('checked');
			}
			else
			{
				$(this).attr('checked','checked');
			}
			
		});
		$("input[name^='Gender']").each(function(event){
											
			var val=$(this).val();		
			if(val!='Female')
			{
				$(this).removeAttr('checked');
			}
			else
			{
				$(this).attr('checked','checked');
			}
			
		});
		$("#captchaText").attr("value","");
		
	});

});

