jQuery(document).ready(function(){
   
  //ACTU 
  jQuery("#content .summaryPost .bt_fulldesc").click(function () {		
    	var showType = jQuery(this).attr("type");
		var docid = jQuery(this).attr("article");
    	
    	jQuery("#footer1").css("visibility", "hidden");    	
    	jQuery("#plain_" + docid).toggle('middle', function() {    		
    		jQuery("#footer1").css("visibility", "visible");
    		
    		// switcher le bouton show/hide
    		if (showType == "show")
    		{
    			jQuery("#bt_show_article_"+docid).hide();
    			jQuery("#bt_hide_article_"+docid).show();
    		}
    		else
    		{
    			jQuery("#bt_show_article_"+docid).show();
    			jQuery("#bt_hide_article_"+docid).hide();
    		}    		
    		ResizeSiteHeight();
    	});    	
    }); 
   
   //HOVER BOUTON HEADER

	    jQuery("#content1").mouseenter(function(){
	        jQuery(this).find("#content_hover").animate({ right: "0px"}, 350 );
	        jQuery(this).css("cursor", "pointer");
	    }).mouseleave(function(){	        
	        jQuery(this).find("#content_hover").animate({ right: "250px"}, 250 );
	    }).click(function(){
	        document.location.href="Entreprisesmoinsde50Salaries.html";     
	    });
	    
	    jQuery("#content2").mouseenter(function(){
	        jQuery(this).find("#content_hover").animate({ right: "0px"}, 350 );
	        jQuery(this).css("cursor", "pointer");
	    }).mouseleave(function(){	        
	        jQuery(this).find("#content_hover").animate({ right: "250px"}, 250 );
	    }).click(function(){
	        document.location.href="CEetComitesduvresSociales.html";     
	    }); 
	    
	    jQuery("#content3").mouseenter(function(){
	        jQuery(this).find("#content_hover").animate({ right: "0px"}, 350 );
	        jQuery(this).css("cursor", "pointer");
	    }).mouseleave(function(){	        
	        jQuery(this).find("#content_hover").animate({ right: "250px"}, 250 );
	    }).click(function(){
	        document.location.href="Avantagespourvotreboutique.html";     
	    });  
  
  ResizeSiteHeight();
  DisplaySite();
    // modif RS >> initialiser un lightbox
	SexyLightbox.initialize({
        find		  : 'solightbox',
		color         : 'blanc',
        dir           : '/manager/media/script/jquery_plugins/sexyLightBox/sexyimages/',
        imagesdir     : '/manager/media/script/jquery_plugins/sexyLightBox/sexyimages/',            
        emergefrom	  : 'bottom',
        OverlayStyles : {
          'background-color': '#000',
          'opacity' : 0.5
        }
	});
	SexyLightbox.relocateBox();
	
	 /* LANGUAGE TRANSLATION */
	jQuery.translate.ready(function(){		
		//alert("ready to translate");
		if (tradToLang != "")
		{
			//alert("traduction en "+tradToLang);
			jQuery('body').translate(tradToLang, {
				complete: function(){				
					DisplaySite();
			    }
			});
		}
		else
			DisplaySite();
	});	
		
	
});


    function ResizeSiteHeight()
    {	
    
    	
    	var hauteurNews = jQuery("#actu").outerHeight();
    	hauteurNews += 465;
    	
    	var hauteurContent = jQuery("#content").outerHeight();
    	hauteurContent += 450;
    	
    	var hauteur_max = Math.max(hauteurContent,hauteurNews);  
   
    	
    	jQuery("#page").css("height", hauteur_max + 75 + "px" );  
    	
    	jQuery("#footer").css("top", hauteur_max +30 + "px");  
    
		  
    }
function DisplaySite()
{
	//return;
	//ApplySIFR();
	jQuery("#loading").hide();
	jQuery("#container").css("visibility", "visible");
}    
  

 
    jQuery("recherche_img").mouseover(function() { 
       alert ("hello");
            var src = jQuery(this).attr("src").match(/[^\.]+/) + "recherche_hover.jpg";
            $jQuery (this).attr("src", src);
        })
       
        .mouseout(function() {
            var src = jQuery(this).attr("src").replace("recherche.jpg", "");
            jQuery(this).attr("src", src);
        });
     
