(function(a){a.prettyPhoto={version:"2.5.6a"};a.fn.prettyPhoto=function(V){V=jQuery.extend({animationSpeed:"normal",opacity:0.8,showTitle:true,allowresize:true,default_width:500,default_height:350,counter_separator_label:"/",theme:"light_rounded",hideflash:false,wmode:"opaque",autoplay:true,modal:false,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"> 						<div class="pp_top"> 							<div class="pp_left"></div> 							<div class="pp_middle"></div> 							<div class="pp_right"></div> 						</div> 						<div class="pp_content_container"> 							<div class="pp_left"> 							<div class="pp_right"> 								<div class="pp_content"> 									<div class="pp_loaderIcon"></div> 									<div class="pp_fade"> 										<a href="#" class="pp_expand" title="Agrandir/Réduire">Agrandir/Réduire</a> 										<div class="pp_hoverContainer"> 											<a class="pp_next" href="#">next</a> 											<a class="pp_previous" href="#">previous</a> 										</div> 							<div class="pp_margin_top"><div class="ppt"></div></div> 										<div id="pp_full_res"></div> 										<div class="pp_details clearfix"> 											<a class="pp_close" href="#" title="Fermer">Fermer</a> 											<div class="pp_nav"> 												<a href="#" class="pp_arrow_previous" title="Précédant">Précédant</a> 												<p class="currentTextHolder">0/0</p> 												<a href="#" class="pp_arrow_next" title="Suivant">Suivant</a> 											</div> 											<div class="pp_description"></div> 										</div> 									</div> 								</div> 							</div> 							</div> 						</div> 						<div class="pp_bottom"> 							<div class="pp_left"></div> 							<div class="pp_middle"></div> 							<div class="pp_right"></div> 						</div> 					</div> 					<div class="pp_overlay"></div>',image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline clearfix">{content}</div>'},V);if(a.browser.msie&&parseInt(a.browser.version)==6){V.theme="light_square"}if(a(".pp_overlay").size()==0){X()}var r=false;var C=100;var i=5;var q=false,y=false;var T=18;var K=T;var L=2*i;var J=0;var z=false;var P=false;var j,v,f,e,k,G,x,n,Y=a(window).height()-L-K,U=a(window).width()-L-K,S=0;var s,F;var g=function(){u();p();c()};var m=function(){p();c()};var R=function(Z){if(v.is(":visible")){switch(Z.keyCode){case 37:a.prettyPhoto.changePage("previous");break;case 39:a.prettyPhoto.changePage("next");break;case 27:if(!V.modal){r=true;a.prettyPhoto.close()}break}}};a(this).each(function(){a(this).bind("click",function(){var ae=this;var Z=a(this).attr("rel");var ab=/\[(?:.*)\]/;var aa=ab.exec(Z);var af=new Array(),ac=new Array(),ad=new Array();var ag,ah;if(aa){a("a[rel*="+aa+"]").each(function(ai){if(a(this)[0]===a(ae)[0]){S=ai}af.push(a(this).attr("href"));ag=(a(this).attr("title"))?a(this).attr("title"):"";ah=(a(this).find("img").attr("alt"))?a(this).find("img").attr("alt"):"";if(!ah&&ag&&Z.charAt(12)=="_"){ah=ag}ac.push(ag);ad.push(ah)})}else{af=a(this).attr("href");ac=(a(this).attr("title"))?a(this).attr("title"):"";ad=(a(this).find("img").attr("alt"))?a(this).find("img").attr("alt"):"";if(!ad&&ac&&Z.charAt(11)=="_"){ad=ac}}a.prettyPhoto.open(af,ac,ad);return false})});a.prettyPhoto.open=function(ab,aa,Z){r=false;p();c();if(a.browser.msie&&a.browser.version==6){a("select").css("visibility","hidden")}if(V.hideflash){a("object,embed,iframe").css("visibility","hidden")}images=a.makeArray(ab);titles=a.makeArray(aa);descriptions=a.makeArray(Z);image_set=(a(images).size()>0)?true:false;l(a(images).size());a(".pp_loaderIcon").show();e.show().fadeTo(V.animationSpeed,V.opacity);v.find(".currentTextHolder").text((S+1)+V.counter_separator_label+a(images).size());if(descriptions[S]){v.find(".pp_description").html(unescape(descriptions[S]))}else{v.find(".pp_description").text("")}if(titles[S]&&V.showTitle){hasTitle=true;f.html(unescape(titles[S]))}else{hasTitle=false}A();v.fadeIn(V.animationSpeed,function(){O(true)});a(window).bind("resize",g);a(window).bind("scroll",m);a(document).bind("keydown",R)};a.prettyPhoto.changePage=function(Z){if(Z=="previous"){S--;if(S<0){S=0;return}}else{if(a(".pp_arrow_next").is(".disabled")){return}if(S<a(images).size()-1){S++}}h(function(){if(!r){a.prettyPhoto.open(images,titles,descriptions)}},true)};a.prettyPhoto.close=function(){r=true;if(J){clearTimeout(J)}a(window).unbind("resize",g);a(window).unbind("scroll",m);a(document).unbind("keydown",R);v.find("object,embed,iframe").css("visibility","hidden");a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(V.animationSpeed);e.fadeOut(V.animationSpeed,function(){a("#pp_full_res").html("");v.attr("style","").find("div:not(.pp_hoverContainer)").attr("style","");c();if(a.browser.msie&&a.browser.version==6){a("select").css("visibility","visible")}if(V.hideflash){a("object,embed,iframe").css("visibility","visible")}S=0;V.callback()})};function N(){p();c();a(".pp_loaderIcon").hide();if(Y<=0||U<=0){return}var aa=j.width;try{var ac=a(".pp_nav").clone().appendTo("body");var ah=ac.width()+5;a(ac).remove();if(ah<aa){ah=aa-ah}a(".pp_description").css("width",ah)}catch(ab){}var ae=j.containerWidth;var ai=(Y-j.containerHeight)/2;var ad=(U-ae)/2;if(ai<i){ai=i}if(ad+ae>U+L){ad=U+L-ae}else{if(ad<i){ad=i}}if(w(images[S])["type"]=="inline"){var ag=a(images[S]).css("background-color");ag=o(ag);if(ag&&ag!="transparent"){a(".pp_inline").css("background-color",ag)}var af=j.contentHeight;var aj=j.height;var Z=j.contentWidth;a(".pp_inline").css("overflow-y",(y)?"scroll":"hidden");a(".pp_inline").css("overflow-x",(q)?"scroll":"hidden");a(".pp_inline").css("height",aj-(q?0:T));a(".pp_inline").css("width",aa-(y?0:T));a(".pp_content").css("height",af);a(".pp_content").css("width",Z);v.find(".pp_content").animate({height:j.contentHeight},V.animationSpeed)}else{v.find(".pp_content").animate({height:j.contentHeight},V.animationSpeed)}v.animate({top:ai+H(),left:ad+W(),width:j.containerWidth},V.animationSpeed,function(){v.find(".pp_hoverContainer,#fullResImage").height(j.height).width(j.width);v.find(".pp_fade").fadeIn(V.animationSpeed);if(image_set&&w(images[S])["type"]=="image"){v.find(".pp_hoverContainer").show()}else{v.find(".pp_hoverContainer").hide()}V.changepicturecallback()})}function o(ae){if(ae.indexOf("#")==0){if(ae.length==4){var ad=ae.charAt(1);var ac=ae.charAt(2);var Z=ae.charAt(3);ae="#"+ad+ad+ac+ac+Z+Z}return ae}var aa=ae.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);function ab(af){return("0"+parseInt(af).toString(16)).slice(-2)}if(aa==null){return ae}if(aa.length==5&&aa[4]==0){return"transparent"}return"#"+ab(aa[1])+ab(aa[2])+ab(aa[3])}function h(aa,Z){v.find("#pp_full_res object,#pp_full_res embed,#pp_full_res iframe").css("visibility","hidden");v.find(".pp_fade").fadeOut(V.animationSpeed,function(){if(Z&&!r){a(".pp_loaderIcon").show()}if(aa){aa()}})}function u(){if(J){clearTimeout(J)}if(w(images[S])["resizable"]){J=setTimeout(Q,500)}}function Q(){J=0;if(!z&&!r&&U>C&&Y>C){v.find(".pp_fade").fadeOut(V.animationSpeed,function(){if(!r){v.fadeIn(V.animationSpeed,M)}})}}function l(Z){if(S<0){S=0}else{if(S>Z-1){S=Z-1}}if(S==Z-1){v.find("a.pp_next").css("visibility","hidden");v.find("a.pp_arrow_next").addClass("disabled").unbind("click")}else{v.find("a.pp_next").css("visibility","visible");v.find("a.pp_arrow_next.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("next");return false})}if(S==0){v.find("a.pp_previous").css("visibility","hidden");v.find("a.pp_arrow_previous").addClass("disabled").unbind("click")}else{v.find("a.pp_previous").css("visibility","visible");v.find("a.pp_arrow_previous.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("previous");return false})}if(Z>1){a(".pp_nav").show()}else{a(".pp_nav").hide()}}function d(ac,aj,Z){var aa=false;E(ac,aj);var ai=ac;var af=aj;if((Z&&(n>U)||(x>Y))&&V.allowresize&&!P){var ag=ac/aj;aa=true;var ae=(n-G);var ab=(x-k);var ah=(U-ae)/G;var ad=(Y-ab)/k;if(ah<ad){ai*=ah;af=ai/ag}else{af*=ad;ai=af*ag}ai=Math.floor(ai);af=Math.floor(af);E(ai,af)}return{width:Math.floor(ai),height:Math.floor(af),containerHeight:Math.floor(x),containerWidth:Math.floor(n),contentHeight:Math.floor(k),contentWidth:Math.floor(G),resized:aa}}function B(af,aa){var ae=false;E(af,aa);var ac=af;var Z=aa;y=q=false;var ab=T;if(n>U){var ag=(n-U);ac-=ag;if(ac<ab){ac=ab}q=true;ae=true}if(x>Y){var ad=(x-Y);Z-=ad;if(Z<ab){Z=ab}y=true;ae=true}if(y&&q){}else{}if(y){ac+=T}if(q){Z+=T}if(ae){E(ac,Z)}if(y){ac-=T}if(q){Z-=T}return{width:Math.floor(ac),height:Math.floor(Z),containerHeight:Math.floor(x),containerWidth:Math.floor(n),contentHeight:Math.floor(k),contentWidth:Math.floor(G),resized:ae}}function A(){P=false;s=(parseFloat(b("width",images[S])))?b("width",images[S]):V.default_width.toString();F=(parseFloat(b("height",images[S])))?b("height",images[S]):V.default_height.toString();if(s.indexOf("%")!=-1||F.indexOf("%")!=-1){F=parseFloat((a(window).height()*parseFloat(F)/100)-100);s=parseFloat((a(window).width()*parseFloat(s)/100)-100);P=true}}function E(ad,Z){ad=parseFloat(ad);Z=parseFloat(Z);var ac=v.find(".pp_details");ac.width(ad);var ab=parseFloat(ac.css("marginTop"))+parseFloat(ac.css("marginBottom"));ac=ac.clone().appendTo(a("body")).css({position:"absolute",top:-10000});ab+=ac.height();if(a.browser.msie&&a.browser.version==7){ab+=8}ac.remove();var ae=v.find(".pp_margin_top");var aa=v.find(".pp_bottom").height();ab-=aa-2;k=Z+ab+parseFloat(ae.css("height"));G=ad;x=k+v.find(".pp_top").height()+aa;n=ad+v.find(".pp_left").height()+v.find(".pp_right").height()}function w(Z){if(Z==undefined){return{type:"?",resizable:false}}else{if(Z.match(/youtube\.com\/watch/i)){return{type:"youtube",resizable:true}}else{if(Z.match(/vimeo\.com/i)){return{type:"vimeo",resizable:true}}else{if(Z.indexOf(".mov")!=-1){return{type:"quicktime",resizable:true}}else{if(Z.indexOf(".swf")!=-1){return{type:"flash",resizable:true}}else{if(Z.indexOf("iframe")!=-1){return{type:"iframe",resizable:true}}else{if(Z.substr(0,1)=="#"){return{type:"inline",resizable:true}}else{return{type:"image",resizable:true}}}}}}}}}function c(){var aa=v.height();var Z=v.width();var ac=(Y-aa)/2;var ab=(U-Z)/2;if(ac<i){ac=i}if(ab+Z>U+L){ab=U+L-Z}else{if(ab<i){ab=i}}v.css({top:ac+H(),left:ab+W()})}function p(){Y=t()-L-K;U=I()-L-K;e.css({width:a(document).width(),height:a(document).height()})}function I(){return D(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0)}function t(){return D(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0)}function W(){return D(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0)}function H(){return D(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0)}function D(aa,ac,Z){var ab=aa?aa:0;if(ac&&(!ab||(ab>ac))){ab=ac}return Z&&(!ab||(ab>Z))?Z:ab}function X(){a("body").append(V.markup);v=a(".pp_pic_holder");f=a(".ppt");e=a("div.pp_overlay");v.attr("class","pp_pic_holder "+V.theme);e.css({opacity:0,width:a(document).width(),height:a(document).height()}).bind("click",function(){if(!V.modal){r=true;if(J){clearTimeout(J)}if(v.is(":animated")){v.stop().fadeOut("fast",a.prettyPhoto.close)}v.fadeOut(V.animationSpeed,a.prettyPhoto.close)}});a("a.pp_close").bind("click",function(){r=true;a.prettyPhoto.close();return false});v.find(".pp_previous, .pp_arrow_previous").bind("click",function(){a.prettyPhoto.changePage("previous");return false});v.find(".pp_next, .pp_arrow_next").bind("click",function(){a.prettyPhoto.changePage("next");return false})}function M(){A();v.fadeIn(V.animationSpeed,function(){O(false)})}function O(){var ac="";var ag="";var aj=w(images[S]);var ad=aj.resizable;switch(aj.type){case"image":ag=new Image();nextImage=new Image();if(image_set&&S>a(images).size()){nextImage.src=images[S+1]}prevImage=new Image();if(image_set&&images[S-1]){prevImage.src=images[S-1]}v.find("#pp_full_res")[0].innerHTML=V.image_markup;v.find("#fullResImage").attr("src",images[S]);ag.onload=function(){s=ag.width;F=ag.height;j=d(ag.width,ag.height,true);N()};ag.onerror=function(){z=true;r=true;a.prettyPhoto.close()};ag.src=images[S];break;case"youtube":j=d(s,F,ad);movie="http://www.youtube.com/v/"+b("v",images[S]);if(V.autoplay){movie+="&autoplay=1"}ac=V.flash_markup.replace(/{width}/g,j.width).replace(/{height}/g,j.height).replace(/{wmode}/g,V.wmode).replace(/{path}/g,movie);break;case"vimeo":j=d(s,F,ad);var Z=images[S];movie="http://vimeo.com/moogaloop.swf?clip_id="+Z.replace("http://vimeo.com/","");if(V.autoplay){movie+="&autoplay=1"}ac=V.flash_markup.replace(/{width}/g,j.width).replace(/{height}/g,j.height).replace(/{wmode}/g,V.wmode).replace(/{path}/g,movie);break;case"quicktime":j=d(s,F,ad);j.height+=15;j.contentHeight+=15;j.containerHeight+=15;ac=V.quicktime_markup.replace(/{width}/g,j.width).replace(/{height}/g,j.height).replace(/{wmode}/g,V.wmode).replace(/{path}/g,images[S]).replace(/{autoplay}/g,V.autoplay);break;case"flash":j=d(s,F,ad);var ai=images[S];ai=ai.substring(images[S].indexOf("flashvars")+10,images[S].length);var aa=images[S];aa=aa.substring(0,aa.indexOf("?"));ac=V.flash_markup.replace(/{width}/g,j.width).replace(/{height}/g,j.height).replace(/{wmode}/g,V.wmode).replace(/{path}/g,aa+"?"+ai);break;case"iframe":j=d(s,F,ad);var ae=images[S];ae=ae.substr(0,ae.indexOf("iframe")-1);ac=V.iframe_markup.replace(/{width}/g,j.width).replace(/{height}/g,j.height).replace(/{path}/g,ae);break;case"inline":ac=V.inline_markup.replace(/{content}/g,a(images[S]).html());var ah=a(images[S]).clone().wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo(a("body"));var ab=a(ah).width();var af=a(ah).height();j=B(ab,af,ad);j.originalWidth=ab;j.originalHeight=af;a(ah).remove();break;default:r=true;h(function(){a.prettyPhoto.close()},false);return}if(!ag){v.find("#pp_full_res")[0].innerHTML=ac;N()}}};function b(e,d){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c="[\\?&]"+e+"=([^&#]*)";var g=new RegExp(c);var f=g.exec(d);if(f==null){return""}else{return f[1]}}})(jQuery);
