$(document).ready(function(){

    // epxplore bar

    $('#explore-show-button').click(function(){
        $(this).slideUp("fast");
        $('#explore-box').slideDown("fast").addClass('open');
        $('#explore-hide-button').fadeIn("fast");
    });

    $(document).keypress(function(e){
        var code = (e.keyCode ? e.keyCode : e.which);
        if (code == 27 && $('#explore-box').is('.open') ){
            $('#explore-hide-button').fadeOut("fast");
            $('#explore-box').slideUp("fast").removeClass('open');
            $('#explore-show-button').slideDown("fast");
        }
    });

    $('#explore-hide-button').click(function(){
        $(this).fadeOut("fast");
        $('#explore-box').slideUp("fast").removeClass('open');
        $('#explore-show-button').slideDown("fast");
    });

    $('#explore-detail .percent-table tr').hover(
    function(){
        $(this).find('th a').css({'color':"#CFEAFA"});
        $(this).find('.percent-bar').css({'background-color':"#CFEAFA"});
        $(this).find('.percent-count').css({"visibility":"visible"});
    },
    function(){
        $(this).find('th a').css({'color':"#FFFFFF"});
        $(this).find('.percent-bar').css({'background-color':"#7B977B"});
        $(this).find('.percent-count').css({"visibility":"hidden"});
    }).click(function(){
        window.location = $(this).find('a').attr('href');
        return false;
    });

    $('#explore-box').hide();

});
