/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

window.addEvent('domready', function() {
    var globalNode = $('global');



    /**
     * Positionne correctement les annimations sur le logo
     */
    window.onresize = function() {
        if(innerWidth <= 1024) {
            document.getElementById('animation1').style.visibility='hidden';
            document.getElementById('animation2').style.visibility='hidden';
        }
        else {
            document.getElementById('animation1').style.visibility='visible';
            document.getElementById('animation2').style.visibility='visible';
        }
    };




    /**
     * Initialisation du champs de recherche
     */
    if (false) {
        var rechercheBoxTextDefaut = 'Rechercher...';
        var rechercheBox = $('rechercheBox');
        var rechercheSubmitButton = $('rechercheSubmit');

        rechercheSubmitButton.set('value', ' ');

        if (rechercheBox.get('value') == '') {
            rechercheBox.set('value', rechercheBoxTextDefaut);
        }

        rechercheBox.addEvent('focus', function() {
            if (rechercheBox.get('value') == rechercheBoxTextDefaut) {
                rechercheBox.set('value', '');
            }
        });

        rechercheBox.addEvent('blur', function() {
            if (rechercheBox.get('value') == '') {
                rechercheBox.set('value', rechercheBoxTextDefaut);
            }
        });
    }
    
    //sert à traquer les clics sur la barre de slide
    window.traceGA = function (titre,id)
    {
        _gaq.push(['_trackEvent', 'Sliders', 'Clic', titre, id]);
    }
});
