$(document).ready(function(){
  
    // Popup
    $('.fancybox').fancybox({
        frameWidth : 792,
        frameHeight : 560,
        hideOnContentClick : false
    });
  
    /* MENU */
    $("li.dichvutext").mouseover(function() { //When trigger is clicked...
        //Following events are applied to the subnav itself (moving subnav up and down)
        //Drop down the subnav on click
        $(this).parent().find("ul.subnav").css('visibility', 'visible');

        $(this).parent().hover(function() {
            }, function(){
                //When the mouse hovers out of the subnav, move it back up
                $(this).parent().find("ul.subnav").css('visibility', 'hidden');
            });

    //Following events are applied to the trigger (Hover events for the trigger)
    }).hover(function() {
        $(this).addClass("subhover"); //On hover over, add class "subhover"
    }, function(){	//On Hover Out
        $(this).removeClass("subhover"); //On hover out, remove class "subhover"
        $(this).find("ul.subnav").css('visibility', 'hidden');
    });

    // Search box label show / hide
    $("#search-box, #search-label").hover(
        function () {
            $("#search-label").hide();
        });
  
    if ($('#search-box').val().length > 0) $("#search-label").hide();

/* SCROLL TO */
/*
 $.each(['nhacchuong', 'hinhanh', 'themes', 'games'], function (i, session) {   
   $('#nav .' + session).click( function (event) {
     var id = $('#nav .' + session+' a').attr("id");
     var curr = $('#nav .' + session+' a').attr("curr");
     if(id == curr || curr=="all"){
        $(window).scrollTo('#' + session + '-session', 'slow');
     }else{
         window.location.href="index.php?type="+id;
     }
     event.preventDefault();
   });
 });
*/
 
});

