var opened_reg_description = '#start';
function reg_description(field_name) {
	$(opened_reg_description).hide();
	opened_reg_description = '#descr_'+field_name; 
	$(opened_reg_description).fadeIn();
	
}

function overlay(){
	$('#over_layer').css("width", $(document).width()+'px')
					.css( "height", $(document).height()+'px');
	$('#over_layer').toggle();
}

function log_in_form(){
	overlay();
	$('#auth_container').css("left", ($(document).width()/2 - 210)   + 'px');
	$('#auth_container').toggle();
}


function log_in(){
	$("input[name='from']").val(document.location);
	thistime = $("input[name='thistime']").val();
	newpassword = sha256Hash(sha256Hash(hex_md5( $("input[name='password']").val() )) + thistime);
	
	/* For authorization in old id.uz IDUZOLD*/
	var oldpass = hex_md5(hex_md5($("input[name='password']").val()) + $("input[name='num']").val());
	$("input[name='passwd']").val(oldpass);
	/* End old id.uz*/
	
	$("input[name='password']").val(newpassword);
}

function get_born_regions(countryId) {
	$('#born_region_list').load(site_url+'cabinet/profile/edit/get_born_regions/'+countryId);
	$('#born_location_submit').hide();
}

function get_born_cities(regionId) {
	$('#born_city_list').load(site_url+'cabinet/profile/edit/get_born_cities/'+regionId);
	$('#born_location_submit').hide();
}

function get_live_regions(countryId) {
	$('#live_region_list').load(site_url+'cabinet/profile/edit/get_live_regions/'+countryId);
	$('#live_location_submit').hide();
}

function get_live_cities(regionId) {
	$('#live_city_list').load(site_url+'cabinet/profile/edit/get_live_cities/'+regionId);
	$('#live_location_submit').hide();
}

