function get_city() {	
	var country = $('#country option:selected').val();
	$("#select_city").load("/ajax/regions/getcity/"+country);
	//get_metro();
}
function get_metro() {	
	var city = $('#city option:selected').val();
	$("#select_metro").load("/ajax/regions/getmetros/"+city);
}
function get_subrubrics_bus() {	
	var pid = $('#pid option:selected').val();
	$("#select_subrics_bus").load("/ajax/rubrics/getbusiness/"+pid);
}
function err(text){
	$('#errors').html('<font color="#CC0000"><b>Найдена ошибка</b></font><br>'+text+'<br>');
	$('#errors').css('display', 'block');
}
function isValidEmail (email, strict)
{
 if ( !strict ) email = email.replace(/^\s+|\s+$/g, '');
 return (/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(email);
}
function is_int(integer){
	return (/^([0-9]+)/).test(integer);	
}
function check_antibot(){
	  if($('#antibot').val().length != 4) {
	    err('Длинна слова должна быть 4 символа');
	  } else {
	    $.get("/ajax/catalog/antibot/"+$('#antibot').val(), function(data){
	   
	      
	     if(data == 1) {
			$('#img_antibot').html('успешно!');
			$('#errors').css('display', 'none');
			$('#description_add').css('display', 'none');
			$('#submit_form').removeAttr("disabled");
		 } else {
			 err('неправильный код с картинки');
		}
	    })
	  }
	}
