$(document).ready(function(){


	$("#menu a img").bind('mouseover',function(){
		if($(this).attr('class') != 'actif'){
			source = $(this).attr('src');
			source2 = source.split('.');
			$(this).attr('src',source2[0]+'2.jpg');
			$(this).mouseout(function(){
				$(this).attr('src',source);	
			});
		}
		
		
			$("#menu ul:visible").hide(100);
			
		if($(this).parent('a').attr('href') == '#'){	
			//alert(this);
			$(this).parent('a').parent('li').children('ul').show(400);
		}
		
		
	});
	
	$(".smenu li, #corps").click(function(){
		$(".smenu li").parent('ul').hide(300);
	});

/*prog*/

$(".gd_marg .textes").toggle(function(){
		$(this).css({ height: 'auto'});
		$(this).children('.etendre').hide();
	},function(){
		$(this).animate({ height: '320px'},500);
		$(this).children('.etendre').show();
	});

$("p.videos").toggle(function(){
		$(this).children('span').show(800);
	},function(){
		$(this).children('span').hide(800);
});



/*function ajuster() {
	var Hg=document.getElementById('gauche').scrollHeight+40;
	if(Hg > 700){//peut etre affiner ce seuil
	document.getElementById('corps').style.height = Hg+'px';
	document.getElementById('conteneur').style.height = (Hg+180)+'px';
	}
}



m1 = '<object type="application/x-shockwave-flash" data="http://widget-bb.slide.com/widgets/slideticker.swf" height="320" width="426" style="width:426px;height:320px"><param name="movie" value="http://widget-bb.slide.com/widgets/slideticker.swf" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="l" /><param name="wmode" value="transparent"/> <param name="flashvars" value="cy=ms&il=1&channel=3530822107883601595&site=widget-bb.slide.com"/></object><p style="white-space:nowrap"><a href="http://www.slide.com/pivot?cy=ms&at=un&id=3530822107883601595&map=1" target="_blank"><img src="http://widget-bb.slide.com/p1/3530822107883601595/ms_t016_v000_s0un_f00/images/xslide1.gif" border="0" ismap="ismap" /></a> <a href="http://www.slide.com/pivot?cy=ms&at=un&id=3530822107883601595&map=2" target="_blank"><img src="http://widget-bb.slide.com/p2/3530822107883601595/ms_t016_v000_s0un_f00/images/xslide2.gif" border="0" ismap="ismap" /></a> <a href="http://www.slide.com/pivot?cy=ms&at=un&id=3530822107883601595&map=F" target="_blank"><img src="http://widget-bb.slide.com/p4/3530822107883601595/ms_t016_v000_s0un_f00/images/xslide42.gif" border="0" ismap="ismap" /></a>';

m2 = '<object type="application/x-shockwave-flash" data="http://widget-dc.slide.com/widgets/slideticker.swf" height="320" width="426" style="width:426px;height:320px"><param name="movie" value="http://widget-dc.slide.com/widgets/slideticker.swf" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="l" /><param name="wmode" value="transparent"/> <param name="flashvars" value="cy=ms&il=1&channel=3386706919807857372&site=widget-dc.slide.com"/></object><p style="white-space:nowrap"><a href="http://www.slide.com/pivot?cy=ms&at=un&id=3386706919807857372&map=1" target="_blank"><img src="http://widget-dc.slide.com/p1/3386706919807857372/ms_t000_v000_s0un_f00/images/xslide1.gif" border="0" ismap="ismap" /></a> <a href="http://www.slide.com/pivot?cy=ms&at=un&id=3386706919807857372&map=2" target="_blank"><img src="http://widget-dc.slide.com/p2/3386706919807857372/ms_t000_v000_s0un_f00/images/xslide2.gif" border="0" ismap="ismap" /></a> <a href="http://www.slide.com/pivot?cy=ms&at=un&id=3386706919807857372&map=F" target="_blank"><img src="http://widget-dc.slide.com/p4/3386706919807857372/ms_t000_v000_s0un_f00/images/xslide42.gif" border="0" ismap="ismap" /></a>';

m3 = '<object type="application/x-shockwave-flash" data="http://widget-c3.slide.com/widgets/slideticker.swf" height="320" width="426" style="width:426px;height:320px"><param name="movie" value="http://widget-c3.slide.com/widgets/slideticker.swf" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="l" /><param name="wmode" value="transparent"/> <param name="flashvars" value="cy=ms&il=1&channel=3098476543656277187&site=widget-c3.slide.com"/></object><p style="white-space:nowrap"><a href="http://www.slide.com/pivot?cy=ms&at=un&id=3098476543656277187&map=1" target="_blank"><img src="http://widget-c3.slide.com/p1/3098476543656277187/ms_t043_v000_s0un_f00/images/xslide1.gif" border="0" ismap="ismap" /></a> <a href="http://www.slide.com/pivot?cy=ms&at=un&id=3098476543656277187&map=2" target="_blank"><img src="http://widget-c3.slide.com/p2/3098476543656277187/ms_t043_v000_s0un_f00/images/xslide2.gif" border="0" ismap="ismap" /></a> <a href="http://www.slide.com/pivot?cy=ms&at=un&id=3098476543656277187&map=F" target="_blank"><img src="http://widget-c3.slide.com/p4/3098476543656277187/ms_t043_v000_s0un_f00/images/xslide42.gif" border="0" ismap="ismap" /></a>';
*/


/*



	$("#microdiapo_nav a").click(function(){
		
		contenu = $(this).attr('id');
		$("#microdiapo_cont").html(eval(contenu));
	});


var larg = document.body.clientWidth;
	if(larg > 800) {ratio = 5} else {ratio = 7}
	var larg2 = larg/ratio;
	//$("#menu").css({display: "none"});
	$("#logo img").animate({width: larg2}, 1000,function(){
		//$("#menu").fadeIn(1500);
	});
	
	
function anim_n(){
	$("#nuage").animate({left: 2000},90000);
}	
	


function position(e)
	{
	x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;

	$("#nuage").animate({left: x-70},500);
	$("#menu").unbind();
	$("#menu").bind("mouseover",position);
	
	}

*/

/*photos des groupes*/
	$(".photos a").toggle(function(){
			$(this).children('img').attr('src',$(this).attr('href')).addClass('grand');
			$("p.videos span").hide();		
		}, function(){
			$(this).children('img').attr('src',$(this).attr('rel')).removeClass('grand');
			$("p.videos span").show();
			return false;		
	});
	
	
	
	
	
	
	
	
	
	
	
	
	
	


});

function resizePopUp(monImage, monTitre)
    {
	w = window.open('','chargement','width=10,height=10');
	w.document.write( "<html><head><title>"+monTitre+"</title>\n" );
	w.document.write( "<script language='JavaScript'>\n");
	w.document.write( "IE5=NN4=NN6=false;\n");
	w.document.write( "if(document.all)IE5=true;\n");
	w.document.write( "else if(document.getElementById)NN6=true;\n");
	w.document.write( "else if(document.layers)NN4=true;\n");
	w.document.write( "function autoSize() {\n");
	w.document.write( "if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31);\n");
	w.document.write( "else if(NN6) self.sizeToContent();\n");
	w.document.write( "else window.resizeTo(document.images[0].width,document.images[0].height+20);\n");
	w.document.write( "self.focus();\n");
	w.document.write( "}\n</scri");
	w.document.write( "pt>\n");
	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" );
	w.document.write( "<a href='javascript:window.close();'><img src='"+monImage+"' border=0 alt='"+monTitre+"'></a>" );
	w.document.write( "</body></html>" );
	w.document.close();
	}