$(document).ready(function(){
    $.preloadImages('/style/images/abouton.gif', 
                    '/style/images/kabbuton.gif',
                    '/style/images/serviceon.gif', 
                    '/style/images/connecton.gif',
                    '/style/images/foruseron.gif',
                    '/style/images/resbuton.gif',
                    '/style/images/forbuton.gif'
    );
    
    $('.menuhead').hover(
        function() { $('ul', this).css('display', 'block'); },
        function() { $('ul', this).css('display', 'none'); }
    );
    
    $("#menu-about").hover(
        function() { $("#menu-about a img").attr('src', '/style/images/abouton.gif'); },
        function() { $("#menu-about a img").attr('src', '/style/images/about.gif'); }
    );
    $("#menu-service").hover(
        function() { $("#menu-service a img").attr('src', '/style/images/serviceon.gif'); },
        function() { $("#menu-service a img").attr('src', '/style/images/service.gif'); }
    );
    $("#menu-connect").hover(
        function() { $("#menu-connect a img").attr('src', '/style/images/connecton.gif'); },
        function() { $("#menu-connect a img").attr('src', '/style/images/connect.gif'); }
    );
    $("#menu-abonentam").hover(
        function() { $("#menu-abonentam a img").attr('src', '/style/images/foruseron.gif'); },
        function() { $("#menu-abonentam a img").attr('src', '/style/images/foruser.gif'); }
    );
    
    $("#resources-ql").hover(
        function() { $(this).attr('src', '/style/images/resbuton.gif'); },
        function() { $(this).attr('src', '/style/images/resbut.gif'); }
    );
    $("#forum-ql").hover(
        function() { $(this).attr('src', '/style/images/forbuton.gif'); },
        function() { $(this).attr('src', '/style/images/forbut.gif'); }
    );
    $("#kabinet").hover(
        function() { $(this).attr('src', '/style/images/kabbuton.gif'); },
        function() { $(this).attr('src', '/style/images/kabbut.gif'); }
    );
    
    $("#left_menu li a").hover(
        function() { $(this).parent('li').find('img').attr('src', '/style/images/navibut_on.gif'); },
        function() { $(this).parent('li').find('img').attr('src', '/style/images/navibut_off.gif'); }
    );

    $("#feedback").hover(
        function() { $("#feedback a img").attr('src', '/images/feedback_anim.gif'); },
        function() { $("#feedback a img").attr('src', '/images/feedback.gif'); }
    );

    $("#computer-help").hover(
        function() { $("#computer-help a img").attr('src', '/images/help_banner_anim.gif'); },
        function() { $("#computer-help a img").attr('src', '/images/help_banner.gif'); }
    );



    
    $("#jet40").tooltip({ 
    bodyHandler: function() { 
        return '<div id="box"><div id="box_top"></div><div id="box_content" align="center"><div style="color:#fe7d14;padding-right:21px;padding-top:11px;padding-bottom:11px;">В период времени с 3:00 до 15:00 на тарифном плане «Джет 40» действует неограниченная скорость!</div></div><div id="box_bottom"></div></div>';
    }, 
        showURL: false,
        track: true,
        delay: 0, 
        fade: 250,       
        left: 5,
        top: 5
    });

    $('.soap').spemail('|,:','mailbase');
    
    $("a.fancybox").fancybox({padding:0, zoomSpeedIn:500, zoomSpeedOut:500});
});

$.preloadImages = function() 
{
    for (var i = 0; i < arguments.length; i++) 
    {
        img = new Image();
        img.src = arguments[i];
    }
}
