$(document).ready(function () {
        var url = 'get.php';  				
		
$('#categories').change(function () {
        var id = $(this).val();
        $('#show').attr('disabled', true);

        $("#info").animate({ opacity: "hide" }, "slow");
		$("#info1").animate({ opacity: "hide" }, "slow");
		
        if (id == '0') {		
		
            $('#show').html('<option value="0">Выберите мероприятие...</option>');
            return(false);
        }
        $('#show').html('<option>загрузка...</option>');
        $.get(
            url,
            "id_cat=" + id,
            function (result) {
                if (result == 'error') {
                    $('#show').html('<option>Ошибка!</option>');
                    return(false);
                }
                else {
                    $('#show').html(result);
                    $('#show').attr('disabled', false);		
				}
            },
            "html"
        );
    });
	
$('#show').change(function () {
        var id = $(this).val();	
		 
		 
		 
		  $("#info").animate({ opacity: "show" }, "slow"); 
		  $("#info1").animate({ opacity: "show" }, "slow"); 
		
		if (id == '0') {
		        
				
				$("#info").animate({ opacity: "hide" }, "slow");
				$("#info1").animate({ opacity: "hide" }, "slow");
		
         //   $('#info').html(' <legend>Выберите дату</legend> выберите мероприятие...');
		//	 $('#info1').html('<legend>Желаемые места </legend>выберите мероприятие...');
            return(false);
        }
		
        $('#info').html('загрузка...');
		$('#info1').html('загрузка...');
		
        $.get(
            url,
            "id_type=" + id,
            function (result) {
                if (result == 'error') {
                 //   $('#info').html('Нет пердставлений');
                    return(false);
                }
                else {

                    $('#info').html(result);
						

				}
            },
            "html"
        );
		
		$.get(
            url,
            "id_show=" + id,
            function (result) {
                if (result == 'error') {
                 //   $('#info1').html('Нет пердставлений');
                    return(false);
                }
                else {
                    $('#info1').html(result);
						

				}
            },
            "html"
        );
		
    });

});
