jQuery.noConflict();

jQuery(document).ready(function($){

    $('form p.robot').hide();
        
    if(document.getElementById('ficheOnglets')) { ONGLETS_Gestion('h3'); } 
    
    $('#menuPlan').hide();

    $('#footer #menuFooter .plan a').click(function(){
        $(this).toggleClass('actif');
        $('#menuPlan').toggle();
        this.blur();
        return false;
    }); 
    
    $("#menu>ul>li").hover(
        function () {
            $(this).addClass('hovered');
            $('.hovered>.sMenu:hidden').slideDown('normal');
        },
        function () {
            $('.hovered>.sMenu:visible').slideUp('fast');
            $(this).removeClass('hovered');
        }
    );
    
    $('#miniHotel img').hover(
    	function () {
    		var srcOld = $('#imgHotel').attr('src');
    		var srcNew = $(this).attr('src');
    		srcNew = srcNew.replace('/mini','');
    		$('#imgHotel').attr('src',srcNew);
    		$(this).attr('src',srcOld);
    	}
    );
    
    $('#miniHotel1 img').hover(
    	function () {
    		var srcOld = $('#imgHotel1').attr('src');
    		var srcNew = $(this).attr('src');
    		srcNew = srcNew.replace('/mini','');
    		$('#imgHotel1').attr('src',srcNew);
    		$(this).attr('src',srcOld);
    	}
    );

    function filInfos(infos) {
    
        var height = 32;/*$('.listeInfos p').height();*/
        var nombreItem = $('.listeInfos p').length;
        var reference = referenceInit = 3;
        var animationActive = false;
        
        $('.scrollInfosBas', infos).click(function () { 
            if(reference < nombreItem && animationActive == false) {
                animationActive = true;
                var deplacement = parseInt($('.blocInfos .listeInfos').css('top').split('px')) - height;
                deplacement += 'px';
                $('.blocInfos .listeInfos').animate({ 
                    top: deplacement
                    }, 200, function() { animationActive = false; }
                );
                reference++;
            }
            return false;
        });
        $('.scrollInfosHaut', infos).click(function () { 
            if(reference > referenceInit && animationActive == false) {
                animationActive = true;
                var deplacement = parseInt($('.blocInfos .listeInfos').css('top').split('px')) + height;
                deplacement += 'px';
                $('.blocInfos .listeInfos').animate({ 
                    top: deplacement
                    }, 200, function() { animationActive = false; } 
                );
                reference--;
            }
            return false;
        });
    }
    filInfos('.blocInfos');

    /* lightbox Actu brèves */
    $("#content .blocInfos p a").click(function(){
        $("#blocInfosDesc").show();
        indexPara = $(this).parent().prevAll().length;
        $("#blocInfosDesc p:eq("+indexPara+")").show();
        this.blur();
        return false;
    });
    
    $("#blocInfosDesc .fermer a").click(function(){
        $(this).parent().parent().hide();
        $("#blocInfosDesc p").hide();
        this.blur();
        return false;
    });
    
    
    if ( $('#interstitielOrange').length )
    {
        $('#interstitielOrange,#overlayInterstitiel').show();
        //$('select').hide();
        $('#overlayInterstitiel').click(function(){
            $('#interstitielOrange,#overlayInterstitiel').hide();
            //$('select').show();
            return false;
        });
        //window.setTimeout(function() {$('#interstitielOrange,#overlayInterstitiel').fadeOut();}, 10000);        
    }
    
});

    
