var hide_menu = false;
$(document).ready(function() {
    $('.shadow').css ({
        marginLeft: '-3px',
        width: '956px',
        opacity: 0.5,
        backgroundColor: '#000'
    });
    $('.shadow .shadow').css ({
        marginLeft: '1px',
        width: '954px'
    });
});
function showMenu (num) {
    var h;
    hide_menu = false;

    if ($('#PopupMenu').css('display') == 'block' && $('#PopupMenu').html() == $('#PopupMenu' + num).html()) {
        return;
    }
    $('.shadow').remove();
    $('#PopupMenu').hide().html($('#PopupMenu' + num).html()).show();
    for (i=5;i>0;i--) {
        h = parseInt($('#PopupMenu').height()) + 40 + i;
        $('<div class="shadow" style="position: absolute;top:202px;margin-left:' + (90-i) + 'px;width:' + (967 + i*2) + 'px;height:' + h + 'px;background-color:#000"></div>').css('opacity', 0.1).appendTo('#MainContainer');
    }
}
function hideMenu () {
    hide_menu = true;
    setTimeout('hideMenuProcess()', 500);
}
function hideMenuProcess () {
    if (!hide_menu) return;
    $('.shadow').remove();
    $('#PopupMenu').hide();//.fadeOut('fast', function() { $(this).html('') });
}
function hideNow() {
    $('.shadow').remove();
    $('#PopupMenu').hide();
}