window.onload = function(e) {

    try
    {
        document.execCommand("BackgroundImageCache", false, true);
    }
    catch(err){}

};

$(document).ready(function() { 
    
    //jQuery(".date_calendar").dynDateTime({showsTime: true, ifFormat: "%d.%m.%Y %H:%M", button: ".next()"}); 
    
    $("a.lightbox").lightBox('', $('#baseUrl').text()); 
    
    setInterval( "slideSwitch()", 6000 );
    
    var tmp = $('.tooltip_info').each(function(index)
    {
       var head = $(this).find('.head').text();
       var content = $(this).find('.cont').text();
       
        $(this).easyTooltip({
            xOffset: 0, yOffset: 10, tooltipId: "xtip",
            content: '<div class="head">'+head+'</div>' + 
                '<div class="cont">'+content+'</div>'
        });
    }); 
});

function slideSwitch() {
    var $active = $('#demomenu IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#demomenu IMG:first');

    if($next.width() == 280)
        $next = $('#demomenu IMG:first');
        
    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 2500, function() {
            $active.removeClass('active last-active');
        });
}
