jQuery.noConflict();
var currentCssLeft = "50%";
var currentCssMarginLeft = "-700px"; 

jQuery(document).ready(function(){
	
	ReCenterSite();
	
    jQuery(window).bind('resize', function() {
   		ReCenterSite();
	});   
    
    
	// RS >> déplier un article au clic d'une ancre avec id
	if (document.location.hash != "" && document.location.href.indexOf("Nosservices.html") != -1)
	{
		var idDoc = document.location.hash.substring(1);
		setTimeout(function() { jQuery("#bt_show_article_"+idDoc).click(); }, 500);
		
	}
	
	
/* LANGUAGE TRANSLATION */
	jQuery.translate.ready(function(){		
		//alert("ready to translate");
		if (tradToLang != "")
		{
			//alert("traduction en "+tradToLang);
			jQuery('body').translate(tradToLang, {
				complete: function(){				
					DisplaySite();
					
					ReCenterSite();
					
				    jQuery(window).bind('resize', function() {
				   		ReCenterSite();
					});
					
			    }
			});
		}
		else
		{
			DisplaySite();
			
			ReCenterSite();
			
		    jQuery(window).bind('resize', function() {
		   		ReCenterSite();
			});
		}
		
	});

	
});



function DisplaySite()
{
	//return;
	//ApplySIFR();
	jQuery("#loading").hide();
	jQuery("#container").css("visibility", "visible");
}


function ReCenterSite()
{
	if ( jQuery('body').width() < 990)
	{
		jQuery('#page').css("left", "-80px");
		jQuery('#page').css("margin-left", "-80px");
	}
	else if ( jQuery('body').width() > 990)
	{
		jQuery('#page').css("left", currentCssLeft);
		jQuery('#page').css("margin-left", currentCssMarginLeft);
		jQuery('body').css("overflow-x","hidden");
	}
}
