$(document).ready(function(){
			
			
	// Menu
	$("#categorie h2").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_medium.swf',
		strWmode: 'transparent',
		strColor: '#FFFFFF'
	});
	
	// Titres colonne de droite
	$(".encart_vert h3").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#FFFFFF'
	});
	$(".encart_gris h3").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#000000'
	});
	$(".encart_vert_clair h3").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#000000'
	});
	$(".liste_info h3").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#000000'
	});
	$(".tab_encart_gris h3").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#000000'
	});
	
	
	// Contenu Client

	$("#contenu_client h1").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#7F7E7E'
	});

	$("#contenu_client h2").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#7F7E7E'
	});

	$("#contenu_client .flash_action h3").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#000000'
	});

	$("#contenu_col_droite h2").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#7F7E7E'
	});
	$("#contenu_col_droite h3").sifr({
		strSWF: 'fileadmin/dotcom/html/images/design/dax_regular.swf',
		strWmode: 'transparent',
		strColor: '#7F7E7E'
	});
	
	// Style des tableaux
	$("#contenu_client table.donnees_simple").each(function() {		
		$(this).children("tbody").children("tr:odd").addClass("alter");
		$(this).children("tbody").children("tr:even").css("background","#DCDEE0");
		$(this).children("tbody").children("tr:last-child").addClass("last");
	});
	$("#contenu_client table.donnees_double_entree").each(function() {
		$(this).children("tbody").children("tr:even").children("td:first-child").addClass("cel_verte");
		$(this).children("tbody").children("tr:even").css("background","#DCDEE0");
		$(this).children("tbody").children("tr:odd").addClass("alter");
		$(this).children("tbody").children("tr:last-child").addClass("last");
	});
	
	// Ajustement des visuels
	$("#contenu_client table.visuel_gch").each(function(i) {
		t = $(this).children().children().children().children().children("img").width();
		$(this).width(t);
		$(this).children().children().children().children("p").width(t);
	});
	$("#contenu_client table.visuel_dte").each(function(i) {
		t = $(this).children().children().children().children().children("img").width();
		$(this).width(t);
		$(this).children().children().children().children("p").width(t);
	});
	
	// Rollover mode d'affichage
	$("#contenu_client .mode_affichage li").mouseover(function(){
		$(this).addClass("over");										   
	});
	$("#contenu_client .mode_affichage li").mouseout(function(){
		$(this).removeClass("over");										   
	});
	
	// mode d'affichage : lien actif
	$("#contenu_client .mode_affichage li").click(function(){
		$("#contenu_client .mode_affichage li").removeClass("on");
		$(this).addClass("on");
	});
	
	// Plier-déplier
	$("#contenu_client.agenda_liste .agenda_bloc_info dd").hide();
	$("#contenu_client .bt_moins").click(function(){												  											  
		if($(this).children("img").attr("src").indexOf("moins")!="-1"){		
			$(this).children("img").attr("src",$(this).children("img").attr("src").replace("moins","plus"));
			$(this).parents("dl").children("dd").hide();
		}else{
			$(this).children("img").attr("src",$(this).children("img").attr("src").replace("plus","moins"));
			$(this).parents("dl").children("dd").show();
		}
	});
	$("#contenu_client .detail").click(function(){								
		$("#contenu_client .agenda_bloc_info dd").show();
		$("#contenu_client .bt_moins").children("img").attr("src",$("#contenu_client .bt_moins").children("img").attr("src").replace("plus","moins"));
	});
	$("#contenu_client .reduit").click(function(){
		$("#contenu_client .agenda_bloc_info dd").hide();
		$("#contenu_client .bt_moins").children("img").attr("src",$("#contenu_client .bt_moins").children("img").attr("src").replace("moins","plus"));
	});
	
	// efface le contenu d'un champ lors d'un focus
	$("textarea").focus(function(){
		if($("textarea").html()=="Objet de votre question *" || "Votre message *"){
			$(this).html("");
		}			 
	});
	
	// imprimer
	$("#contenu_imprimer").click(function(){
		window.print();
	});
	
	
	$("div.flash_cold").each(function() {
		var flash = ''
		+ '	<object 	classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
		+ '				codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" '
		+ '				width="168" height="122">'
		+ '		<param name="movie" value="fileadmin/dotcom/html/flash/player.swf" />'
		+ '		<param name="flashvars" value="video_url='+$(this).text()+'" />'
		+ '		<param name="quality" value="high" />'
		+ '		<embed 	src="fileadmin/dotcom/html/flash/player.swf"'
		+ '		quality="high" '
		+ '		pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"'
		+ '		type="application/x-shockwave-flash"'
		+ '		flashvars="video_url='+$(this).text()+'" '
		+ '		width="168" height="122"'
		+ '		></embed>'
		+ '	</object>';
		$(this).parent().prepend(flash);
		$(this).remove();
	 });
	
	/*$("div.flash_centre").each(function() {
		
		var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
				+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="645" height="252"> '
        		+ '<param name="movie" value="" />' 
        		+ '<param name="flashvars" value="url='+ $(this).text() +'" />' 
        		+ '<param name="wmode" value="transparent" />' 
        		+ '<param name="quality" value="high" />'
				+ '<param name="flashvars" value="url=fileadmin/dotcom/html/flash/livraison/config.xml">'
         		+ '<embed src="'+ $(this).text() 
				+'" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"'
				+ 'flashvars="url=fileadmin/dotcom/html/flash/livraison/config.xml"'
				+ 'type="application/x-shockwave-flash" width="645" height="252"></embed>'
      			+ '</object>';
		$(this).parent().prepend(flash);
		$(this).remove();
	 });*/
	 
	$("div.flash_actionvaleo").each(function() {
		var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
				+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="255" height="185"> '
        		+ '<param name="movie" value="'+ $(this).text() +'" />' 
        		+ '<param name="wmode" value="transparent" />' 
        		+ '<param name="quality" value="high" />'
				+ '<param name="flashvars" value="url=../flash/livraison/config.xml">'
         		+ '<embed src="'+ $(this).text() 
				+'" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"'
				+ 'flashvars="url=../flash/livraison/config.xml"'
				+ 'type="application/x-shockwave-flash" width="255" height="185"></embed>'
      			+ '</object>';
		$(this).parent().prepend(flash);
		$(this).remove();
	 });
	$("div.valeo_added").each(function() {
		var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
				+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="203" height="150"> '
        		+ '<param name="movie" value="'+ $(this).text() +'" />' 
        		+ '<param name="wmode" value="transparent" />' 
        		+ '<param name="quality" value="high" />'
				+ '<param name="flashvars" value="xmlPath=fileadmin/dotcom/html/flash/valeo_added/xml/voitures_fr.xml">' 
         		+ '<embed src="'+ $(this).text() 
				+'" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"'
				+ 'flashvars="xmlPath=fileadmin/dotcom/html/flash/valeo_added/xml/voitures_fr.xml"'
				+ 'type="application/x-shockwave-flash" width="203" height="150"></embed>'
      			+ '</object>';
		$(this).parent().prepend(flash);
		$(this).remove();
	 }); 

	$("div.valeo_added_en").each(function() {
		var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
				+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="203" height="150"> '
        		+ '<param name="movie" value="'+ $(this).text() +'" />' 
        		+ '<param name="wmode" value="transparent" />' 
        		+ '<param name="quality" value="high" />'
				+ '<param name="flashvars" value="xmlPath=fileadmin/dotcom/html/flash/valeo_added/xml/voitures_en.xml">' 
         		+ '<embed src="'+ $(this).text() 
				+'" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"'
				+ 'flashvars="xmlPath=fileadmin/dotcom/html/flash/valeo_added/xml/voitures_en.xml"'
				+ 'type="application/x-shockwave-flash" width="203" height="150"></embed>'
      			+ '</object>';
		$(this).parent().prepend(flash);
		$(this).remove();
	 });	 
	
});

