Index = {};

Index.ready = function() {
    //***************************************** TEST.PHP ***********************************************************//
    if($(document).belongTo('bannerArea').length > 0){
       

        bnr = $('.ep_banner').epBanner({fadeDuration: 500, showDuration: 3000, height: $('#bannerArea').height(),
                                        width: $('#bannerArea').width()});
    }
    //effettuo lo stop e seleziono l'immagine giusta del banner
    $('.trentoBox').mouseenter(function(){
       bnr[0].stop();
       $('.selected').css('display', 'none');
       $('.selected').removeClass('transtime_10').removeClass('selected');
       $('#trento').parent().parent().addClass('transtime_10 selected');
       $('#trento').parent().parent().css('display', 'block');
       $('.bannerLayer').css('display', 'block');
    });
    //faccio ripartire il banner
    $('.trentoBox').mouseleave(function(){
       $('.bannerLayer').css('display', 'none');
       bnr[0].start();
    });

    $('.pergineBox').mouseenter(function(){
        bnr[0].stop();
       $('.selected').css('display', 'none');
       $('.selected').removeClass('transtime_10').removeClass('selected');
       $('#pergine').parent().parent().addClass('transtime_10 selected');
       $('#pergine').parent().parent().css('display', 'block');
       $('.bannerLayer').css('display', 'block');
    });

    $('.pergineBox').mouseleave(function(){
        $('.bannerLayer').css('display', 'none');
        bnr[0].start();
    });

    $('.prestigioBox').mouseenter(function(){
       bnr[0].stop();
       $('.selected').css('display', 'none');
       $('.selected').removeClass('transtime_10').removeClass('selected');
       $('#prestigio').parent().parent().addClass('transtime_10 selected');
       $('#prestigio').parent().parent().css('display', 'block');
       $('.bannerLayer').css('display', 'block');
    });

    $('.prestigioBox').mouseleave(function(){
        $('.bannerLayer').css('display', 'none');
        bnr[0].start();
    });

}

$(document).ready(function(){
    if($(this).belongTo('bannerArea').length > 0)
        Index.ready();
});
