jQuery(function(){
    if (document.getElementById('content')) {
        
        var arrContentInfos = new Array();
        arrContentInfos['accueil'] = 0;          
        arrContentInfos['creations'] = 990;
        arrContentInfos['formation'] = 1980;
        arrContentInfos['maintenance'] = 2970;
        arrContentInfos['contact'] = 3960;
        arrContentInfos['coordonnees'] = 4950;
        
        var strQueryString = document.location.href.split('#')[1];
        if (strQueryString != undefined) {
            posX = arrContentInfos[strQueryString];
        }
        else {
            posX = 0;
        }
        /* Fonctions pour tous les navigateurs sauf IE */
        if (!jQuery.browser.msie)
        {
            jQuery("a.lien_slide").click(function(){
                jQuery("#content").animate({opacity: 0.5}, 200).animate({ 
                    opacity: 0.5,
                    marginLeft: (posX - arrContentInfos[jQuery(this).attr('href').split('#')[1]]) +"px"
                  }, 500 ).animate({opacity: 1}, 200);   
                return false;
            });    
        }
        /* Fonctions spéciales pour IE*/
        else
        {
             jQuery("a.lien_slide").click(function(){  
                var adresse = jQuery(this).attr('href').split('#')[1];            

                jQuery("#content .arrondi").fadeTo(200, 0.5);
                jQuery("#content").delay(200).animate({marginLeft: (posX - arrContentInfos[adresse]) +"px"}, 500, function(){
                    jQuery("#content .arrondi").fadeTo(200, 1,  function(){
                        this.style.removeAttribute("filter");        /* Empeche le bug d'affichage des polices sous IE */
                    });
                }); 
                return false;
            });    
        }
    }
});

