// <![CDATA[

var NESPRESSO_ACADEMY_VAR = 'NespressoAcademy';

( function( $ )
{
    
    if( !window[ NESPRESSO_ACADEMY_VAR ] ) {
        
        window[ NESPRESSO_ACADEMY_VAR ] = {};
    }
    
    var NA        = window[ NESPRESSO_ACADEMY_VAR ],
        $langItem = null,
        $dropDown = null;
    
    function _showDropDown( event )
    {
        $dropDown.slideDown( 'fast' );
    }
    
    function _hideDropDown( event )
    {
        $dropDown.slideUp( 'fast' );
    }
    
    function menu()
    {
        $langItem = $( '#header-menu-lang-choose > LI' );
        $dropDown = $( '#header-menu-lang-dropdown' );
        
        if( !$langItem.length || !$dropDown.length ) {
            
            return;
        }
        
        $dropDown.css( 'marginLeft', '-35px' );
        
        $langItem.hoverIntent( {
            over     : _showDropDown,
            out      : _hideDropDown,
            interval : 100,
            timeout  : 100
        } );
        
    }
    
    function registration()
    {
        var $reg = $( '#registration' );
        
        if( !$reg.length || !$reg.fancybox ) {
            
            return;
        }
        
        $( '#registration' ).fancybox( {
            hideOnContentClick : false,
            frameHeight        : 550
        } );
    }
    
    window[ NESPRESSO_ACADEMY_VAR ].countryMenu = {
        show : _showDropDown,
        hide : _hideDropDown
    };
    
    $( menu );
    $( registration );
    
} )( jQuery );

// ]]>