
function show(pk){

    $("ul.menu6-inner").hide()
    $("#"+pk).show()

}

function ser_actions(){
    var ser_form = $('.m-fomr');
    var ul_contacts = $('.managers-in-country ul.contacts');
    if (ser_form.css('display') == 'none'){
        ser_form.show(300);
        ul_contacts.hide(300);
    }
    else{
        ser_form.hide(300);
        ul_contacts.show(300);
    }
}

    
function ser_actions_hotels(){
    var ser_form = $('.m-fomr');
    var ser_form_bottom = $('#search_bot');
    var ul_contacts = $('.managers-in-country ul.contacts');
    if (ul_contacts.css('display') == 'none'){
        ser_form.hide(300);
        ser_form_bottom.hide(300);
        ul_contacts.show(300);
        $('.zag-m-form').css('margin-bottom', '-10px');
    }
    else{
    ser_form.show(300);
        ser_form_bottom.show(300);
        ul_contacts.hide(300);
        $('.zag-m-form').css('margin-bottom', '0');
    }
}
    
$(document).ready(function(){


	$("#id_region").change(function(){
        if ($('#id_region').val() != "")
        {
            $('#id_country').find('option').remove().end()
            $('#id_country').load('/catalog/serv/region-'+$('#id_region').val()+'/')
            $('#id_country').attr("disabled", "")
        }
        else
        {
            $('#id_country').find('option').remove().end().append('<option value="">СТРАНА</option>');
            $('#id_country').attr('disabled', 'disabled')
            $('#id_resort').find('option').remove().end().append('<option value="">КУРОРТ</option>');
            $('#id_resort').attr('disabled', 'disabled')
        }
	});


	$("#id_country").change(function(){
        if ($('#id_country').val() != "")
        {
            $('#id_resort').find('option').remove().end()
            $('#id_resort').load('/catalog/serv/guide-resort-'+$('#id_country').val()+'/')
            $('#id_resort').attr("disabled", "")
        }
        else
        {
            $('#id_resort').find('option').remove().end().append('<option value="">КУРОРТ</option>');
            $('#id_resort').attr('disabled', 'disabled')
        }
	});
    

    $("#id_resort").change(function(){
        if ($('#id_resort').val() != "")
        {
            $('#id_go').attr("disabled", "")
        }
        else
        {
            $('#id_go').attr('disabled', 'disabled')
        }
	});

    
    $("#id_go").click(function(){
        if ($('#id_resort').val() != "")
        {
            window.location = "/resort/" + $('#id_resort').val() + ".html"
        }
		return false;
    });
    
    
});
