window.addEvent("domready",TB_init);var TB_doneOnce=TB_HEIGHT=TB_WIDTH=0;function TB_init(){$$("a.smoothbox, a.thickbox").each(function(a){a.onclick=TB_bind})}function TB_bind(a){a=new Event(a);a.preventDefault();this.blur();TB_show(this.title||this.name||"",this.href,this.rel||false);this.onclick=TB_bind;return false}
function TB_show(a,b,h,d){if(!$("TB_overlay"))(new Element("iframe")).setProperty("id","TB_HideSelect").injectInside(document.body),$("TB_HideSelect").setOpacity(0),(new Element("div")).setProperty("id","TB_overlay").injectInside(document.body),$("TB_overlay").setOpacity(0),TB_overlaySize(),(new Element("div")).setProperty("id","TB_load").injectInside(document.body),$("TB_load").innerHTML="<img src='img/interface/thickbox/loadingAnimation.gif' />",TB_load_position(),$("TB_overlay").set("tween",{duration:400}),
$("TB_overlay").tween("opacity",0,0.6);if(!$("TB_load"))(new Element("div")).setProperty("id","TB_load").injectInside(document.body),$("TB_load").innerHTML="<img src='img/interface/thickbox/loadingAnimation.gif' />",TB_load_position();$("TB_window")||((new Element("div")).setProperty("id","TB_window").injectInside(document.body),$("TB_window").setOpacity(0));$("TB_overlay").onclick=TB_remove;window.onscroll=TB_position;var j=/\.(jpe?g|png|gif|bmp)/gi;if((b.match(/(.+)?/)[1]||b).match(j)){var l=a=
{caption:"",url:"",html:""},m=a;if(h){var a=function(a,b,c){return{caption:a.title,url:a.href,html:"<span id='TB_"+b+"'>&nbsp;&nbsp;<a href='#'>"+c+"</a></span>"}},k=[];$$("a.smoothbox").each(function(a){a.rel==h&&(k[k.length]=a)});for(var c=false,i=0;i<k.length;i++){var e=k[i];e.href.match(j);if(e.href==b)c=true;else if(c){m=a(e,"next","Next &gt;");break}else l=a(e,"prev","&lt; Prev")}}imgPreloader=new Image;imgPreloader.onload=function(){function a(b){return function(){$("TB_window").dispose();
(new Element("div")).setProperty("id","TB_window").injectInside(document.body);TB_show(b.caption,b.url,h);return false}}imgPreloader.onload=null;var b=window.getWidth()-150,c=window.getHeight()-150,f=imgPreloader.width,g=imgPreloader.height;f>b?(g*=b/f,f=b,g>c&&(f*=c/g,g=c)):g>c&&(f*=c/g,g=c,f>b&&(g*=b/f,f=b));TB_WIDTH=f+30;TB_HEIGHT=g+60;$("TB_closeWindowButton").onclick=TB_remove;var d=a(l),e=a(m);if($("TB_prev"))$("TB_prev").onclick=d;if($("TB_next"))$("TB_next").onclick=e;document.onkeydown=function(a){a=
new Event(a);switch(a.code){case 27:TB_remove();break;case 190:if($("TB_next"))document.onkeydown=null,e();break;case 188:if($("TB_prev"))document.onkeydown=null,d()}};$("TB_ImageOff").onclick=TB_remove;TB_position();TB_showWindow()};imgPreloader.src=b}else{j=b.match(/\?(.+)/)[1];c=TB_parseQuery(j);TB_WIDTH=c.width*1+30;TB_HEIGHT=c.height*1+40;var i=c.titleId?c.titleId:"TB_title",e=TB_WIDTH-30,n=TB_HEIGHT-45;b.indexOf("TB_iframe")!=-1?(urlNoQuery=b.split("TB_"),$("TB_window").innerHTML+="<div id='"+
i+"'><div id='TB_ajaxWindowTitle'>"+a+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src=\"img/interface/thickbox/fermer.gif\" alt=\"fermer\" /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent' style='width:"+(e+29)+"px;height:"+(n+17)+"px;' onload='TB_showWindow()'> </iframe>"):$("TB_window").innerHTML+="<div id='"+i+"'><div id='TB_ajaxWindowTitle'>"+a+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><img src=\"img/interface/thickbox/fermer.gif\" alt=\"fermer\" /></a></div></div><div id='TB_ajaxContent' style='width:"+
e+"px;height:"+n+"px;'></div>";$("TB_closeWindowButton").onclick=TB_remove;b.indexOf("TB_inline")!=-1?($("TB_ajaxContent").innerHTML=$(c.inlineId).innerHTML,TB_position(),TB_showWindow()):b.indexOf("TB_iframe")!=-1?(TB_position(),frames.TB_iframeContent==void 0&&($(document).keyup(function(a){a.keyCode==27&&TB_remove()}),TB_showWindow())):(new Request.HTML({method:"get",update:$("TB_ajaxContent"),onComplete:function(){TB_position();TB_showWindow();d&&d()}})).get(j)}window.onresize=function(){TB_position();
TB_load_position();TB_overlaySize()};document.onkeyup=function(a){a=new Event(a);a.code==27&&TB_remove()}}function TB_showWindow(){TB_doneOnce==0?(TB_doneOnce=1,$("TB_window").set("tween",{duration:250,onComplete:function(){$("TB_load")&&$("TB_load").dispose()}}),$("TB_window").tween("opacity",0,1)):($("TB_window").setStyle("opacity",1),$("TB_load")&&$("TB_load").dispose())}
function TB_remove(){$("TB_overlay").onclick=null;document.onkeyup=null;document.onkeydown=null;if($("TB_imageOff"))$("TB_imageOff").onclick=null;if($("TB_closeWindowButton"))$("TB_closeWindowButton").onclick=null;if($("TB_prev"))$("TB_prev").onclick=null;if($("TB_next"))$("TB_next").onclick=null;$("TB_window").set("tween",{duration:250,onComplete:function(){$("TB_window").dispose()}});$("TB_window").tween("opacity",1,0);$("TB_overlay").set("tween",{duration:400,onComplete:function(){$("TB_overlay").dispose()}});
$("TB_overlay").tween("opacity",0.6,0);window.onscroll=null;window.onresize=null;$("TB_HideSelect").dispose();TB_init();TB_doneOnce=0;return false}function TB_position(){$("TB_window").set("morph",{duration:75});$("TB_window").morph({width:TB_WIDTH+"px",left:window.getScrollLeft()+(window.getWidth()-TB_WIDTH)/2+"px",top:window.getScrollTop()+(window.getHeight()-TB_HEIGHT)/2+"px"})}
function TB_overlaySize(){$("TB_overlay").setStyles({height:"0px",width:"0px"});$("TB_HideSelect").setStyles({height:"0px",width:"0px"});$("TB_overlay").setStyles({height:window.getScrollHeight()+"px",width:window.getScrollWidth()+"px"});$("TB_HideSelect").setStyles({height:window.getScrollHeight()+"px",width:window.getScrollWidth()+"px"})}
function TB_load_position(){$("TB_load")&&$("TB_load").setStyles({left:window.getScrollLeft()+(window.getWidth()-56)/2+"px",top:window.getScrollTop()+(window.getHeight()-20)/2+"px",display:"block"})}function TB_parseQuery(a){if(!a)return{};for(var b={},a=a.split(/[;&]/),h=0;h<a.length;h++){var d=a[h].split("=");d&&d.length==2&&(b[unescape(d[0])]=unescape(d[1]).replace(/\+/g," "))}return b};

