$(document).ready(function() {
      
      function addMega()
      {
        $(this).addClass("hovering");
         
        // if(isLoggedIn() == false)
		
            initPopupOverlay();
      }

      function removeMega()
      {
        $(this).removeClass("hovering");
        
        //if(isLoggedIn() == false)
            deinitPopupOverlay();
      }

    var megaConfig = {
         interval: 50,
         sensitivity: 4,         
         over: addMega,
		 timeout: 50,
         out: removeMega
		
    };

    $("li.mega").hoverIntent(megaConfig)
	
	$('ul.site_menu li').hover(function () {
		 
         $(this).addClass("hover");

        }, function() {
           
           $(this).removeClass("hover");

        });

      
    });

function initPopupOverlay()
{
    var overlayObj = $('.popup-overlay-black');
    adjustWidthHeightOverlay(overlayObj);	
    $(overlayObj).show();
}


function deinitPopupOverlay()
{
    var overlayObj = $('.popup-overlay-black');
    $(overlayObj).hide();
}

function adjustWidthHeightOverlay(overlayObj)
{
    $(overlayObj).css("width",  $(document).width()   + "px");
    $(overlayObj).css("height",  $(document).height()  + "px");
}
