function getOblasts(callback){
	showSpinner(1);
	$('.location_select').html('');
	$('.oblast_select').load('/regions/oblasts', {id: $('.region_select').val()},function(){
	
		if(jQuery.isFunction(callback))
			callback.call();		
		hideSpinner(1);
	});    
}

function getLocations(callback){
	showSpinner(2);
	$.get('/locations', {oblast_id: $('.oblast_select').val(), country_id: $('.country_select').val()},function(data){
	
		$('.location_select').html(data);
		if(jQuery.isFunction(callback))
			callback.call();	
		hideSpinner(2);
	
	},'text');   
}
///////////////////////////
// function getOblasts(){
// 	showSpinner(1);
// 	$('.oblast_select').load('/regions/oblasts', {id: $('.region_select').val()}, function(){hideSpinner(1);});
// 	update_new_location_oblast();
// }
// function getLocations(){
// 	showSpinner(2);
// 	$.get('/locations', {oblast_id: $('.oblast_select').val()},function(data){$('.location_select').html(data);hideSpinner(2);},'text');   
// }

function update_new_location_oblast(){
	// alert($('.oblast_select').val());
	$('#location_oblast_id').val($('.oblast_select').val());
	$('#location_country_id').val($('.country_select').val());
}

function showSpinner(number){
	$('#spinner-'+number).show();
}

function hideSpinner(number){
	$('#spinner-'+number).hide();
}

function clearAdditionsForms(){
	
};

function addNewLocation(){
	$('#spinner-location').show();
	$('#new_location').show();
  $('#new_location').load('/locations/new');
	
}