$(document).ready(function(){
	$("#save_info").click(function(){
		var gender = $("#gender").val();
		var day = $("#day").val();
		var year = $("#year").val();
		var month = $("#month").val();
		var country = $("#country").val();
		var city = $("#select_city").val();
		
		butloading('save_info', '55', 'disabled', '');
		$.post('/index.php?go=editprofile&act=save_information', {gender: gender, day: day, month: month, year: year, country: country, city: city}, function(data){
			$('#info_save').hide();
			if(data == 'ok'){
				$('#info_save').show();
				$('#info_save').html(lang_infosave);
			} else {
				$('#info_save').show();
				$('#info_save').html(data);
			}
			butloading('save_info', '55', 'enabled', lang_box_save);
		});
	});
});
function CheckLength(name, infoname, num){
	var xname = $('#'+name).val().length;
	var valname = $('#'+name).val();
	if(xname >= num){
		$('#'+infoname).html('');
		var errors = 0;
	} else {
		$('#'+infoname).html('<span class="form_error">Не менее '+num+' символов</span>');
		$('#'+name).css('background', '#ffefef');	
		var errors = 1;
	}
	a = errors;
	return a;
}
function isValidName(xname){
	var pattern = new RegExp(/^[a-zA-Zа-яА-Я]+$/);
 	return pattern.test(xname);
}