$(document).ready( function(){
	//$("#country_id").addOption(countries, false);
	$("#country").removeOption(/./);
	$("#region").removeOption(/./);
	$("#country").ajaxAddOption("/ajax/countries_list/", false, false);
	$('#region').append( new Option('Other','null') );
	$("#country").change(function () {
		$("#region").removeOption(/./);
		$("#region").ajaxAddOption("/ajax/region_list/" + $('#country').val(), false, false);
		$('#region').append( new Option('Other','null') );
	});
	$("#button").click(function () {
		$.getJSON('/ajax/get_tariff_guide/' + $('#country').val() + '/' + $('#region').val(), function(data) {
			//alert(data.toSource());
			$('#country_code').val(data.country_code);
			$('#region_code').val(data.region_code);
			$('#idd_fixed_standard').val(data.idd_fixed_standard);
			$('#idd_fixed_cheap').val(data.idd_fixed_cheap);
			$('#idd_mobile_standard').val(data.idd_mobile_standard);
			$('#idd_mobile_cheap').val(data.idd_mobile_cheap);
			$('#voip_landline').val(data.voip_landline);
			$('#voip_mobile').val(data.voip_mobile);
		});
	});
});

