Ext.onReady(function(){
    function close_opened(){
        $("#open").fadeOut('normal');
        $("#city_list_closed").hide();
        $("#city_list_open").show();
    }
    function open_closed(){
        $("#open").fadeIn('normal');
        $("#city_list_closed").show();
        $("#city_list_open").hide();
    }
    $("#city_list_closed").bind('click' , function(){
        close_opened();
    });
    $("#city_list_open").bind('click' , function(){
        open_closed();
    });
    $("#city-select").show();
    $("#open").hide();
    $("#city_list_closed").hide();
    $("#city_list_open").show();
    
    $("#pop_event").each(function(){
        var fader = this;
        $(this).hide();
        $("a[href=/cp/events/new/]").bind('click' , function(){
            
            $(fader).fadeIn('normal');
            return false;
        });
        
        $(this).find(".x-pop").bind('click' , function(){
            $(fader).fadeOut('normal');
            return false;
        });
    })

});
