$(document).ready(function(){
	$(document).on('change',"#stateName",function() {

			var countryID			 =   $('#countryID').val();
			var stateID  			 = $('#stateID').val();
			var check=0;
			var stateName  			 =  $.trim($(this).val());			
			if(stateName!=''){
			$.ajax({
				  type: "POST",
				  async:false,
				  url: GLOBAL_BASE_PATH+"/state/ajaxStateExist/",
				  data: "countryID="+countryID+"&stateName="+stateName+"&stateID="+stateID,
				  success: function(msg){
					  if(msg=="1"){
						  $('#validateStateName').val(1);
					  } else if(msg=="0"){
						  $('#validateStateName').val(0);
					  }
			  }
			});
		  }	else{
			   $('#validateStateName').val(0);
		  }
		  $("#validateStateName").trigger('blur');
		
});
$(document).on('change',"#stateShortName",function() {
	 
			var countryID			 =   $('#countryID').val();
			var stateID  			 = $('#stateID').val();
			var check=0;
			var stateShortName  			 =  $.trim($(this).val());
			if(stateShortName!=''){
			$.ajax({
				  type: "POST",
				  async:false,
				  url: GLOBAL_BASE_PATH+"/state/ajaxStateExist/",
				  data: "countryID="+countryID+"&stateShortName="+stateShortName+"&stateID="+stateID,
				  success: function(msg){  
					  if(msg>0){
						  $('#validateStateShortName').val(1);
					  } else if(msg==0){
						  $('#validateStateShortName').val(0);
					  }
			  }
			});
		  }	else{
			     $('#validateStateShortName').val(0);
		  }
		   $("#validateStateShortName").trigger('blur');
});


});