window.dynamicOptionsManager||(function(a){window.dynamicOptionsManager=function(c,b){var e=function(){for(var g in this){if(typeof this[g]==="function"){this[g]=this[g].call(c)}}},f=function(k,j){var g,h;if(arguments.length===0){return new e()}else{if(arguments.length===1){if(typeof k==="string"){g=e.prototype[k];return(typeof g==="function")?g.call(c):g}else{if(typeof k==="object"){if(k.constructor===Array){g={};for(h in k){g[k[h]]=arguments.callee(k[h])}return g}else{for(h in k){e.prototype[h]=k[h]}}}}}else{if(typeof k==="string"){if(j===a){e.prototype[k]=b[k];if(e.prototype[k]===a){delete (e.prototype[k])}}else{e.prototype[k]=j}}}}};f.defined=function(g){return !(e.prototype[g]===a)};f.raw=function(g){return e.prototype[g]};e.prototype={};for(var d in b){e.prototype[d]=b[d]}return f}})();window.functionsQueue||(function(a){window.functionsQueue=function(d){var c=[],f=-1,e=function(){var g;f++;if(c.length===f){f=-1;return}if(c[f].constructor===Array){if(c[f][1]-->0){g=c[f][0]}else{b(f--);e();return}}else{g=c[f]}if(typeof g==="function"){g.continuer=e;if(g.call(d)!==false){e()}}},b=function(g){var h,j=[];for(h in c){if(h==g){continue}j[j.length]=c[h]}c=j};return function(g,j){if(arguments.length===0){if(f!==-1){return}e()}else{if(g!==a){if(g.constructor===Array){if(g.length<=2&&typeof g[0]==="function"&&typeof g[1]!=="function"){arguments.callee(g[0],g[1]||j)}else{for(var h in g){arguments.callee(g[h],j)}}}else{if(typeof g!=="function"){throw new Error("Impossible de mettre en attente autre chose qu'une fonction")}if(typeof j==="number"){g=[g,j]}c[c.length]=g}}}}}})();window.callbacksManager||(function(a){window.callbacksManager=function(b,d){var f=[],e=function(h,g,j){if(arguments.length===1){if(typeof h==="object"){for(var i in h){e(i,h[i])}}else{if(f[h]!==a){return f[h]()}}}else{if(arguments.length>1){if(f[h]===a){f[h]=window.functionsQueue(b)}f[h](g,j)}}};if(typeof d==="object"){for(var c in d){e(c,d[c])}}return e}})();window.jQuery&&(window.jQuery.fn.popin||(function(c,b,d){c(function(){if(navigator.userAgent.toLowerCase().indexOf("webkit")>-1){c(document.body).css("position","static")}});var a=["top","left","width","height","marginLeft","marginTop","opacity"];b.masque=(function(){var e=false;c(b).bind("keypress.masque",function(f){if(f.keyCode===27){if(e){e.hide()}}}).bind("masqueHide",function(){if(e){e.hide()}}).bind("masqueShow",function(){if(e){e.show()}});return function(k){if(this.constructor!==arguments.callee){return new arguments.callee(k)}var n=this,i,m,h=false,l=false,o=false,t=function(){c(b).unload(q);if(!e){e=n}if(typeof k==="object"){c.each(["preShow","postInsert","postShow","preHide","postHide"],function(v,w){if(k[w]!==d){if(k[w].constructor===Array&&typeof k[w][0]==="function"){n.callbacks(w,k[w][0],k[w][1])}else{if(k[w].constructor===Function){n.callbacks(w,k[w])}}}});for(var u in n.options()){if(k[u]!==d){n.options(u,k[u])}}if(typeof k.css==="object"){n.css(k.css)}}if(c.browser.msie&&c.browser.version<7){c(b).resize(j).scroll(j)}},q=function(){i=false;m=false},p=function(){if(!c.browser.msie||c.browser.version>7||!h){return}i.height(c(document).height()).width(c(document).width()).css({top:"-"+c(document.body).css("margin-top"),left:"-"+c(document.body).css("margin-left")})},f=function(){if(!c.browser.msie||c.browser.version>7||!h){return}m.height(document.documentElement.clientHeight-parseInt(c(document.body).css("margin-top"))-parseInt(c(document.body).css("margin-bottom"))).width(document.documentElement.clientWidth-parseInt(c(document.body).css("margin-left"))-parseInt(c(document.body).css("margin-right"))).css({top:c(document).scrollTop(),left:c(document).scrollLeft()})},j=function(){i.trigger("refresh");m.trigger("refresh")},r=function(u){if(u.target===this||c(u.target).hasClass(n.options("closeCls"))||c(u.target).parents("."+n.options("closeCls")).length){n.hide()}},g=function(){i=c("<div />").css(c.extend(n.css(),n.options("cssPreShow"))).hide().appendTo(document.body).bind("close",n.hide).bind("click",n.hide).after(m=c("<div />").css(n.cssContent()).bind("close",n.hide).bind("click",r)).animate(n.css(a),n.options("showSpeed"),function(){h=true;l=false;if(c.browser.msie&&c.browser.version<7){n.callbacks("postShow",j,1)}n.callbacks("postShow")});if(c.browser.msie&&c.browser.version<7){n.callbacks("postInsert",function(){i.bind("refresh",p);m.bind("refresh",f)},1)}n.callbacks("postInsert")},s=function(){if(c.browser.msie&&c.browser.version<7){i.css(n.css(["height","width","top","left"]))}i.animate(n.options("cssPostHide"),n.options("hideSpeed"),function(){m.remove();c(this).remove();o=false;h=false;n.callbacks("postHide")})};this.show=function(u){if(e&&e!==n){e.hide(function(){e=n;n.show(u)});return}if(h){if(typeof u==="function"){u.call(n)}return}if(typeof u==="function"){n.callbacks("postShow",u,1)}if(l){return}l=true;n.callbacks("preShow",g,1);n.callbacks("preShow")};this.hide=function(u){if(l){n.callbacks("postShow",function(){n.hide(u)},1);return}if(!h){if(typeof u==="function"){u.call(n)}return}if(typeof u==="function"){n.callbacks("postHide",u,1)}if(o){return}o=true;n.callbacks("preHide",s,1);n.callbacks("preHide")};this.visible=function(u,v){if(typeof u==="boolean"){if(u){n.show(v)}else{n.hide(v)}}return h||l};this.hiding=function(){return o};this.overlay=function(){return i};this.content=function(){return m};this.css=b.dynamicOptionsManager(this,b.masque.defaultCss);this.cssContent=b.dynamicOptionsManager(this,b.masque.defaultCssContent);this.options=b.dynamicOptionsManager(this,b.masque.defaultOptions);this.callbacks=b.callbacksManager(this);t()}})();b.masque.defaultCss={position:(c.browser.msie&&c.browser.version<7)?"absolute":"fixed","z-index":9000,top:(c.browser.msie&&c.browser.version<7)?function(){return c(document).scrollTop()-parseInt(c(document.body).css("margin-top"))}:0,left:(c.browser.msie&&c.browser.version<7)?function(){return c(document).scrollLeft()-parseInt(c(document.body).css("margin-left"))}:0,marginLeft:0,marginTop:0,background:"black",opacity:"0.8",width:(c.browser.msie&&c.browser.version<7)?function(){return document.documentElement.clientWidth}:"100%",height:(c.browser.msie&&c.browser.version<7)?function(){return document.documentElement.clientHeight}:"100%"};b.masque.defaultCssContent={position:(c.browser.msie&&c.browser.version<7)?"absolute":"fixed","z-index":function(){return this.css("z-index")+1},top:(c.browser.msie&&c.browser.version<7)?function(){return"-"+c(document.body).css("margin-top")}:0,left:(c.browser.msie&&c.browser.version<7)?function(){return"-"+c(document.body).css("margin-left")}:0,width:"100%",height:(c.browser.msie&&c.browser.version<7)?function(){return document.documentElement.clientHeight}:"100%"};b.masque.defaultOptions={showSpeed:"normal",hideSpeed:"normal",closeCls:"closePopin",cssPreShow:{opacity:0},cssPostHide:{opacity:0}};b.popin=function(g,o){if(this.constructor!==arguments.callee){return new arguments.callee(g,o)}var q=this,p=g,n=[],h=c("<div />"),f=c("<div />"),j=false,k=false,u={},l=b.masque(o!==d?o.masque:d),t=function(){if(typeof o=="object"){c.each(["postInsert","preShow","postShow","preHide","postHide"],function(w,x){if(o[x]!==d){if(o[x].constructor===Array&&o[x].length===2&&typeof o[x][0]=="function"&&typeof o[x][1]=="number"){q.callbacks(x,o[x][0],o[x][1])}else{if(o[x].constructor===Function||o[x].constructor===Array){q.callbacks(x,o[x])}}}});for(var v in o){if(v!=="skin"&&q.options.defined(v)){q.options(v,o[v])}}if(o.skin!==d){q.options("skin",[o.skin,q.options.raw("skin")])}if(typeof o.css=="object"){q.css(o.css)}}l.callbacks("preHide",m);l.callbacks(q.options("waitBeforeShowingPopin")?"postShow":"postInsert",r);q.container(q.options("skin"));k=true;if(p){q.content(p)}if(q.options("autoShow")){r()}},r=function(v){if(j){if(typeof v=="function"){v.call(q)}return}if(typeof v=="function"){q.callbacks("postShow",v,1)}if(!l.visible()){l.show();return}q.callbacks("preShow",i,1);q.callbacks("preShow")},i=function(){var w=q.css(),x=c.extend({},w,q.options("cssPreShow")),v={};c.each(a,function(y,z){if(w[z]!==d&&w[z]!==x[z]){v[z]=w[z]}});j=true;h.css(x).each(function(){if(q.options("hideChildren")){f.children().hide()}}).appendTo(l.content()).animate(v,q.options("showSpeed"),function(){if(q.options("hideChildren")){f.children().show()}if(c.browser.msie){c(this).children().each(function(){c(this).attr("style",(c(this).attr("style")||"").replace(/display\s*:\s*(inline)\s*;?/i,"")||false)});if(c(this).css("opacity")==1){c(this).attr("style",(c(this).attr("style")||"").replace(/filter\s*:\s*alpha[^;]*(;|$)/i,"")||false)}}q.callbacks("postShow",q.refreshSize,1);q.callbacks("postShow")})},m=function(v){if(!j){if(typeof v=="function"){v.call(q)}return}if(typeof v=="function"){q.callbacks("postHide",v,1)}if(!l.hiding()){l.hide();return}q.callbacks("preHide",s,1);q.callbacks("preHide");if(typeof arguments.callee.continuer==="function"&&q.options("waitBeforeHidingMasque")){q.callbacks("postHide",arguments.callee.continuer,1);return false}},s=function(){j=false;h.each(function(){if(q.options("hideChildren")){f.children().hide()}}).animate(q.options("cssPostHide"),q.options("hideSpeed"),function(){c(this).remove().bind("popinShow",r);if(q.options("hideChildren")){f.children().show()}q.callbacks("postHide")})},e=function(w){if(!w||n[w]!==d){return}else{n[w]=true;if(typeof w==="string"&&q.skins.defined(w)){w=q.skins(w)||h}if(w.constructor===Array){for(var v in w){e(w[v])}return}if(!(typeof w==="string"||w.nodeType)||c(w).length===0){return}h=c(w)}};this.css=b.dynamicOptionsManager(this,b.popin.defaultCss);this.skins=b.dynamicOptionsManager(this,b.popin.skins);this.options=b.dynamicOptionsManager(this,b.popin.defaultOptions);this.callbacks=b.callbacksManager(this,b.popin.defaultCallbacks);this.show=l.show;this.hide=l.hide;this.container=function(v){if(arguments.length===0){return h}contentElements=q.content();e(v);h.addClass(q.options("clsContainer")).css(q.css(["position","overflow"])).unbind("refresh").bind("refresh",q.refreshSize).each(function(){f=c(this).find("."+q.options("clsContent")+":first").empty().append(contentElements);if(f.length===0){f=c('<div class="'+q.options("clsContent")+'" />').append(contentElements).appendTo(c(this))}})};this.content=function(v,w){if(arguments.length===0){return k?f.contents():p}if(!k){p=v}else{if(typeof w==="function"){q.callbacks("postInsert",w,1)}f.empty().append(v);q.initSize();q.callbacks("postInsert")}};this.initSize=function(){if(!j){h.css({top:"-200%",left:"-200%",opacity:0}).appendTo("body");q.refreshSize(false);h.remove()}else{q.refreshSize()}};this.refreshSize=function(w){var v=u;h.css({height:"auto",width:"auto"});u={width:h.width(),height:h.height()};h.css(q.css(["height","width"]));if(w!==false){if(v.width!=u.width||v.height!=u.height){q.refreshPosition()}}};this.refreshPosition=function(){h.animate(q.css(["top","left","marginLeft","marginTop"]),q.options("refreshPositionSpeed"))};this.size=function(v){if(arguments.length===0){return u}u={width:v.width,height:v.height}};this.masque=function(){return l};t()};b.popin.skins={closeBtn:function(){var g=this.options("cssPreShow"),e=this.options("cssPostHide"),f=this.masque().options("closeCls");if(g&&(g.height!==d||g.width!==d)){this.callbacks({postShow:function(){this.container().children("."+f).show()},preShow:function(){this.container().children("."+f).hide()}})}if(e&&(e.height!==d||e.width!==d)){this.callbacks({preHide:function(){this.container().children("."+f).hide()}})}return this.container().append(c('<div class="'+f+'" />').css({position:"absolute",top:"-15px",right:"-15px",cursor:"pointer"}).append('<img src="closepopin.png" alt="Fermer" />'))},ajaxLink:function(){var e=this.content();this.content("");this.callbacks("preShow",[function(){var f=arguments.callee.continuer,g=this;c.get(e,function(h){g.content(h);f()});return false},1])}};b.popin.defaultCss={position:"absolute",background:"white",overflow:"visible",left:function(){return(this.size().width>this.masque().overlay().width())?"0":"50%"},top:function(){return(this.size().height>this.masque().overlay().height())?"0":"50%"},height:function(){return this.size().height},width:function(){return this.size().width},marginTop:function(){return(this.size().height>this.masque().overlay().height())?"0":"-"+this.size().height/2+"px"},marginLeft:function(){return(this.size().width>this.masque().overlay().width())?"0":"-"+this.size().width/2+"px"},opacity:1};b.popin.defaultOptions={autoShow:true,waitBeforeHidingMasque:true,waitBeforeShowingPopin:true,hideChildren:true,showSpeed:"slow",hideSpeed:"slow",refreshPositionSpeed:"slow",clsContainer:"popinContainer",clsContent:"popinContent",skin:false,cssPreShow:{opacity:0},cssPostHide:{opacity:0}};b.popin.defaultCallbacks={};c.fn.popinTrigger=function(e,g,f){if(arguments.length==2&&typeof g=="string"){f=g;g=d}if(f==d){f="click"}return this.each(function(){c(this).bind(f,(function(j){var m,i=(f=="click"&&j.is("a"))?false:d,l=function(){m=b.popin((typeof e=="function")?e.call(j):e,g);k=h;return i},h=function(){m.show();return i},k=l;return function(){return k()}})(c(this)))})};c.fn.popinAjaxTrigger=function(h,i,g){if(!/^(string|function)$/.test(typeof h)){g=i;i=typeof h==="object"?h:{};h=function(){return c(this).attr("href")}}else{if(typeof i==="string"){var f=g;g=i;i=typeof f==="object"?f:{}}}return this.each(function(){(i||(i={})).skin=["ajaxLink",(i||{}).skin];c(this).popinTrigger(h,i,g)})}})(window.jQuery,this));
