function registerValidation()
{
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	var number_exp = /^[0-9]+$/;
	var dt = new Date();
	var y  = dt.getFullYear();
	var m  = dt.getMonth()+1;
	var d  = dt.getDate();
	$("#firstname_errmsg").hide();
	$("#lastname_errmsg").hide();
	$("#address_errmsg").hide();
	$("#city_errmsg").hide();
	$("#province_errmsg").hide();
	$("#postcode_errmsg").hide();
	$("#username_errmsg").hide();
	$("#password_errmsg").hide();
	$("#cpassword_errmsg").hide();
	$("#email_errmsg").hide();
	$("#cemail_errmsg").hide();
	$("#primarypno_errmsg").hide();
	$("#promocode_errmsg").hide();
	$("#creditno_errmsg").hide();
	$("#creditname_errmsg").hide();
	$("#verification_errmsg").hide();
	$("#expiry_errmsg").hide();
	$("#billaddr_errmsg").hide();
	$("#billcity_errmsg").hide();
	$("#billprovince_errmsg").hide();
	$("#billpcode_errmsg").hide();
	$("#billcountry_errmsg").hide();
	$("#hearfrom_errmsg").hide();
	$("#agree_errmsg").hide();
	$("#errorFlag").val(0);
	if($('#first_name').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#firstname_errmsg").html("* First Name is required");
		$("#firstname_errmsg").show();
	}
	if($('#last_name').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#lastname_errmsg").html("* Last Name is required");
		$("#lastname_errmsg").show();
	}
	if($('#address').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#address_errmsg").html("* Address is required");
		$("#address_errmsg").show();
	}
	if($('#city').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#city_errmsg").html("* City is required");
		$("#city_errmsg").show();
	}
	if($('#province').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#province_errmsg").html("* Province is required");
		$("#province_errmsg").show();
	}
	if($('#postal_code').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#postcode_errmsg").html("* Postal Code is required");
		$("#postcode_errmsg").show();
	}
	if($('#user_name').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#username_errmsg").html("* User Name is required");
		$("#username_errmsg").show();
	}
	if($('#password').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#password_errmsg").html("* Password is required");
		$("#password_errmsg").show();
	}
	if($('#confirm_password').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#cpassword_errmsg").html("* Confirm Password is required");
		$("#cpassword_errmsg").show();
	}
	if(($('#confirm_password').val() != '' )&&($('#confirm_password').val() != $('#password').val() ))
	{ 
		$("#errorFlag").val(1);
		$("#cpassword_errmsg").html("* Password and Confirm Password doesn't match");
		$("#cpassword_errmsg").show();
	}
	if($('#email_id').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#email_errmsg").html("* Email Address is required");
		$("#email_errmsg").show();
	}
	if( ($('#email_id').val() != '' )&&( !(e.exec($('#email_id').val() ) ) ) )
	{ 
		$("#errorFlag").val(1);
		$("#email_errmsg").html("* Email Address is Invalid");
		$("#email_errmsg").show();
	}
	if($('#confirm_email_id').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#cemail_errmsg").html("* Confirm Email Address is required");
		$("#cemail_errmsg").show();
	}
	if( ($('#confirm_email_id').val() != '' )&&( !(e.exec($('#confirm_email_id').val() ) ) ) )
	{ 
		$("#errorFlag").val(1);
		$("#cemail_errmsg").html("* Confirm Email Address is Invalid");
		$("#cemail_errmsg").show();
	}
	if(($('#confirm_email_id').val() != '' ) && ($('#confirm_email_id').val() != $('#email_id').val() ))
	{ 
		$("#errorFlag").val(1);
		$("#cemail_errmsg").html("* Email and Confirm Email doesn't match");
		$("#cemail_errmsg").show();
	}

	if(($('#primary_pno1').val() == '' )||($('#primary_pno2').val() == '' )||($('#primary_pno2').val() == '' ))
	{ 
		$("#errorFlag").val(1);
		$("#primarypno_errmsg").html("* Primary Phone Number is required");
		$("#primarypno_errmsg").show();
	}
	if((($('#primary_pno1').val() != '' )&&( !(number_exp.exec($('#primary_pno1').val() ) ) )) || (($('#primary_pno2').val() != '' )&&( !(number_exp.exec($('#primary_pno2').val() ) ) ) ) || (($('#primary_pno2').val() != '' )&&( !(number_exp.exec($('#primary_pno3').val() ) ) )) )
	{ 
		$("#errorFlag").val(1);
		$("#primarypno_errmsg").html("* Primary Phone Number is Invalid");
		$("#primarypno_errmsg").show();
	}
	
	/*if($('#credit_number').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#creditno_errmsg").html("* Credit Card Number is required");
		$("#creditno_errmsg").show();
	}
	if(($('#credit_number').val() != '' )&&( !(number_exp.exec($('#credit_number').val() ) ) ))
	{ 
		$("#errorFlag").val(1);
		$("#creditno_errmsg").html("* Credit Card Number is Invalid");
		$("#creditno_errmsg").show();
	}
	
	if($('#credit_name').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#creditname_errmsg").html("* Credit Card Name is required");
		$("#creditname_errmsg").show();
	}
	
	if($('#verification_no').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#verification_errmsg").html("* Verification Number is required");
		$("#verification_errmsg").show();
	}
	if(($('#verification_no').val() != '' )&&( !(number_exp.exec($('#verification_no').val() ) ) ))
	{ 
		$("#errorFlag").val(1);
		$("#verification_errmsg").html("* Verification Number is Invalid");
		$("#verification_errmsg").show();
	}
	
	
	
	if(($('#credit_expiry_month').val() == '' )||($('#credit_expiry_year').val() == '' ))
	{ 
		$("#errorFlag").val(1);
		$("#expiry_errmsg").html("* Expiration Date is required");
		$("#expiry_errmsg").show();
	}
	if (($('#credit_expiry_month').val() < m)&&($('#credit_expiry_year').val() <= y))
	{ 
		$("#errorFlag").val(1);
		$("#expiry_errmsg").html("* Expiration Date is invalid");
		$("#expiry_errmsg").show();
	}
	if($('#credit_expiry_year').val() < y)
	{ 
		$("#errorFlag").val(1);
		$("#expiry_errmsg").html("* Expiration year is invalid");
		$("#expiry_errmsg").show();
	}
	if($('#billing_addr').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#billaddr_errmsg").html("* Billing Address is required");
		$("#billaddr_errmsg").show();
	}
	if($('#billing_city').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#billcity_errmsg").html("* Billing City is required");
		$("#billcity_errmsg").show();
	}
	if($('#billing_province').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#billprovince_errmsg").html("* Billing Province is required");
		$("#billprovince_errmsg").show();
	}
	if($('#billing_postal_code').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#billpcode_errmsg").html("* Billing Postal Code is required");
		$("#billpcode_errmsg").show();
	}
	if($('#billing_country').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#billcountry_errmsg").html("* Billing Country is required");
		$("#billcountry_errmsg").show();
	}*/
	if($('#hear_from').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#hearfrom_errmsg").html("* This field is required");
		$("#hearfrom_errmsg").show();
	}
	if (!$('#agree').is(':checked'))
	{ 
		$("#errorFlag").val(1);
		$("#agree_errmsg").html("(Please Agree Sitterscitycanada agreement)");
		$("#agree_errmsg").show();
	}
	 if ( $("#errorFlag").val() == 1) return false;
	 else return true;
}

//user login validation
function loginValidation()
{
	//$("#login_errmsg").hide();
	$("#errorLoginFlag").val(0);
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	if($('#login_username').val() == '' )
	{ 
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Email Address is required");
		$("#login_errmsg_content").show();
		return false;
	}
	
	if($('#login_password').val() == '' )
	{ 
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Password is required");
		return false;
	}
	if( ($('#login_password').val() == '' )&&($('#login_username').val() == '' ) )
	{ 
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Email and Password is required");
		//$("#login_errmsg").show();
	}
	 if ( $("#errorLoginFlag").val() == 1) return false;
	 else return true;
}

//Begin : Right nav validation
function validateLogin()
{
	$("#errorLoginFlag").val(0);
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	if( ($('#login_password').val() == '' )&&($('#login_username').val() == '' ) )
	{ 
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Email and Password is required");		
		$("#login_errmsg_content").show();
	}
	else if($('#login_username').val() == '' )
	{ 
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Email Address is required");
		$("#login_errmsg_content").show();		
	}
	else if( ($('#login_username').val() != '' )&&( !(e.exec($('#login_username').val() ) ) ) )
	{ 
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Email Address is Invalid");
		$("#login_errmsg_content").show();
	}
	else if($('#login_password').val() == '' )
	{ 
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Password is required");		
		$("#login_errmsg_content").show();	
	}
	
	 if ( $("#errorLoginFlag").val() == 1) return false;
	 else return true;
}
//End: Right nav validation
//Begin: User Contact
function validateContactForm() {	
	var regExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	$("#name_msg").html('');
	$("#email_msg").html('');
	$("#province_msg").html('');
	$("#confirm_email_msg").html('');
	$("#phone_msg").html('');
	$("#comment_type_msg").html('');
	$("#comment_msg").html('');
	
	$("#errorFlag").val(0);
	if($.trim($('#contactName').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#name_msg").html("* <br> Name is required");
		$("#name_msg").show();
	}	
	if($.trim($('#contactEmail').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#email_msg").html("* <br> Email is required");
		$("#email_msg").show();
	}	
	else if(!(regExp.exec($('#contactEmail').val()))) {
		$("#errorFlag").val(1);
		$("#email_msg").html("* <br> Email must be valid");
		$("#email_msg").show();
	}
	if($.trim($('#confirmemail').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#confirm_email_msg").html("* <br> Confirm Email is required");
		$("#confirm_email_msg").show();
	}	
	else if($.trim($('#contactEmail').val()) != $.trim($('#confirmemail').val()))
	{ 
		$("#errorFlag").val(1);
		$("#confirm_email_msg").html("* <br> Email and Confirm Email must be same");
		$("#confirm_email_msg").show();
	}	
	if($.trim($('#province').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#province_msg").html("* <br> Province is required");
		$("#province_msg").show();
	}	
	
	if($.trim($('#contactPhone').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#phone_msg").html("* <br> Phone # is required");
		$("#phone_msg").show();
	}	
	if($.trim($('#commenttype').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#comment_type_msg").html("* <br> Comment Type is required");
		$("#comment_type_msg").show();
	}	
	if($.trim($('#contactComment').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#comment_msg").html("* Comment is required");
		$("#comment_msg").show();
	}	
	 if ( $("#errorFlag").val() == 1) return false;
	else return true;
}
//End: User Contact


//Begin: Admin Login
function validateAdminLogin() {	
	$("#msg").html('');
	$("#username_msg").hide();
	$("#password_msg").hide();
	$("#errorFlag").val(0);
	if($.trim($('#username').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#username_msg").html("* Username is required");
		$("#username_msg").show();
	}	
	if($.trim($('#password').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#password_msg").html("* Password is required");
		$("#password_msg").show();
	}	
	 if ( $("#errorFlag").val() == 1) return false;
	else return true;
}
//End: Admin Login

//Begin: Admin Change Password
function validateChangePassword() {	
	$("#msg").html('');
	$("#username_msg").hide();
	$("#old_password_msg").hide();
	$("#new_password_msg").hide();
	
	$("#errorFlag").val(0);
	if($.trim($('#username').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#username_msg").html("* <br>Username is required");
		$("#username_msg").show();
	}	
	if($.trim($('#oldpassword').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#old_password_msg").html("* <br>Old Password is required");
		$("#old_password_msg").show();
	}	
	if($.trim($('#newpassword').val()) == '')
	{ 
		$("#errorFlag").val(1);
		$("#new_password_msg").html("* <br>New Password is required");
		$("#new_password_msg").show();
	}	
	if($.trim($('#confirmpassword').val()) == '')
	{ 
		$("#errorFlag").val(1);
		$("#confirm_password_msg").html("* <br>Confirm Password is required");
		$("#confirm_password_msg").show();
	}	
	if($.trim($('#newpassword').val()) != $.trim($('#confirmpassword').val()))
	{ 
		$("#errorFlag").val(1);
		$("#confirm_password_msg").html("* <br>New Password and Confirm Password must be same");
		$("#confirm_password_msg").show();
	}	
	 if ( $("#errorFlag").val() == 1) return false;
	  else 
	  {
	  $("#register").ajaxSubmit();
	  return true;
	  }
}
//End: Admin Change Password

//Begin: Admin Forgot Password
function validateForgotPassword() {	
	var regExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;	
	$("#email_msg").html('');	
	$("#msg").html('');	
	$("#errorFlag").val(0);
	if($.trim($('#email').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#email_msg").html(" Email is required");
		$("#email_msg").show();
	}	
	else if(!(regExp.exec($('#email').val()))) 
	{
		$("#errorFlag").val(1);
		$("#email_msg").html(" Email must be valid");
		$("#email_msg").show();
	}	
	 if ( $("#errorFlag").val() == 1) return false;
	else return true;
}
//End: Admin Forgot Password

//Begin: Admin General Setting
function validateGeneralSetting() {	
	var regExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;	
	$("#email_msg").html('*');	
	$("#site_title_msg").html('*');	
	$("#meta_title_msg").html('*');	
	$("#meta_description_msg").html('*');	
	$("#msg").html(' ');	
	$("#errorFlag").val(0);
	if($.trim($('#email').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#email_msg").html("* Email is required");
		$("#email_msg").show();
	}	
	else if(!(regExp.exec($('#email').val()))) 
	{
		$("#errorFlag").val(1);
		$("#email_msg").html("* Email must be valid");
		$("#email_msg").show();
	}	
	if($.trim($('#siteTitle').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#site_title_msg").html("* Site Title is required");
		$("#site_title_msg").show();
	}	
	if($.trim($('#metaTitle').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#meta_title_msg").html("* Meta Title is required");
		$("#meta_title_msg").show();
	}	
	if($.trim($('#metaDescription').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#meta_description_msg").html("* Meta Description is required");
		$("#meta_description_msg").show();
	}		
	if ( $("#errorFlag").val() == 1) return false;
	else return true;
}
//End: Admin General Setting

function employee_register_Validation()
{
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	var number_exp = /^[0-9]+$/;
	$("#fullname_errmsg").hide();
	$("#username_errmsg").hide();
	$("#email_errmsg").hide();
	$("#confirm_email_errmsg").hide();
	$("#password_errmsg").hide();
	$("#confirm_password_errmsg").hide();
	$("#homephone_errmsg").hide();
	$("#address_errmsg").show();
	$("#firstname_errmsg").hide();
	$("#cellphone_errmsg").hide();
	$("#province_errmsg").hide();
	$("#postalcode_errmsg").hide();
	$("#child_errmsg").hide();
	//$("#expectingbaby_errmsg").hide();
	$("#hourly_errmsg").hide();
	$("#monthly_errmsg").hide();
	$("#startdate_errmsg").hide();
	$("#work_errmsg").hide();	
	$("#jobres_errmsg").hide();
	$("#agree_errmsg").hide();
	$("#errorEmpRegFlag").val(0);
	if($('#full_name').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#fullname_errmsg").html("* Full Name is required");
		$("#fullname_errmsg").show();
	}
	if($('#user_name').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#username_errmsg").html("* Username is required");
		$("#username_errmsg").show();
	}
	if($('#employer_email').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#email_errmsg").html("* Email is required");
		$("#email_errmsg").show();
	}
	if( ($('#employer_email').val() != '' )&&( !(e.exec($('#employer_email').val() ) ) ) )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#email_errmsg").html("* Email is invalid");
		$("#email_errmsg").show();
	}
	if($('#confirm_email').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#confirm_email_errmsg").html("* Confirm Email is required");
		$("#confirm_email_errmsg").show();
	}
	if( ($('#confirm_email').val() != '' )&&( !(e.exec($('#confirm_email').val() ) ) ) )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#confirm_email_errmsg").html("* Confirm Email is invalid");
		$("#confirm_email_errmsg").show();
	}
	if(($('#confirm_email').val() != '' )&&($('#confirm_email').val() != $('#employer_email').val() ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#confirm_email_errmsg").html("* Email and Confirm Email doesn't match");
		$("#confirm_email_errmsg").show();
	}
	if($('#password').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#password_errmsg").html("* Password is required");
		$("#password_errmsg").show();
	}
	if($('#confirm_password').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#confirm_password_errmsg").html("* Confirm Password is required");
		$("#confirm_password_errmsg").show();
	}
	if(($('#confirm_password').val() != '' )&&($('#confirm_password').val() != $('#password').val() ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#confirm_password_errmsg").html("* Password and Confirm Password doesn't match");
		$("#confirm_password_errmsg").show();
	}
	if(($('#home_phone1').val() == '' )||($('#home_phone2').val() == '' )||($('#home_phone3').val() == '' ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#homephone_errmsg").html("* Home Phone is required");
		$("#homephone_errmsg").show();
	}
	if((($('#home_phone1').val() != '' )&&( !(number_exp.exec($('#home_phone1').val() ) ) )) || (($('#home_phone2').val() != '' )&&( !(number_exp.exec($('#home_phone2').val() ) ) ) ) || (($('#home_phone3').val() != '' )&&( !(number_exp.exec($('#home_phone3').val() ) ) )) )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#homephone_errmsg").html("* Home Phone is invalid");
		$("#homephone_errmsg").show();
	}
	
	/*if($('#cell_phone').val() == '' ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#cellphone_errmsg").html("* <br />Cell Phone is required");
		$("#cellphone_errmsg").show();
	}*/
	/*if(($('#cell_phone').val() != '' )&&( !(number_exp.exec($('#cell_phone').val() ) ) )) 
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#homephone_errmsg").html("* <br />Cell Phone is invalid");
		$("#homephone_errmsg").show();
	}*/
	if($('#address').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#address_errmsg").html("* Address is required");
		$("#address_errmsg").show();
	}
	if($('#city').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#city_errmsg").html("* City is required");
		$("#city_errmsg").show();
	}
	if($('#province').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#province_errmsg").html("* Province is required");
		$("#province_errmsg").show();
	}
	if($('#postal_code').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#postalcode_errmsg").html("* Postal Code is required");
		$("#postalcode_errmsg").show();
	}	
	if($('#no_of_children').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#child_errmsg").html("* Number of Children is required");
		$("#child_errmsg").show();
	}
	/*if($('#expecting_baby').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#expectingbaby_errmsg").html("* <br />This field is required");
		$("#expectingbaby_errmsg").show();
	}*/
	if(($('#min_hourly_wage_offer').val() == '' )||($('#max_hourly_wage_offer').val() == '' ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#hourly_errmsg").html("* <br> Hourly wage offered is required");
		$("#hourly_errmsg").show();
	}
	if(($('#max_monthly_gross_offer').val() == '' )||($('#max_monthly_gross_offer').val() == '' ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#monthly_errmsg").html("* <br> Monthly gross offered is required");
		$("#monthly_errmsg").show();
	}
	
	if($('#start_date').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#startdate_errmsg").html("* Start Date is required");
		$("#startdate_errmsg").show();
	}
	if($('#work_per_week').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#work_errmsg").html("* Hours of work is required");
		$("#work_errmsg").show();
	}
	if($('#job_responsibility').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#jobres_errmsg").html("* <br> Detail Job responsibility is required");
		$("#jobres_errmsg").show();
	}
	if (!$('#agree').is(':checked'))
	{
		$("#errorEmpRegFlag").val(1);
		$("#agree_errmsg").html("  (Please Agree Sitterscitycanada agreement)");
		$("#agree_errmsg").show();
	}
	if ( $("#errorEmpRegFlag").val() == 1) return false;
	else return true;
}

//Begin: Job seekers
function validateJobSeekers() {	
	
	var regExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;	
	var number_exp = /^[0-9]+$/;
	$("#first_name_msg").html('');	
	$("#last_name_msg").html('');	
	$("#street_msg").html('');	
	$("#city_msg").html('');	
	$("#province_msg").html('');	
	$("#postal_code_msg").html('');	
	$("#dob_msg").html('');	
	$("#username_msg").html('');	
	$("#password_msg").html('');	
	$("#confirm_password_msg").html('');	
	$("#email_msg").html('');	
	$("#confirm_email_msg").html('');		
	$("#primary_phone_msg").html('');
	/* $("#upload_photo_msg").html(''); */	
	$("#agree_errmsg").html('');	
	$("#hourlyrate_msg").html('');
	/* $("#work_experiance_msg").html(' '); */	
	/* $("#available_date_msg").html(' '); */
	/* $("#bio_detail_msg").html(' ');	 */
	$("#security_errmsg").html('');	
	$("#msg").html(' ');	
	$("#errorFlag").val(0);
	if($.trim($('#firstname').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#first_name_msg").html("* First name is required");
		$("#first_name_msg").show();
	}	
	if($.trim($('#lastname').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#last_name_msg").html("* Last name is required");
		$("#last_name_msg").show();
	}	
	if($.trim($('#street').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#street_msg").html("* Street address is required");
		$("#street_msg").show();
	}	
	if($.trim($('#city').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#city_msg").html("* City is required");
		$("#city_msg").show();
	}	
	if($.trim($('#province').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#province_msg").html("* Province is required");
		$("#province_msg").show();
	}	
	if($.trim($('#postalcode').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#postal_code_msg").html("* Postal Code is required");
		$("#postal_code_msg").show();
	}	
	if($.trim($('#month').val()) == '' || ($.trim($('#day').val()) == '') || ($.trim($('#year').val()) == ''))
	{ 
		$("#errorFlag").val(1);
		$("#dob_msg").html("* Date of birth is required");
		$("#dob_msg").show();
	}	
	
	if($.trim($('#username').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#username_msg").html("* User name is required");
		$("#username_msg").show();
	}	
	
	if($.trim($('#password').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#password_msg").html("* Password is required");
		$("#password_msg").show();
	}	
	if($.trim($('#confirmpassword').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#confirm_password_msg").html("* Confirm Password is required");
		$("#confirm_password_msg").show();
	}	
	else if($.trim($('#confirmpassword').val()) != $.trim($('#password').val()))
	{ 
		$("#errorFlag").val(1);
		$("#confirm_password_msg").html("* Password and Confirm Password must be same");
		$("#confirm_password_msg").show();
	}	
	if($.trim($('#email').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#email_msg").html("* Email is required");
		$("#email_msg").show();
	}	
	else if(!(regExp.exec($('#email').val()))) 
	{
		$("#errorFlag").val(1);
		$("#email_msg").html("* Email must be valid");
		$("#email_msg").show();
	}	
	if($.trim($('#confirmemail').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#confirm_email_msg").html("* Confirm email is required");
		$("#confirm_email_msg").show();
	}	
	else if($.trim($('#confirmemail').val()) != $.trim($('#email').val())) 
	{
		$("#errorFlag").val(1);
		$("#confirm_email_msg").html("* Email and Confirm email must be same");
		$("#confirm_email_msg").show();
	}		
	if(($.trim($('#primaryphone1').val()) == '' )||($.trim($('#primaryphone2').val()) == '' )||($.trim($('#primaryphone3').val()) == '' ))
	{ 
		$("#errorFlag").val(1);
		$("#primary_phone_msg").html("* Primary Phone is required");
		$("#primary_phone_msg").show();
	}
	if((($('#primaryphone1').val() != '' )&&( !(number_exp.exec($('#primaryphone1').val() ) ) )) || (($('#primaryphone2').val() != '' )&&( !(number_exp.exec($('#primaryphone2').val() ) ) ) ) || (($('#primaryphone3').val() != '' )&&( !(number_exp.exec($('#primaryphone3').val() ) ) )) )
	{ 
		$("#errorFlag").val(1);
		$("#primary_phone_msg").html("* Primary Phone is Invalid");
		$("#primary_phone_msg").show();
	}
	/*if(isNaN($.trim($('#primaryphone1').val())) == true )||(isNaN($.trim($('#primaryphone2').val())) == true )||(isNaN($.trim($('#primaryphone3').val())) == true ))
	{ 
		$("#errorFlag").val(1);
		$("#primary_phone_msg").html("* Phone number must be numeric");
		$("#primary_phone_msg").show();
	}	*/
	
	/*
if($.trim($('#upload_photo').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#upload_photo_msg").html("* Your photo is required");
		$("#upload_photo_msg").show();
	}
*/
	
	if($.trim($('#txtCaptcha').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#security_errmsg").html("* Security code is required");
		$("#security_errmsg").show();
	}
	if (!$('#agree').is(':checked'))
	{
	  	$("#errorFlag").val(1);
		$("#agree_errmsg").html("* Please accept Sitterscitycanada agreement");
		$("#agree_errmsg").show();
	}
	 
	if($.trim($('#minhourlyrate').val())!= '' || ($.trim($('#maxhourlyrate').val()) != ''))
	 {
		if ( !( number_exp.exec( $.trim($('#minhourlyrate').val()) ) )  || (!( number_exp.exec( $.trim($('#maxhourlyrate').val()) ) ))) 
		 {
			$("#errorFlag").val(1);
			$("#hourlyrate_msg").html("* Hourly rate must be numeric");
			$("#hourlyrate_msg").show();
		 } 
		else if(parseInt($.trim($('#minhourlyrate').val()))  > parseInt($.trim($('#maxhourlyrate').val())))
		 {
			$("#errorFlag").val(1);
			$("#hourlyrate_msg").html("* Hourly rate must be valid");
			$("#hourlyrate_msg").show();
		 } 
	}
	
	
	/*
if($.trim($('#workexperiance').val()) != '' )
	{ 
		var content = $.trim($('#workexperiance').text());
		var words	= content.split(' ');
		if(words.length > 2000) { 
			$("#errorFlag").val(1);
			$("#work_experiance_msg").html(" Content does not exceed 2000 words");
			$("#work_experiance_msg").show();
		}
	}
*/
	
	var curDate = new Date();
	month  = curDate.getMonth()+1;
	year   = curDate.getFullYear();
	day    = curDate.getDate();	
	/*
if(($.trim($('#availableyear').val()) == year))
	{
		if(($.trim($('#availablemonth').val()) < month))
		{
			$("#errorFlag").val(1);
			$("#available_date_msg").html("* <br />Available date must be valid");
			$("#available_date_msg").show();
		}
		else if(($.trim($('#availablemonth').val()) == month) && ($.trim($('#availableday').val()) < day))
		{
			$("#errorFlag").val(1);
			$("#available_date_msg").html("* <br />Available date must be valid");
			$("#available_date_msg").show();
		}
	}
*/
	/*
if($.trim($('#biodetail').val()) != '' )
	{ 
		var content = $.trim($('#biodetail').val());
		var words	= content.split(' ');	
		if(words.length > 300) { 
			$("#errorFlag").val(1);
			$("#bio_detail_msg").html(" Detail does not exceed 300 words");
			$("#bio_detail_msg").show();
		}
	}
*/
	if ( $("#errorFlag").val() == 1) return false;
	else return true;
}

function forgotValidation()
{
	var regExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;	
	$("#login_errmsg_content").hide();
	$("#errorLoginFlag").val(0);
	if($('#login_username').val() == '' )
	{ 
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Email Address is required");
		$("#login_errmsg_content").show();
	}
	else if(!(regExp.exec($('#login_username').val()))) 
	{
		$("#errorLoginFlag").val(1);
		$("#login_errmsg").html("* Email Address does not exist");
		$("#login_errmsg_content").show();
	}	
	if ( $("#errorLoginFlag").val() == 1) return false;
	else return true;
 }

//End: Admin General Setting
//Change Password
function ChangePassValidation()
{
	$("#old_pass_errmsg").hide();
	$("#new_pass_errmsg").hide();
	$("#confirm_pass_errmsg").hide();
	$("#errorPassFlag").val(0);
	if($('#old_password').val() == '' )
	{ 
		$("#errorPassFlag").val(1);
		$("#old_pass_errmsg").html("* Old Password is required");
		$("#old_pass_errmsg").show();
	}

	if($('#new_password').val() == '' )
	{ 
		$("#errorPassFlag").val(1);
		$("#new_pass_errmsg").html("* New Password is required");
		$("#new_pass_errmsg").show();
	}
	if($('#confirm_password').val() == '' )
	{ 
		$("#errorPassFlag").val(1);
		$("#confirm_pass_errmsg").html("* Confirm Password is required");
		$("#confirm_pass_errmsg").show();
	}
	else if($('#new_password').val() != $('#confirm_password').val())
	{ 
		$("#errorPassFlag").val(1);
		$("#confirm_pass_errmsg").html("* New and Confirm Password must be same");
		$("#confirm_pass_errmsg").show();
	}
	if ( $("#errorPassFlag").val() == 1) return false;
	else return true;
 }
 
 //Location validation
function locationValidation()
{
	$("#location_errmsg").hide();
	$("#zip_errmsg").hide();
	$("#address_errmsg").hide();
	$("#city_errmsg").hide(0);
	$("#province_errmsg").hide(0);
	$("#errorLocationFlag").val(0);
	if($('#location_name').val() == '' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#location_errmsg").html("* Location Name is required");
		$("#location_errmsg").show();
	}
	if($('#postal_code').val() == '' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#zip_errmsg").html("* Postal Code is required");
		$("#zip_errmsg").show();
	}
	if($('#address').val() == '' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#address_errmsg").html("* Address is required");
		$("#address_errmsg").show();
	}
	if($('#city').val() == '' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#city_errmsg").html("* City is required");
		$("#city_errmsg").show();
	}
	if($('#province').val() == '' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#province_errmsg").html("* Province is required");
		$("#province_errmsg").show();
	}
	
	if ( $("#errorLocationFlag").val() == 1) return false;
	else return true;
 }
 
 /* Mail box validation starts */
 function checkComposedMessage()
 {
	$("#errorLocationFlag").val(0);
	if($('#receiver').val() =='' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#receiver_msg").html("* To address is required");
		$("#receiver_msg").show();
	}	
	if($('#subject').val() =='' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#subject_errmsg").html("* Subject is required");
		$("#subject_errmsg").show();
	} 	
	if ( $("#errorLocationFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}
 }
  /* Mail box validation ends */
 
 
 /* Image Upload Validation start */
 
  function checkImageUpload1()
  {
  	$("#imagePartners_errmsg").hide();
	$("#imageLink_errmsg").hide();
	$("#imageFile_errmsg").hide();
  	var regExp = new RegExp();
	regExp.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
	
	$("#errorLocationFlag").val(0);
 	if($('#imagePartners').val() =='' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#imagePartners_errmsg").html("* Partner's name is required");
		$("#imagePartners_errmsg").show();
	}
   if($('#imageLink').val() =='' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#imageLink_errmsg").html("* Image link is required");
		$("#imageLink_errmsg").show();
	}
	else if(!(regExp.test($('#imageLink').val()))) {
		$("#errorLocationFlag").val(1);
		$("#imageLink_errmsg").html("* Url must be valid");
		$("#imageLink_errmsg").show();
	}
	if($('#imageFile').val() =='' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#imageFile_errmsg").html("* Select Image");
		$("#imageFile_errmsg").show();
	}
    if ( $("#errorLocationFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}
  }
  
  
  
  function checkImageUpload2()
  {
  	$("#imagePartners_errmsg").hide();
	$("#imageLink_errmsg").hide();
	
	$("#errorLocationFlag").val(0);
 	if($('#imagePartners').val() =='' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#imagePartners_errmsg").html("* Partner's name is required");
		$("#imagePartners_errmsg").show();
	}
	if($('#imageLink').val() =='' )
	{ 
		$("#errorLocationFlag").val(1);
		$("#imageLink_errmsg").html("* Image link is required");
		$("#imageLink_errmsg").show();
	}
    if ( $("#errorLocationFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}
  }  
  /* Image Upload Validation ends */
 
 
 // Post Job Validation start
 function validatePostJob(ref)
 {
 	$("#job_title_errmsg").hide();
	$("#postal_code_errmsg").hide();
	$("#date_job_errmsg").hide();
	$("#start_time_errmsg").hide();
	$("#end_time_errmsg").hide();
	$("#details_errmsg").hide();
	$("#rate_from_errmsg").hide();
	$("#rate_to_errmsg").hide();
	$("#duration_errmsg").hide();
	
 	$("#errorFlag").val(0);
	if($('#job_title').val() =='' )
	{ 
		$("#errorFlag").val(1);
		$("#job_title_errmsg").html("* Job title is required");
		$("#job_title_errmsg").show();
	}
	/*if($('#no_of_children').val() =='' )
	{ 
		
		$("#errorFlag").val(1);
		$("#children_num_errmsg").html("* Number of children is required");
		$("#children_num_errmsg").show();
	}
	if($('#child_age').val() =='' )
	{ 
		
		$("#errorFlag").val(1);
		$("#child_age_errmsg").html("* Age of child is required");
		$("#child_age_errmsg").show();
	}*/
	if($('#postal_code').val() =='' )
	{ 
		
		$("#errorFlag").val(1);
		$("#postal_code_errmsg").html("* Postal code is required");
		$("#postal_code_errmsg").show();
	}
	//alert(document.getElementById('frequency2').value);
	if (!$('#frequency1').is(':checked'))
	{ 
		if($('#date_job').val() =='' )
		{ 
			$("#errorFlag").val(1);
			$("#date_job_errmsg").html("* Date of job is required");
			$("#date_job_errmsg").show();
		}
		if($('#start_time').val() =='' )
		{ 
			$("#errorFlag").val(1);
			$("#start_time_errmsg").html("* Start date is required");
			$("#start_time_errmsg").show();
		}
		if($('#end_time').val() =='' )
		{ 
			$("#errorFlag").val(1);
			$("#end_time_errmsg").html("* Start time is required");
			$("#end_time_errmsg").show();
		}
	}
	if($('#details').val() =='' )
	{ 
		$("#errorFlag").val(1);
		$("#details_errmsg").html("* Detail is required");
		$("#details_errmsg").show();
	}
	
	var numeric 			= /^[0-9]+$/;		
	if(($('#rate_from').val() =='' )||($('#rate_to').val() =='' )||($('#duration').val() =='' ))
	{ 
		$("#errorFlag").val(1);
		$("#rate_from_errmsg").html("* Rate range is required");
		$("#rate_from_errmsg").show();
	}	
	else if ( !( numeric.exec( $('#rate_from').val() ) )  || (!( numeric.exec( $('#rate_to').val() ) ))) {
		$("#errorFlag").val(1);
		$("#rate_from_errmsg").html("* Rate must be numeric");
		$("#rate_from_errmsg").show();
	} else 	if(parseInt($('#rate_from').val()) > parseInt($('#rate_to').val())){
		$("#errorFlag").val(1);
		$("#rate_from_errmsg").html("* Rate must be valid");
		$("#rate_from_errmsg").show();
	}		
	if(ref == 2) {		
		if($('#txtCaptcha').val() =='' )
		{ 
			$("#errorFlag").val(1);
			$("#security_errmsg").html("* Security code is required");
			$("#security_errmsg").show();
		}
	}
	//alert($("#errorFlag").val());
	if ( $("#errorFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}
 }
 
 
 //Post Job Validation ends
 
 
 
 
 
function CheckSubscription()
{

	if((document.subscriptionform.SubscriptionAmount.value) == '')
	{
		alert('Provide amount value');
		document.subscriptionform.SubscriptionAmount.focus();
		return false;
	}
	else if(isNaN(document.subscriptionform.SubscriptionAmount.value))
	{
		alert('Provide valid amount');
		document.subscriptionform.SubscriptionAmount.focus();
		return false;
	}
	else
	  return true;	
} 


function ValidateManageAccount()
{	
	$("#fname_errmsg").hide();
	$("#lname_errmsg").hide();
	$("#bday_errmsg").hide();
	$("#gender_errmsg").hide();
	$("#email_errmsg").hide();
	$("#primary_phone_errmsg").hide();
	$("#errorFlag").val(0);
	
	if($('#fname').val() =='' )
			{ 
				$("#errorFlag").val(1);
				$("#fname_errmsg").html("* <br>First name is required");
				$("#fname_errmsg").show();
			}	
	if($('#lname').val() =='' )
			{ 
				$("#errorFlag").val(1);
				$("#lname_errmsg").html("* <br>Last name is required");
				$("#lname_errmsg").show();
			}
	if(($('#month').val() =='' )||($('#day').val() =='' )||($('#year').val() =='' ))
			{ 
				$("#errorFlag").val(1);
				$("#bday_errmsg").html("* <br>Birth date is required");
				$("#bday_errmsg").show();
			}
	if($('#gender').val() =='' )
			{ 
				$("#errorFlag").val(1);
				$("#gender_errmsg").html("* <br>Gender is required");
				$("#gender_errmsg").show();
			}
	if(($('#primary_pno1').val() =='' )||($('#primary_pno2').val() =='' )||($('#primary_pno3').val() =='' ))
			{ 
				$("#errorFlag").val(1);
				$("#primary_phone_errmsg").html("* <br>Primary phone number is required");
				$("#primary_phone_errmsg").show();
			}
	
	if ( $("#errorFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}	
	
}	

function checkForEmpty()
{
	var txt = document.forms.searchFunction.searchText.value;
	if(document.forms.searchFunction.searchText.value == 'Type here...')
	{
		alert('Search data is required');
		document.forms.searchFunction.searchText.focus();
		return false;
	}
	else if(txt.length<3)
	{
		alert('Search data require atleast 3 letters');
		document.forms.searchFunction.searchText.focus();
		return false;
	}	
	return true;
}

function checkCategoryStatus()
{
	if(document.forms.categoryStatusForm.category.value == '')
	{
		alert('Category is required');
		document.forms.categoryStatusForm.category.focus();
		return false;
	}
	if(isNaN(document.forms.categoryStatusForm.category.value) == false)
	{
		alert('Provide valid category');
		document.forms.categoryStatusForm.category.focus();
		return false;
	}
	if(document.forms.categoryStatusForm.status.value == '')
	{
		alert('Provide your status');
		document.forms.categoryStatusForm.status.focus();
		return false;
	}
	else
		return true;
}

function validateChildInfo(){
	/*var n=0; 
	var formString = document.forms.childInfoForm;
	if(formString.services.length==undefined)
	{
		if(formString.services.checked)
			n=1
	}
	else
	{
		for(i=0;i<formString.services.length;i++)
		{
			if(formString.services[i].checked)
			{
				n=1
			}
		}
	}
	if(n==0)
	{
		alert("Select atleast one of the services to classify")
		return false;		
	}
	*/	
	
	
	var numeric 			= /^[0-9]+$/;		
	var chargeFrom = document.getElementsByName("chargeFrom[]"); 		
	var chargeTo   = document.getElementsByName("chargeTo[]"); 	
	var duration   = document.getElementsByName("duration[]"); 	
	for (var i = 0; i < chargeFrom.length; i++) { 	  
		if(chargeFrom[i].value != '' || (chargeTo[i].value != '')){
			if ( !( numeric.exec( chargeFrom[i].value ) )  || (!( numeric.exec( chargeTo[i].value ) ))) {
				$("#charge_msg").html("* Charge must be numeric");
				return false;
			} else 	if(parseInt(chargeFrom[i].value) > parseInt(chargeTo[i].value)){
				$("#charge_msg").html("* Charge must be valid");
				return false;
			} else if(duration[i].value == ''){				
			 	$("#charge_msg").html("* Duration must be provided");
				return false;
			}
		} else {
			return true;
		}	
  	}		
}

//search validation
function home_search_validation()
{
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	var number_exp = /^[0-9]+$/;
	var dt = new Date();
	var y  = dt.getFullYear();
	var m  = dt.getMonth()+1;
	var d  = dt.getDate();
	$("#errmsg").hide();
	
	$("#searchErrorFlag").val(0);
	if(($('#looking_for').val() == '' )||($('#search_value').val() == '' ))
	{ 
		$("#searchErrorFlag").val(1);
		$("#errmsg").html("* All fields are required");
		$("#errmsg").show();
	}
	
	if ( $("#searchErrorFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}
}	

// Validation for Refer a friend
function checkFriendReffered()
{
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	$("#email_errmsg").hide();
	$("#errorFlag").val(0);
	if($('#emailfriend').val() == '')
	{ 
		$("#errorFlag").val(1);
		$("#email_errmsg").html("* Email Id is required");
		$("#email_errmsg").show();
	}
	if( ($('#emailfriend').val() != '') && (!(e.exec($('#emailfriend').val()))))
	{ 
		$("#errorFlag").val(1);
		$("#email_errmsg").html("* Email Address is Invalid");
		$("#email_errmsg").show();
	}
	if ( $("#errorFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}
}

//Validation for Capabilities, skills & talents

function checkValidationForCapabilities()
{
	
	var n=0; 
	var formString = document.forms.childInfoForm;
	if(formString.capabilities.length==undefined)
	{
		if(formString.capabilities.checked)
			n=1
	}
	else
	{
		for(i=0;i<formString.capabilities.length;i++)
		{
			if(formString.capabilities[i].checked)
			{
				n=1
			}
		}
	}
	if(n==0)
	{
		alert("Select atleast one of the Capabilities")
		return false
	}
	
}	


function checkValidationForSkills()
{
	
	var n=0; 
	var formString = document.forms.childInfoForm;
	if(formString.skills.length==undefined)
	{
		if(formString.skills.checked)
			n=1
	}
	else
	{
		for(i=0;i<formString.skills.length;i++)
		{
			if(formString.skills[i].checked)
			{
				n=1
			}
		}
	}
	if(n==0)
	{
		alert("Select atleast one of the Skills")
		return false
	}
	
}	

function checkValidationForSpecialNeeds()
{
	
	var n=0; 
	var formString = document.forms.childInfoForm;
	if(formString.specialNeeds.length==undefined)
	{
		if(formString.specialNeeds.checked)
			n=1
	}
	else
	{
		for(i=0;i<formString.specialNeeds.length;i++)
		{
			if(formString.specialNeeds[i].checked)
			{
				n=1
			}
		}
	}
	if(n==0)
	{
		alert("Select atleast one of the Special Needs")
		return false
	}
	
}	

function checkValidationForTalents()
{
	
	var n=0; 
	var formString = document.forms.childInfoForm;
	if(formString.Talents.length==undefined)
	{
		if(formString.Talents.checked)
			n=1
	}
	else
	{
		for(i=0;i<formString.Talents.length;i++)
		{
			if(formString.Talents[i].checked)
			{
				n=1
			}
		}
	}
	if(n==0)
	{
		alert("Select atleast one of the Talents")
		return false
	}
	
}	


function checkValidationForEmailSettings()
{
	var n=0; 
	var formString = document.forms.manage_email;
	if(formString.manage_mail1.checked || (formString.manage_mail2.checked) || (formString.manage_mail3.checked)) {
			n=1
	}
	if(n==0)
	{
		alert("Select atleast one of the communication preferences")
		return false
	}
}	

//Begin:Saved and Blocked members
function validateMember() {
	$("#username_msg").hide();
	$("#errorFlag").val(0);
	if($('#uname').val() == '')
	{ 
		$("#errorFlag").val(1);
		$("#username_msg").html("* Username is required");
		$("#username_msg").show();
	}
	if ( $("#errorFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}
}
//End:Saved and Blocked members

// Validation for cover letter starts
function coverLetter1()
{
	$("#coverLetter_errmsg").hide();
	$("#errorFlag").val(0);
	if($('#coverLetter').val() == '')
	{ 
		$("#errorFlag").val(1);
		$("#coverLetter_errmsg").html("* Message is required");
		$("#coverLetter_errmsg").show();
	}
	if ( $("#errorFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}
}
//Validation for cover letter ends
function setrating(returnval)
{
	var valid =true;
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	var number_exp = /^[0-9]+$/;
   if(document.forms.ratingfrm.rating.value=="")
		{
			alert("Select the Rating");
			document.forms.ratingfrm.rating.focus();
			return false;
		}
	else if(document.forms.ratingfrm.user_name.value=="")
		{
			alert("Enter the Name");
			document.forms.ratingfrm.user_name.select();
			return false;
		}
	else if(document.forms.ratingfrm.user_email.value=="")
		{
			
			alert("Enter the Email");
			document.forms.ratingfrm.user_email.select();
			return false;
		}
	else if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.forms.ratingfrm.user_email.value)))
	    {
			alert("Enter the valid Email");
			document.forms.ratingfrm.user_email.select();
			return false;
		}
	else if(document.forms.ratingfrm.comment.value=="")
		{
			
			alert("Enter the Comments");
			document.forms.ratingfrm.comment.select();
			return false;
		}
	else {
		$.ajax({
			type: "GET",
			url : "index.php?dr=CareProfile&page=rating_ajax",
			data: "membid="+document.getElementById('membid').value+"&yourname="+document.getElementById('user_name').value+"&youremail="+document.getElementById('user_email').value+"&rating="+document.getElementById('rating').value+"&comment="+document.getElementById('comment').value,
			
			success: function(res)
			{ 
			 if(res==1)
			 {
			  if(returnval==2)
			  	location.href="index.php?dr=CareProfile&page=view_care_profile&msg=1&type="+document.getElementById('typeval').value+"&id="+document.getElementById('membid').value;
			  else if(returnval==1)
			    location.href="index.php?dr=CareProfile&page=job_seeker_view_profile&msg=1&type="+document.getElementById('typeval').value+"&id="+document.getElementById('membid').value;	
			 } 
			}
		});
	
	}
}


function checkGiftCertificate()
{
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	$("#to_errmsg").hide();
	$("#from_errmsg").hide();
	$("#message_errmsg").hide();
	$("#errorFlag").val(0);
	if($('#to').val() == '')
	{ 
		$("#errorFlag").val(1);
		$("#to_errmsg").html("* To Email Address is required");
		$("#to_errmsg").show();
	}
	if( ($('#to').val() != '' )&&( !(e.exec($('#to').val() ) ) ) )
	{ 
		$("#errorFlag").val(1);
		$("#to_errmsg").html("* Email Address is Invalid");
		$("#to_errmsg").show();
	}
	if($('#from').val() == '')
	{ 
		$("#errorFlag").val(1);
		$("#from_errmsg").html("* From Email Address is required");
		$("#from_errmsg").show();
	}
	if( ($('#from').val() != '' )&&( !(e.exec($('#from').val() ) ) ) )
	{ 
		$("#errorFlag").val(1);
		$("#from_errmsg").html("* Email Address is Invalid");
		$("#from_errmsg").show();
	}
	if($('#message').val() == '')
	{ 
		$("#errorFlag").val(1);
		$("#message_errmsg").html("* Message is required");
		$("#message_errmsg").show();
	}
	if ( $("#errorFlag").val() == 1)  {
		return false;
	}else {
		return true;
	}

}

function showPhoto(photocount)
{
	document.getElementById('largeimage').src = photocount;		
}


// Validation for edit job seeker in admin starts
function validateAdminJobSeekers()
{
	var regExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;	
	var number_exp = /^[0-9]+$/;
	$("#first_name_msg").html('');	
	$("#last_name_msg").html('');	
	$("#street_msg").html('');	
	$("#city_msg").html('');	
	$("#province_msg").html('');	
	$("#postal_code_msg").html('');	
	$("#dob_msg").html('');	
	$("#primary_phone_msg").html('');	
	$("#work_experiance_msg").html(' ');	
	$("#available_date_msg").html(' ');
	$("#bio_detail_msg").html(' ');	
	$("#errorFlag").val(0);
	
	if($.trim($('#firstname').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#first_name_msg").html("* <br> First name is required");
		$("#first_name_msg").show();
	}	
	if($.trim($('#lastname').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#last_name_msg").html("* <br> Last name is required");
		$("#last_name_msg").show();
	}	
	if($.trim($('#street').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#street_msg").html("* <br> Street address is required");
		$("#street_msg").show();
	}	
	if($.trim($('#city').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#city_msg").html("* <br> City is required");
		$("#city_msg").show();
	}	
	if($.trim($('#province').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#province_msg").html("* <br> Province is required");
		$("#province_msg").show();
	}	
	if($.trim($('#postalcode').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#postal_code_msg").html("* <br> Postal Code is required");
		$("#postal_code_msg").show();
	}	
	if($.trim($('#month').val()) == '' || ($.trim($('#day').val()) == '') || ($.trim($('#year').val()) == ''))
	{ 
		$("#errorFlag").val(1);
		$("#dob_msg").html("* <br> Date of birth is required");
		$("#dob_msg").show();
	}	
	if(($.trim($('#primaryphone1').val()) == '' )||($.trim($('#primaryphone2').val()) == '' )||($.trim($('#primaryphone3').val()) == '' ))
	{ 
		$("#errorFlag").val(1);
		$("#primary_phone_msg").html("* <br> Primary Phone is required");
		$("#primary_phone_msg").show();
	}
	if((($('#primaryphone1').val() != '' )&&( !(number_exp.exec($('#primaryphone1').val() ) ) )) || (($('#primaryphone2').val() != '' )&&( !(number_exp.exec($('#primaryphone2').val() ) ) ) ) || (($('#primaryphone3').val() != '' )&&( !(number_exp.exec($('#primaryphone3').val() ) ) )) )
	{ 
		$("#errorFlag").val(1);
		$("#primary_phone_msg").html("* <br> Primary Phone is Invalid");
		$("#primary_phone_msg").show();
	}
	/*if(isNaN($.trim($('#primaryphone1').val())) == true )||(isNaN($.trim($('#primaryphone2').val())) == true )||(isNaN($.trim($('#primaryphone3').val())) == true ))
	{ 
		$("#errorFlag").val(1);
		$("#primary_phone_msg").html("* Phone number must be numeric");
		$("#primary_phone_msg").show();
	}	*/
	
	if($.trim($('#workexperiance').val()) != '' )
	{ 
		var content = $.trim($('#workexperiance').text());
		var words	= content.split(' ');
		if(words.length > 2000) { 
			$("#errorFlag").val(1);
			$("#work_experiance_msg").html(" <br> Content does not exceed 2000 words");
			$("#work_experiance_msg").show();
		}
	}
	var curDate = new Date();
	month  = curDate.getMonth()+1;
	year   = curDate.getFullYear();
	day    = curDate.getDate();	
	if(($.trim($('#availableyear').val()) == year))
	{
		if(($.trim($('#availablemonth').val()) < month))
		{
			$("#errorFlag").val(1);
			$("#available_date_msg").html("* <br />Available date must be valid");
			$("#available_date_msg").show();
		}
		else if(($.trim($('#availablemonth').val()) == month) && ($.trim($('#availableday').val()) < day))
		{
			$("#errorFlag").val(1);
			$("#available_date_msg").html("* <br />Available date must be valid");
			$("#available_date_msg").show();
		}
	}
	if($.trim($('#biodetail').val()) != '' )
	{ 
		var content = $.trim($('#biodetail').val());
		var words	= content.split(' ');		
		if(words.length > 300) { 
			$("#errorFlag").val(1);
			$("#bio_detail_msg").html(" <br> Detail does not exceed 300 words");
			$("#bio_detail_msg").show();
		}
	}
	if ( $("#errorFlag").val() == 1) return false;
	else return true;
}
// Validation for edit job seeker in admin ends


// Validation for edit care seeker in admin starts
function validateAdminCareSeekers()
{
	var regExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;	
	var number_exp = /^[0-9]+$/;
	$("#firstname_errmsg").html('');	
	$("#lastname_errmsg").html('');	
	$("#address_errmsg").html('');	
	$("#city_errmsg").html('');	
	$("#postcode_errmsg").html('');	
	$("#primarypno_errmsg").html('');	
	$("#errorFlag").val(0);
	
	if($.trim($('#first_name').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#firstname_errmsg").html("* <br> First name is required");
		$("#firstname_errmsg").show();
	}	
	if($.trim($('#last_name').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#lastname_errmsg").html("* <br> Last name is required");
		$("#lastname_errmsg").show();
	}	
	if($.trim($('#address').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#address_errmsg").html("* <br> Address is required");
		$("#address_errmsg").show();
	}	
	if($.trim($('#city').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#city_errmsg").html("* <br> City is required");
		$("#city_errmsg").show();
	}	
	if($.trim($('#postal_code').val()) == '' )
	{ 
		$("#errorFlag").val(1);
		$("#postcode_errmsg").html("* <br> Postal Code is required");
		$("#postcode_errmsg").show();
	}	
	if(($.trim($('#primary_pno1').val()) == '' )||($.trim($('#primary_pno2').val()) == '' )||($.trim($('#primary_pno3').val()) == '' ))
	{ 
		$("#errorFlag").val(1);
		$("#primarypno_errmsg").html("* <br> Primary Phone is required");
		$("#primarypno_errmsg").show();
	}
	if((($('#primary_pno1').val() != '' )&&( !(number_exp.exec($('#primary_pno2').val() ) ) )) || (($('#primary_pno3').val() != '' )&&( !(number_exp.exec($('#primary_pno1').val() ) ) ) ) || (($('#primary_pno2').val() != '' )&&( !(number_exp.exec($('#primary_pno3').val() ) ) )) )
	{ 
		$("#errorFlag").val(1);
		$("#primarypno_errmsg").html("* <br> Primary Phone is Invalid");
		$("#primarypno_errmsg").show();
	}
	/*if(isNaN($.trim($('#primaryphone1').val())) == true )||(isNaN($.trim($('#primaryphone2').val())) == true )||(isNaN($.trim($('#primaryphone3').val())) == true ))
	{ 
		$("#errorFlag").val(1);
		$("#primary_phone_msg").html("* Phone number must be numeric");
		$("#primary_phone_msg").show();
	}	*/
	if ( $("#errorFlag").val() == 1) return false;
	else return true;
}
// Validation for edit care seeker in admin ends


// Validation for edit trial member in admin starts
function validateAdminTrialUsers()
{
	var e=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,4}$/;
	var number_exp = /^[0-9]+$/;
	$("#fullname_errmsg").hide();
	$("#username_errmsg").hide();
	$("#email_errmsg").hide();
	$("#confirm_email_errmsg").hide();
	$("#password_errmsg").hide();
	$("#confirm_password_errmsg").hide();
	$("#homephone_errmsg").hide();
	$("#address_errmsg").show();
	$("#firstname_errmsg").hide();
	$("#cellphone_errmsg").hide();
	$("#province_errmsg").hide();
	$("#postalcode_errmsg").hide();
	$("#child_errmsg").hide();
	//$("#expectingbaby_errmsg").hide();
	$("#hourly_errmsg").hide();
	$("#monthly_errmsg").hide();
	$("#startdate_errmsg").hide();
	$("#work_errmsg").hide();	
	$("#jobres_errmsg").hide();
	$("#agree_errmsg").hide();
	$("#errorEmpRegFlag").val(0);
	
	if($('#full_name').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#fullname_errmsg").html("* <br />Full Name is required");
		$("#fullname_errmsg").show();
	}
	
	if($('#employer_email').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#email_errmsg").html("* <br />Email is required");
		$("#email_errmsg").show();
	}
	if( ($('#employer_email').val() != '' )&&( !(e.exec($('#employer_email').val() ) ) ) )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#email_errmsg").html("* <br />Email is invalid");
		$("#email_errmsg").show();
	}
	
	if(($('#home_phone1').val() == '' )||($('#home_phone2').val() == '' )||($('#home_phone3').val() == '' ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#homephone_errmsg").html("* <br />Home Phone is required");
		$("#homephone_errmsg").show();
	}
	if((($('#home_phone1').val() != '' )&&( !(number_exp.exec($('#home_phone1').val() ) ) )) || (($('#home_phone2').val() != '' )&&( !(number_exp.exec($('#home_phone2').val() ) ) ) ) || (($('#home_phone3').val() != '' )&&( !(number_exp.exec($('#home_phone3').val() ) ) )) )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#homephone_errmsg").html("* <br />Home Phone is invalid");
		$("#homephone_errmsg").show();
	}
	
	/*if($('#cell_phone').val() == '' ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#cellphone_errmsg").html("* <br />Cell Phone is required");
		$("#cellphone_errmsg").show();
	}*/
	/*if(($('#cell_phone').val() != '' )&&( !(number_exp.exec($('#cell_phone').val() ) ) )) 
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#homephone_errmsg").html("* <br />Cell Phone is invalid");
		$("#homephone_errmsg").show();
	}*/
	if($('#address').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#address_errmsg").html("* <br />Address is required");
		$("#address_errmsg").show();
	}
	if($('#city').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#city_errmsg").html("* <br />City is required");
		$("#city_errmsg").show();
	}
	if($('#province').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#province_errmsg").html("* <br />Province is required");
		$("#province_errmsg").show();
	}
	if($('#postal_code').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#postalcode_errmsg").html("* <br />Postal Code is required");
		$("#postalcode_errmsg").show();
	}
	if($('#no_of_children').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#child_errmsg").html("* <br />Number of Children is required");
		$("#child_errmsg").show();
	}
	/*if($('#expecting_baby').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#expectingbaby_errmsg").html("* <br />This field is required");
		$("#expectingbaby_errmsg").show();
	}*/
	if(($('#min_hourly_wage_offer').val() == '' )||($('#max_hourly_wage_offer').val() == '' ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#hourly_errmsg").html("* <br />Hourly wage offered is required");
		$("#hourly_errmsg").show();
	}
	if(($('#max_monthly_gross_offer').val() == '' )||($('#max_monthly_gross_offer').val() == '' ))
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#monthly_errmsg").html("* <br />Monthly gross offered is required");
		$("#monthly_errmsg").show();
	}
	
	if($('#start_date').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#startdate_errmsg").html("* <br />Start Date is required");
		$("#startdate_errmsg").show();
	}
	if($('#work_per_week').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#work_errmsg").html("* <br />Hours of work is required");
		$("#work_errmsg").show();
	}
	if($('#job_responsibility').val() == '' )
	{ 
		$("#errorEmpRegFlag").val(1);
		$("#jobres_errmsg").html("* <br />Detail Job responsibility is required");
		$("#jobres_errmsg").show();
	}
	if ( $("#errorEmpRegFlag").val() == 1) return false;
	else return true;
}
// Validation for edit trial member in admin ends

function validatePostalCode(postalId) {
	if($('#'+postalId).val() != '' )
	{ 	
		postalCode = $('#'+postalId).val();
		if(postalCode.length == 6) {
			value = postalCode.substring(0, 3) + ' ' + postalCode.substring(3);
			$('#'+postalId).val(value);			
		} 		
	}
}

function checkValidateDate() {
	
	//expyear.removeClass('ui-state-error');
	//expmonth.removeClass('ui-state-error');
	return true;
}

function checkRatingsUpdate()
{
	if(document.getElementById('ratings').value == '')
	{
	alert('Enter the rating');
	document.getElementById('ratings').focus();
	return false;
	}
}

//Vaildation for credit card details myaccount info
function ValidateCreditCard()
{
	var dt = new Date();
	var y  = dt.getFullYear();
	var m  = dt.getMonth()+1;
	$("#fname_errmsg").hide();
	$("#lname_errmsg").hide();
	$("#credit_errmsg").hide();
	$("#verification_errmsg").hide();
	$("#expiry_errmsg").hide();
	$("#address_errmsg").hide();
	$("#city_errmsg").hide();
	$("#state_errmsg").hide();
	$("#postal_errmsg").hide();
	if($('#fname').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#fname_errmsg").html("* First Name is required");
		$("#fname_errmsg").show();
	}
	if($('#lname').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#lname_errmsg").html("* Last Name is required");
		$("#lname_errmsg").show();
	}
	if($('#credit_card').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#credit_errmsg").html("* Credit Card Number is required");
		$("#credit_errmsg").show();
	}
	if($('#verification').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#verification_errmsg").html("* Verification is required");
		$("#verification_errmsg").show();
	}
	if(($('#exp_month').val() == '' )||($('#exp_year').val() == '' ))
	{ 
		$("#errorFlag").val(1);
		$("#expiry_errmsg").html("* Expiration Date is required");
		$("#expiry_errmsg").show();
	}
	if (($('#exp_month').val() < m)&&($('#exp_year').val() <= y))
	{ 
		$("#errorFlag").val(1);
		$("#expiry_errmsg").html("* Expiration Date is invalid");
		$("#expiry_errmsg").show();
	}
	if($('#exp_year').val() < y)
	{ 
		$("#errorFlag").val(1);
		$("#expiry_errmsg").html("* Expiration year is invalid");
		$("#expiry_errmsg").show();
	}
	if($('#street_address').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#address_errmsg").html("* Address is required");
		$("#address_errmsg").show();
	}
	if($('#city').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#city_errmsg").html("* City is required");
		$("#city_errmsg").show();
	}
	if($('#state').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#state_errmsg").html("* State is required");
		$("#state_errmsg").show();
	}
	if($('#postal_code').val() == '' )
	{ 
		$("#errorFlag").val(1);
		$("#postal_errmsg").html("* Postal Code is required");
		$("#postal_errmsg").show();
	}
	if ( $("#errorFlag").val() == 1) return false;
	 else return true;
}
