// jquery.innerfade.js version ?
(function(A){A.fn.animatedinnerfade=function(C){var B;var D=false;this.each(function(){var G={animationtype:"fade",speed:"normal",timeout:15000,type:"sequence",containerheight:"300px",containerwidth:"600px",runningclass:"innerfade",animationSpeed:15000,bgFrame:"none",controlButtonsPath:"img",controlBox:"none",controlBoxClass:"none",displayTitle:"none",titleClass:"innerfade-title"};A(this).css("margin","0 0 0 0").css("padding","0 0 0 0").find("img").css("border","none");if(C){A.extend(G,C)}var H=A(this).children();if(G.displayTitle!="none"){A(this).append("<div class='"+G.titleClass+"'><h2>"+A(H[0]).find("img:first").attr("title")+"</h2></div>")}if(G.bgFrame!="none"){A(this).append("<div class='bg-frame'><a href='"+A(H[0]).find("a:first").attr("href")+"'><img src='"+G.bgFrame+"' width='"+G.containerwidth+"' height='"+G.containerheight+"' style='border: none;' /></a></div>");A(this).find(".bg-frame").css("position","absolute").css("top",0).css("left",0).css("z-index",300).css("height",G.containerheight).css("width",G.containerwidth)}if(G.controlBox!="none"){if(G.controlBoxClass!="none"){A(this).append("<div class='"+G.controlBoxClass+" control-panel'><a class='back-button' href='#'><img src='"+G.controlButtonsPath+"/previous.gif' alt='previous' style='border: none;' /></a> <a class='pause-button' href='#'><img src='"+G.controlButtonsPath+"/pause.gif' alt='pause' style='border: none;' /></a> <a class='next-button' href='#'><img src='"+G.controlButtonsPath+"/next.gif' alt='next' style='border: none;' /></a></div>")}else{A(this).append("<div class='control-panel'><a class='back-button' href='#'><img src='"+G.controlButtonsPath+"/previous.gif' alt='previous' style='border: none;' /></a> <a class='pause-button' href='#'><img src='"+G.controlButtonsPath+"/pause.gif' alt='pause' style='border: none;' /></a> <a class='next-button' href='#'><img src='"+G.controlButtonsPath+"/next.gif' alt='next' style='border: none;' /></a></div>")}if(G.controlBox!="show"){A(this).find(".control-panel").hide();A(this).bind("mouseover",function(){A(this).find(".control-panel").show()});A(this).bind("mouseout",function(){A(this).find(".control-panel").hide()})}A(this).find(".control-panel").css("z-index",350).css("position","absolute");if(G.controlBoxClass=="none"){A(".control-panel").css("right","10px").css("top","5px").css("textAlign","right").css("margin",0).css("paddingTop","0").css("marginRight","0").css("fontSize","20px").css("color","#88d300")}A(this).find(".control-panel a.next-button").bind("click",function(){D=false;clearTimeout(B);A(".control-panel a.pause-button").html("<img src='"+G.controlButtonsPath+"/pause.gif' alt='pause' style='border: none;' />");A.animatedinnerfade.next(H,G,1,0,B,D);return false});A(this).find(".control-panel a.back-button").bind("click",function(){D=false;clearTimeout(B);A(".control-panel a.pause-button").html("<img src='"+G.controlButtonsPath+"/pause.gif' alt='pause' style='border: none;' />");A.animatedinnerfade.next(H,G,H.length-1,0,B,D);return false});A(this).find(".control-panel a.pause-button").bind("click",function(){clearTimeout(B);if(!D){D=true;A(this).html("<img src='"+G.controlButtonsPath+"/play.gif' alt='play' style='border: none;' />");A(H[0]).stop().stop()}else{D=false;A(this).html("<img src='"+G.controlButtonsPath+"/pause.gif' alt='pause' style='border: none;' />");var J=-(parseInt(A(H[0]).find("img").attr("width"))-parseInt(G.containerwidth));if(J>0){J=0}var I=parseInt(G.timeout)-parseInt((parseInt(A(H[0]).css("left"))/parseInt(J))*parseInt(G.timeout));A(H[0]).animate({top:0,left:J},I);B=setTimeout(function(){A.animatedinnerfade.next(H,G,1,0,B,D)},I)}return false})}if(H.length>1){A(this).css("position","relative").css("overflow","hidden").css("height",G.containerheight).css("width",G.containerwidth);A(this).addClass(G.runningclass);for(var F=0;F<H.length;F++){A(H[F]).css("position","absolute").css("top",0).css("left",0).css("z-index",String(H.length-F));A(H[F]).hide()}A(H[0]).css("top",0);A(H[0]).css("left",0);A.animatedinnerfade.move_photo(H[0],G);if(G.type=="sequence"){B=setTimeout(function(){A.animatedinnerfade.next(H,G,1,0,B,D)},G.timeout)}else{var E;do{E=Math.floor(Math.random()*(H.length))}while(E==0);B=setTimeout((function(){A.animatedinnerfade.next(H,G,E,0,B,D)}),G.timeout)}A(H[0]).show()}})};A.animatedinnerfade=function(){};A.animatedinnerfade.next=function(B,F,K,L,G,C){var E=-(parseInt(A(B[K]).find("img").attr("width"))-parseInt(F.containerwidth));if((parseInt(A(B[K]).css("left"))==0)||(parseInt(A(B[K]).css("left"))==E)){clearTimeout(G);var E=-(parseInt(A(B[K]).find("img").attr("width"))-parseInt(F.containerwidth));var J,D;if(K==(B.length-1)){J=0}else{J=K+1}if(K==0){D=B.length-1}else{D=K-1}for(var I=0;I<B.length;I++){if((I!=L)&&(I!=K)){A(B[I]).css("z-index","1");A(B[I]).css("top",0).css("left",0);A(B[I]).hide()}}A(B[L]).css("z-index","190");A(B[K]).css("z-index","195");if(F.displayTitle!="none"){A("."+F.titleClass+" h2").html(A(B[K]).find("img:first").attr("title"))}if(F.controlBox!="none"){A(this).find(".control-panel a.next-button").unbind("click");A(".control-panel a.next-button").bind("click",function(){C=false;clearTimeout(G);A(".control-panel a.pause-button").html("<img src='"+F.controlButtonsPath+"/pause.gif' alt='pause' style='border: none;' />");A.animatedinnerfade.next(B,F,J,K,G,C);return false});A(this).find(".control-panel a.back-button").unbind("click");A(".control-panel a.back-button").bind("click",function(){C=false;clearTimeout(G);A(".control-panel a.pause-button").html("<img src='"+F.controlButtonsPath+"/pause.gif' alt='pause' style='border: none;' />");A.animatedinnerfade.next(B,F,D,K,G,C);return false});A(this).find(".control-panel a.pause-button").unbind("click");A(".control-panel a.pause-button").bind("click",function(){clearTimeout(G);if(!C){C=true;A(this).html("<img src='"+F.controlButtonsPath+"/play.gif' alt='play' style='border: none;' />");A(B[K]).stop().stop()}else{C=false;A(this).html("<img src='"+F.controlButtonsPath+"/pause.gif' alt='pause' style='border: none;' />");var N=-(parseInt(A(B[K]).find("img").attr("width"))-parseInt(F.containerwidth));if(N>0){N=0}var M=parseInt(F.timeout)-parseInt((parseInt(A(B[K]).css("left"))/parseInt(N))*parseInt(F.timeout));A(B[K]).animate({top:0,left:N},M);G=setTimeout((function(){A.animatedinnerfade.next(B,F,J,K,G,C)}),M)}return false})}if(F.bgFrame!="none"){A(this).find(".bg-frame a").attr("href",A(B[K]).find("a:first").attr("href"))}A(B[K]).css("top",0).css("left",0);if(F.animationtype=="slide"){A(B[L]).slideUp(F.speed,A(B[K]).slideDown(F.speed))}else{if(F.animationtype=="fade"){A(B[L]).fadeOut(F.speed);A(B[K]).fadeIn(F.speed)}else{alert("animationtype must either be 'slide' or 'fade'")}}A.animatedinnerfade.move_photo(B[K],F);if(F.type=="sequence"){G=setTimeout((function(){A.animatedinnerfade.next(B,F,J,K,G,C)}),F.timeout)}else{var H;do{H=Math.floor(Math.random()*(B.length))}while(H==K);G=setTimeout((function(){A.animatedinnerfade.next(B,F,H,K,G,C)}),F.timeout)}}};A.animatedinnerfade.move_photo=function(C,D){if(D.animationSpeed>0){var B=-(parseInt(A(C).find("img").attr("height"))-parseInt(D.containerheight));var E=-(parseInt(A(C).find("img").attr("width"))-parseInt(D.containerwidth));if(B>0){B=0}if(E>0){E=0}A(C).show().css("left",0).css("top",0).animate({top:B,left:parseInt(E/2)},parseInt(D.animationSpeed/2)).animate({top:0,left:E},parseInt(D.animationSpeed/2))}}})(jQuery);

// jQuery Color Animations version ?
(function(D){D.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(F,E){D.fx.step[E]=function(G){if(G.state==0){G.start=C(G.elem,E);G.end=B(G.end)}G.elem.style[E]="rgb("+[Math.max(Math.min(parseInt((G.pos*(G.end[0]-G.start[0]))+G.start[0]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[1]-G.start[1]))+G.start[1]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[2]-G.start[2]))+G.start[2]),255),0)].join(",")+")"}});function B(F){var E;if(F&&F.constructor==Array&&F.length==3){return F}if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return[parseInt(E[1]),parseInt(E[2]),parseInt(E[3])]}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return[parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55]}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return[parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16)]}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return[parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16)]}return A[D.trim(F).toLowerCase()]}function C(G,E){var F;do{F=D.curCSS(G,E);if(F!=""&&F!="transparent"||D.nodeName(G,"body")){break}E="backgroundColor"}while(G=G.parentNode);return B(F)}var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function(A){A("document").ready(function(){A(".highlight").animate({backgroundColor:"#FF5F96"},800).animate({backgroundColor:"#F8C0D3"},2000)})})(jQuery);

/*  Fonctions communes  */
(function($) {
$(document).ready(function(){


	$(".expand p").attr({ style: "font-family:arial; font-size:12px;"});
	$(".expand span").attr({ style: "font-family:arial; font-size:12px;"});

	// separateurs fil d'ariane
	var li_size = $('#ariane li').size() - 1;
	$('#ariane li:lt('+li_size+')').append('|');
	
  
  /* envoyer à un ami */
	//$("#envoyer form").corner("15px cc:#fff tr");
	$("#envoyer h5").css({"cursor":"pointer"});
	$("#envoyer h5").next().css({"display":"none"});
	$("#envoyer h5").toggle(
	   function(){$(this).next().fadeIn();},
	   function(){$(this).next().fadeOut();}
	);
	
  /* affichage alternatif */
  $('ul#content_push').animatedinnerfade({
				speed: 1000,
				timeout: 5000,
				type: 'random',
				containerheight: '80px',
				containerwidth: '222px',
				animationSpeed: 5000,
				animationtype: 'fade',
				bgFrame: 'none',
				controlBox: 'none',
				displayTitle: 'none'
			});
	
  $('ul#collection_push').animatedinnerfade({
      speed: 1000,
      timeout: 5000,
      type: 'random',
      containerheight: '80px',
      containerwidth: '222px',
      animationSpeed: 5000,
      animationtype: 'fade',
      bgFrame: 'none',
      controlBox: 'none',
      displayTitle: 'none'
    });		
	
	// effet fading sur textes
	$('document').ready( function() {
		$('.highlight')
		    .animate( { backgroundColor: '#FF5F96' }, 800)
		    .animate( { backgroundColor: '#F8C0D3' }, 2000);
	});
	
	// tooltip
	$('#yui-main .tooltip a').tooltip({
		track: true,
		showURL: false, 
		showBody: " - "
	});
  
  $('#yui-main .tooltip a img').removeAttr('alt');
  
  // tooltip
	$('#yui-main .visuel_produits .tooltip img').tooltip({
		track: true,
		showURL: false, 
		showBody: " - "
	});
  $('#yui-main .visuel_produits .tooltip img').removeAttr('alt');
	
	
});
})(jQuery);	