$(document).ready(function(){

	/*  fix ie6 */
	if ($.browser.msie && $.browser.version=='6.0') {
		 /* menu deroulant */
		 $("#main-nav .inside ul li").hover(
			 function(){
			   $(this).addClass('hover')
			 },
			 function(){
			   $(this).removeClass('hover')
			 }
		 );
		 $("#sec-nav ul li").hover(
			 function(){
			   $(this).addClass('hover')
			 },
			 function(){
			   $(this).removeClass('hover')
			 }
		 );
		 $("div.hr").pngfix();
		 $(".sep").pngfix();
		 $("#evenements h2").pngfix();
	}
	/*--------------------*/
	
   $("#newsletter21 p.carre").each( function() {
	   var contenu = $(this).html();
	   $(this).empty();
	   $(this).prepend(contenu + '<img src="/images/espace_newsletter/carre.jpg" class="carre">');
   });
	 
   $("#newsletter22 p.carre").each( function() {
	   var contenu = $(this).html();
	   $(this).empty();
	   $(this).prepend(contenu + '<img src="/images/espace_newsletter/carre-n22.jpg" class="carre">');
   });	 
   
   $("#newsletter23 p.carre").each( function() {
	   var contenu = $(this).html();
	   $(this).empty();
	   $(this).prepend(contenu + '<img src="/images/espace_newsletter/carre-n23.jpg" class="carre">');
   });

   $("#newsletter24 p.carre").each( function() {
	   var contenu = $(this).html();
	   $(this).empty();
	   $(this).prepend(contenu + '<img src="/images/espace_newsletter/carre-n24.jpg" class="carre">');
   });   
   
   $("#newsletter25 p.carre").each( function() {
	   var contenu = $(this).html();
	   $(this).empty();
	   $(this).prepend(contenu + '<img src="/images/espace_newsletter/carre-n25.jpg" class="carre">');
   });      
   
   $("#newsletter26 p.carre, .bloc p:not(.important, .visuel)").each( function() {
	   $(this).append('<img src="/images/espace_newsletter/newsletter_26/carre.jpg" class="carre">');
   }); 

	
	if(document.getElementById("home")){
		var intro = new SWFObject("intro_flash/intro.swf", "branding_flash", "268", "101", "8", "#FFFFFF",true);
		intro.useExpressInstall("intro_flash/expressinstall.swf");
		intro.addParam("wmode", "transparent");
		intro.write("header");
	};
	
	if(document.getElementById("infos")){
		var content = "";
		var content = $("#content").height() - 100;
    if($("#infos").height() < $("#content").height())
    {
      $("#infos").height(content);
    }
	};	
	
	if(document.getElementById("diagonal")){
		var espace = "";
		var espace = $("#container").height() - 300;
		$("#sub_nav").height(espace);
	};	
  
  $("a[rel='external'], a[rel='document'], a[href^='http://'], a[href^='mailto'], a[href$='.pdf'], a[href$='.doc'], a[href$='.xls'], a[href$='.txt']").each(function(){
    $(this).attr({ title: ($(this).attr("title"))?$(this).attr("title"):$(this).attr("href")+" (nouvelle fenêtre)" });
    $(this).click(function() {window.open($(this).attr('href'));return false;});
  });  
	
	
});