﻿$(document).ready(function() {

    showBG();

    // $("#menu_body1").css("visibility", "hidden");
    //$("#menu_bottom1").css("visibility", "hidden");
    $("#menu_body1").animate({ opacity: 0 }, 0);
    $("#menu_bottom1").animate({ opacity: 0 }, 0);

    $("#menu_head1").hover(function() {
        showBG('show');
        $("#menu_award1").hide();
        $("#menu_body1").animate({ opacity: 1 }, { queue: false, duration: 300 });
        $("#menu_bottom1").animate({ opacity: 1 }, { queue: false, duration: 300 });
    }, function() {
        showBG();
        $("#menu_award1").show();
        $("#menu_body1").animate({ opacity: 0 }, { queue: false, duration: 300 });
        $("#menu_bottom1").animate({ opacity: 0 }, { queue: false, duration: 300 });
    })

    $("#menu_body2").animate({ opacity: 0 }, 0);
    $("#menu_bottom2").animate({ opacity: 0 }, 0);

    $("#menu_head2").hover(function() {
        $("#menu_award2").hide();
        $("#flashCover").animate({ opacity: 2 }, { queue: false, duration: 300 });
        $("#menu_body2").animate({ opacity: 2 }, { queue: false, duration: 300 });
        $("#menu_bottom2").animate({ opacity: 2 }, { queue: false, duration: 300 });
    }, function() {
        $("#menu_award2").show();
        $("#flashCover").animate({ opacity: 0 }, { queue: false, duration: 300 });
        $("#menu_body2").animate({ opacity: 0 }, { queue: false, duration: 300 });
        $("#menu_bottom2").animate({ opacity: 0 }, { queue: false, duration: 300 });
    })

    $("#menu_body3").animate({ opacity: 0 }, 0);
    $("#menu_bottom3").animate({ opacity: 0 }, 0);

    $("#menu_head3").hover(function() {
        $("#menu_award3").hide();
        $("#flashCover").animate({ opacity: 3 }, { queue: false, duration: 300 });
        $("#menu_body3").animate({ opacity: 3 }, { queue: false, duration: 300 });
        $("#menu_bottom3").animate({ opacity: 3 }, { queue: false, duration: 300 });
    }, function() {
        $("#menu_award3").show();
        $("#flashCover").animate({ opacity: 0 }, { queue: false, duration: 300 });
        $("#menu_body3").animate({ opacity: 0 }, { queue: false, duration: 300 });
        $("#menu_bottom3").animate({ opacity: 0 }, { queue: false, duration: 300 });
    })


    /*$("#menu_body1").animate({ opacity: 0}, 0);
    $("#menu_bottom1").animate({ opacity: 0 }, 0);
    showBG();


    $("#menu_head1").hover(function() {
    showBG('show');
    $("#menu_bottom1").animate({ opacity: 1 }, 0);
    $("#menu_award1").hide();
    $("#menu_body1").animate({ opacity: 1 }, 0);
    }, function() {
    showBG()
    $("#menu_body1").animate({ opacity: 0 },0);
    $("#menu_bottom1").animate({ opacity: 0 }, 0);
    $("#menu_award1").show();

    });

    $("#menu_body2").animate({ height: 'hide' }, 0);
    $("#menu_bottom2").animate({ opacity: 0 }, 0);
    showBG();
    $("#menu_head2").hover(function() {
    showBG('show');
    $("#menu_bottom2").animate({ opacity: 1 }, 0);
    $("#menu_award2").hide();
    $("#menu_body2").animate({ height: 'show' }, { queue: true, duration: 500 });
    }, function() {
    showBG();
    $("#menu_body2").animate(
    { height: 'hide' }, { queue: true, duration: 500, complete: function() {
    $("#menu_bottom2").animate({ opacity: 0 }, 0);
    $("#menu_award2").show();
    }
    }
    );
    });

    $("#menu_body3").animate({ height: 'hide' }, 0);
    $("#menu_bottom3").animate({ opacity: 0 }, 0);
    showBG();
    $("#menu_head3").hover(function() {
    showBG('show');
    $("#menu_bottom3").animate({ opacity: 1 }, 0);
    $("#menu_award3").hide();
    $("#menu_body3").animate({ height: 'show' }, { queue: true, duration: 500 });
    }, function() {
    showBG();
    $("#menu_body3").animate(
    { height: 'hide' }, { queue: true, duration: 500, complete: function() {
    $("#menu_bottom3").animate({ opacity: 0 }, 0);
    $("#menu_award3").show();
    }
    }
    );
    });

*/
});

function showBG(status) {
    if (status == 'show') {
        $("#flashCover").show();
        $("#flashCover").css({ "z-index": " 99" });

    } else {
    $("#flashCover").hide();
        $("#flashCover").css({ "z-index": " -1" });
    }

}

