/*
* Slides, A Slideshow Plugin for jQuery
* Intructions: http://slidesjs.com
* By: Nathan Searles, http://nathansearles.com
* Version: 1.0
* Updated: November 21st, 2010
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function askDomain(a){var b="<h2>Authentification via Google Apps</h2>";return b+='<form method="get" action="'+a+'">',b+='<div><label for="domain">Indiquez votre nom de domaine:</label><br/>',b+='<input type="text" id="domain" name="domain" class="text large"/></div>',b+='<div><input type="submit" class="submit button" value="Connexion"/></div>',b+="</form>",$.colorbox({html:b,initialWidth:"440px",initialHeight:"230px",width:"440px",height:"230px"}),!1}(function(a){a.fn.slides=function(b){return b=a.extend({},a.fn.slides.option,b),this.each(function(){function v(){clearInterval(c.data("interval"))}function w(){b.pause?(clearTimeout(c.data("pause")),clearInterval(c.data("interval")),pauseTimeout=setTimeout(function(){clearTimeout(c.data("pause")),playInterval=setInterval(function(){x("next",i)},b.play),c.data("interval",playInterval)},b.pause),c.data("pause",pauseTimeout)):v()}function x(g,h,i){if(!q&&p){q=!0;switch(g){case"next":l=n,k=n+1,k=e===k?0:k,s=f*2,g=-f*2,n=k;break;case"prev":l=n,k=n-1,k=k===-1?e-1:k,s=0,g=0,n=k;break;case"slider_controls":k=parseInt(i,10),l=a("."+b.paginationClass+" li.current a",c).attr("rel"),k>l?(s=f*2,g=-f*2):(s=0,g=0),n=k}h==="fade"?b.crossfade?d.children(":eq("+k+")",c).css({zIndex:10}).fadeIn(b.fadeSpeed,function(){d.children(":eq("+l+")",c).css({display:"none",zIndex:0}),a(this).css({zIndex:0}),q=!1}):d.children(":eq("+l+")",c).fadeOut(b.fadeSpeed,function(){b.autoHeight?d.animate({height:d.children(":eq("+k+")",c).outerHeight()},b.autoHeightSpeed,function(){d.children(":eq("+k+")",c).fadeIn(c.data("slider").fadeSpeed)}):d.children(":eq("+k+")",c).fadeIn(b.fadeSpeed,function(){a.browser.msie&&a(this).get(0).style.removeAttribute("filter")}),q=!1}):(d.children(":eq("+k+")").css({left:s,display:"block"}),b.autoHeight?d.animate({left:g,height:d.children(":eq("+k+")").outerHeight()},b.slideSpeed,function(){d.css({left:-f}),d.children(":eq("+k+")").css({left:f,zIndex:5}),d.children(":eq("+l+")").css({left:f,display:"none",zIndex:0}),q=!1}):d.animate({left:g},b.slideSpeed,function(){d.css({left:-f}),d.children(":eq("+k+")").css({left:f,zIndex:5}),d.children(":eq("+l+")").css({left:f,display:"none",zIndex:0}),q=!1})),b.pagination&&(a("."+b.paginationClass+" li.current",c).removeClass("current"),a("."+b.paginationClass+" li a:eq("+k+")",c).parent().addClass("current"))}}a("."+b.container,a(this)).children().wrapAll('<div class="slides_control"/>').children().css({display:"block"});var c=a(this),d=a(".slides_control",c),e=d.children().size(),f=d.children().outerWidth(),g=d.children().outerHeight(),h=b.start-1,i=b.effect.indexOf(",")<0?b.effect:b.effect.replace(" ","").split(",")[0],j=b.effect.indexOf(",")<0?i:b.effect.replace(" ","").split(",")[1],k=0,l=0,m=0,n=0,p,q,r,s,t;if(e<2)return;b.start&&(n=h),b.randomize&&d.randomize(),c.css({width:f}),a("."+b.container,c).css({overflow:"hidden",position:"relative"}),d.css({position:"relative",width:f*3,height:g,left:-f}),d.children().css({position:"absolute",top:0,left:f,zIndex:0,display:"none"}),b.autoHeight&&d.animate({height:d.children(":eq("+h+")").outerHeight()},o.autoHeightSpeed);if(b.preload&&d.children()[0].tagName=="IMG"){c.css({background:"url("+b.preloadImage+") no-repeat 50% 50%"});var u=a("img:eq("+h+")",c).attr("src")+"?"+(new Date).getTime();a("img:eq("+h+")",c).attr("src",u).load(function(){a(this).fadeIn(b.fadeSpeed,function(){a(this).css({zIndex:5}),c.css({background:""}),p=!0})})}else d.find(":eq("+h+")").fadeIn(b.fadeSpeed,function(){p=!0});b.bigTarget&&(d.children().css({cursor:"pointer"}),d.children().click(function(){return x("next",i),!1})),b.hoverPause&&b.play&&(d.children().bind("mouseover",function(){v()}),d.children().bind("mouseleave",function(){w()})),a("."+b.next,c).click(function(a){a.preventDefault(),b.play&&w(),x("next",i)}),a("."+b.prev,c).click(function(a){a.preventDefault(),b.play&&w(),x("prev",i)}),b.generatePagination&&(c.append("<ul class="+b.paginationClass+"></ul>"),d.children().each(function(){a("."+b.paginationClass,c).append("<li><a rel="+m+' href="#">'+(m+1)+"</a></li>"),m++})),a("."+b.paginationClass+" li a:eq("+h+")",c).parent().addClass("current"),a("."+b.paginationClass+" li a",c).click(function(){return b.play&&w(),r=a(this).attr("rel"),n!=r&&x("slider_controls",j,r),!1}),b.play&&(playInterval=setInterval(function(){x("next",i)},b.play),c.data("interval",playInterval))})},a.fn.slides.option={preload:!1,preloadImage:"/img/loading.gif",container:"slider_images",next:"next",prev:"prev",pagination:!0,generatePagination:!0,paginationClass:"slider_controls",fadeSpeed:350,slideSpeed:350,start:1,effect:"slide",crossfade:!1,randomize:!1,play:0,pause:0,hoverPause:!1,autoHeight:!1,autoHeightSpeed:350,bigTarget:!1},a.fn.randomize=function(b){function c(){return Math.round(Math.random())-.5}return a(this).each(function(){var d=a(this),e=d.children(),f=e.length;if(f>1){e.hide();var g=[];for(i=0;i<f;i++)g[g.length]=i;g=g.sort(c),a.each(g,function(a,c){var f=e.eq(c),g=f.clone(!0);g.show().appendTo(d),b!==undefined&&b(f,g),f.remove()})}})}})(jQuery),function(a,b){function U(b,c){return b=b?' id="'+e+b+'"':"",c=c?' style="'+c+'"':"",a("<div"+b+c+"/>")}function V(a,b){return b=b==="x"?y.width():y.height(),typeof a=="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function W(a){return O.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function X(b){for(var c in b)a.isFunction(b[c])&&c.substring(0,2)!=="on"&&(b[c]=b[c].call(M));return b.rel=b.rel||M.rel||"nofollow",b.href=b.href||a(M).attr("href"),b.title=b.title||M.title,b}function Y(b,c){c&&c.call(M),a.event.trigger(b)}function Z(){var a,b=e+"Slideshow_",c="click."+e,d,f,j;O.slideshow&&x[1]&&(d=function(){E.text(O.slideshowStop).unbind(c).bind(h,function(){if(N<x.length-1||O.loop)a=setTimeout(S.next,O.slideshowSpeed)}).bind(g,function(){clearTimeout(a)}).one(c+" "+i,f),q.removeClass(b+"off").addClass(b+"on"),a=setTimeout(S.next,O.slideshowSpeed)},f=function(){clearTimeout(a),E.text(O.slideshowStart).unbind([h,g,i,c].join(" ")).one(c,d),q.removeClass(b+"on").addClass(b+"off")},O.slideshowAuto?d():f())}function $(b){if(!R){M=b,O=X(a.extend({},a.data(M,d))),x=a(M),N=0,O.rel!=="nofollow"&&(x=a("."+T).filter(function(){var b=a.data(this,d).rel||this.rel;return b===O.rel}),N=x.index(M),N===-1&&(x=x.add(M),N=x.length-1));if(!P){P=Q=!0,q.show();if(O.returnFocus)try{M.blur(),a(M).one(j,function(){try{this.focus()}catch(a){}})}catch(c){}p.css({opacity:+O.opacity,cursor:O.overlayClose?"pointer":"auto"}).show(),O.w=V(O.initialWidth,"x"),O.h=V(O.initialHeight,"y"),S.position(0),n&&y.bind("resize."+o+" scroll."+o,function(){p.css({width:y.width(),height:y.height(),top:y.scrollTop(),left:y.scrollLeft()})}).trigger("scroll."+o),Y(f,O.onOpen),D.add(G).add(F).add(E).add(C).hide(),H.html(O.close).show()}S.load(!0)}}var c={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0},d="colorbox",e="cbox",f=e+"_open",g=e+"_load",h=e+"_complete",i=e+"_cleanup",j=e+"_closed",k=e+"_purge",l=e+"_loaded",m=a.browser.msie&&!a.support.opacity,n=m&&a.browser.version<7,o=e+"_IE6",p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R=!1,S,T=e+"Element";S=a.fn[d]=a[d]=function(b,e){var f=this,g;if(!f[0]&&f.selector)return f;b=b||{},e&&(b.onComplete=e);if(!f[0]||f.selector===undefined)f=a("<a/>"),b.open=!0;return f.each(function(){a.data(this,d,a.extend({},a.data(this,d)||c,b)),a(this).addClass(T)}),g=b.open,a.isFunction(g)&&(g=g.call(f)),g&&$(f[0]),f},S.init=function(){y=a(b),q=U().attr({id:d,"class":m?e+"IE":""}),p=U("Overlay",n?"position:absolute":"").hide(),r=U("Wrapper"),s=U("Content").append(z=U("LoadedContent","width:0; height:0; overflow:hidden"),B=U("LoadingOverlay").add(U("LoadingGraphic")),C=U("Title"),D=U("Current"),F=U("Next"),G=U("Previous"),E=U("Slideshow").bind(f,Z),H=U("Close")),r.append(U().append(U("TopLeft"),t=U("TopCenter"),U("TopRight")),U(!1,"clear:left").append(u=U("MiddleLeft"),s,v=U("MiddleRight")),U(!1,"clear:left").append(U("BottomLeft"),w=U("BottomCenter"),U("BottomRight"))).children().children().css({"float":"left"}),A=U(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(p,q.append(r,A)),s.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),I=t.height()+w.height()+s.outerHeight(!0)-s.height(),J=u.width()+v.width()+s.outerWidth(!0)-s.width(),K=z.outerHeight(!0),L=z.outerWidth(!0),q.css({"padding-bottom":I,"padding-right":J}).hide(),F.click(S.next),G.click(S.prev),H.click(S.close),s.children().removeClass("hover"),a("."+T).live("click",function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),$(this))}),p.click(function(){O.overlayClose&&S.close()}),a(document).bind("keydown",function(a){P&&O.escKey&&a.keyCode===27&&(a.preventDefault(),S.close()),P&&O.arrowKey&&!Q&&x[1]&&(a.keyCode===37&&(N||O.loop)?(a.preventDefault(),G.click()):a.keyCode===39&&(N<x.length-1||O.loop)&&(a.preventDefault(),F.click()))})},S.remove=function(){q.add(p).remove(),a("."+T).die("click").removeData(d).removeClass(T)},S.position=function(a,b){function f(a){t[0].style.width=w[0].style.width=s[0].style.width=a.style.width,B[0].style.height=B[1].style.height=s[0].style.height=u[0].style.height=v[0].style.height=a.style.height}var c,d=Math.max(document.documentElement.clientHeight-O.h-K-I,0)/2+y.scrollTop(),e=Math.max(y.width()-O.w-L-J,0)/2+y.scrollLeft();c=q.width()===O.w+L&&q.height()===O.h+K?0:a,r[0].style.width=r[0].style.height="9999px",q.dequeue().animate({width:O.w+L,height:O.h+K,top:d,left:e},{duration:c,complete:function(){f(this),Q=!1,r[0].style.width=O.w+L+J+"px",r[0].style.height=O.h+K+I+"px",b&&b()},step:function(){f(this)}})},S.resize=function(a){if(P){a=a||{},a.width&&(O.w=V(a.width,"x")-L-J),a.innerWidth&&(O.w=V(a.innerWidth,"x")),z.css({width:O.w}),a.height&&(O.h=V(a.height,"y")-K-I),a.innerHeight&&(O.h=V(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=z.wrapInner("<div style='overflow:auto'></div>").children();O.h=b.height(),b.replaceWith(b.children())}z.css({height:O.h}),S.position(O.transition==="none"?0:O.speed)}},S.prep=function(b){function g(){return O.w=O.w||z.width(),O.w=O.mw&&O.mw<O.w?O.mw:O.w,O.w}function j(){return O.h=O.h||z.height(),O.h=O.mh&&O.mh<O.h?O.mh:O.h,O.h}function k(b){var g,i,j,k,n=x.length,o=O.loop;S.position(b,function(){function b(){m&&q[0].style.removeAttribute("filter")}if(!P)return;m&&c&&z.fadeIn(100),z.show(),Y(l),C.show().html(O.title),n>1&&(typeof O.current=="string"&&D.html(O.current.replace(/\{current\}/,N+1).replace(/\{total\}/,n)).show(),F[o||N<n-1?"show":"hide"]().html(O.next),G[o||N?"show":"hide"]().html(O.previous),g=N?x[N-1]:x[n-1],j=N<n-1?x[N+1]:x[0],O.slideshow&&E.show(),O.preloading&&(k=a.data(j,d).href||j.href,i=a.data(g,d).href||g.href,k=a.isFunction(k)?k.call(j):k,i=a.isFunction(i)?i.call(g):i,W(k)&&(a("<img/>")[0].src=k),W(i)&&(a("<img/>")[0].src=i))),B.hide(),O.transition==="fade"?q.fadeTo(f,1,function(){b()}):b(),y.bind("resize."+e,function(){S.position(0)}),Y(h,O.onComplete)})}if(!P)return;var c,f=O.transition==="none"?0:O.speed;y.unbind("resize."+e),z.remove(),z=U("LoadedContent").html(b),z.hide().appendTo(A.show()).css({width:g(),overflow:O.scrolling?"auto":"hidden"}).css({height:j()}).prependTo(s),A.hide(),a("#"+e+"Photo").css({cssFloat:"none",marginLeft:"auto",marginRight:"auto"}),n&&a("select").not(q.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(i,function(){this.style.visibility="inherit"}),O.transition==="fade"?q.fadeTo(f,0,function(){k(0)}):k(f)},S.load=function(b){var c,f,h,i=S.prep;Q=!0,M=x[N],b||(O=X(a.extend({},a.data(M,d)))),Y(k),Y(g,O.onLoad),O.h=O.height?V(O.height,"y")-K-I:O.innerHeight&&V(O.innerHeight,"y"),O.w=O.width?V(O.width,"x")-L-J:O.innerWidth&&V(O.innerWidth,"x"),O.mw=O.w,O.mh=O.h,O.maxWidth&&(O.mw=V(O.maxWidth,"x")-L-J,O.mw=O.w&&O.w<O.mw?O.w:O.mw),O.maxHeight&&(O.mh=V(O.maxHeight,"y")-K-I,O.mh=O.h&&O.h<O.mh?O.h:O.mh),c=O.href,B.show(),O.inline?(U().hide().insertBefore(a(c)[0]).one(k,function(){a(this).replaceWith(z.children())}),i(a(c))):O.iframe?(q.one(l,function(){var b=a("<iframe frameborder='0' style='width:100%; height:100%; border:0; display:block'/>")[0];b.name=+(new Date),b.src=O.href,O.scrolling||(b.scrolling="no"),m&&(b.allowtransparency="true"),a(b).appendTo(z).one(k,function(){b.src="//about:blank"})}),i(" ")):O.html?i(O.html):W(c)?(f=new Image,f.onload=function(){var b;f.onload=null,f.id=e+"Photo",a(f).css({border:"none",display:"block",cssFloat:"left"}),O.scalePhotos&&(h=function(){f.height-=f.height*b,f.width-=f.width*b},O.mw&&f.width>O.mw&&(b=(f.width-O.mw)/f.width,h()),O.mh&&f.height>O.mh&&(b=(f.height-O.mh)/f.height,h())),O.h&&(f.style.marginTop=Math.max(O.h-f.height,0)/2+"px"),x[1]&&(N<x.length-1||O.loop)&&a(f).css({cursor:"pointer"}).click(S.next),m&&(f.style.msInterpolationMode="bicubic"),setTimeout(function(){i(f)},1)},setTimeout(function(){f.src=c},1)):c&&A.load(c,function(b,c,d){i(c==="error"?"Request unsuccessful: "+d.statusText:a(this).children())})},S.next=function(){Q||(N=N<x.length-1?N+1:0,S.load())},S.prev=function(){Q||(N=N?N-1:x.length-1,S.load())},S.close=function(){P&&!R&&(R=!0,P=!1,Y(i,O.onCleanup),y.unbind("."+e+" ."+o),p.fadeTo("fast",0),q.stop().fadeTo("fast",0,function(){Y(k),z.remove(),q.add(p).css({opacity:1,cursor:"auto"}).hide(),setTimeout(function(){R=!1,Y(j,O.onClosed)},1)}))},S.element=function(){return a(M)},S.settings=c,a(S.init)}(jQuery,this),$(document).ready(function(){$("#slider").slides({preloadImage:"/assets/ajax-loader.gif",preload:!0,play:5e3,pause:2500,hoverPause:!0}),$("a.external").click(function(){try{return typeof _gaq!="undefined"?(_gaq.push(["_link",this.href]),!1):!0}catch(a){return!0}})})
