/**
 * Dargaud - Avant Première Online
 * 2010 - Apsulis (http://demo.apsulis.com)
 * 
 */

/* DD_roundies 0.0.2a */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('t K={16:\'K\',1L:G,1M:G,1d:G,2f:y(){u(D.2g!=8&&D.1N&&!D.1N[q.16]){q.1L=M;q.1M=M}17 u(D.2g==8){q.1d=M}},2h:D.2i,1O:[],1b:{},2j:y(){u(q.1L||q.1M){D.1N.2L(q.16,\'2M:2N-2O-2P:x\')}u(q.1d){D.2Q(\'<?2R 2S="\'+q.16+\'" 2T="#1P#2k" ?>\')}},2l:y(){t a=D.1k(\'z\');D.2m.1w.1Q(a,D.2m.1w.1w);u(a.12){2n{t b=a.12;b.1x(q.16+\'\\\\:*\',\'{1l:2U(#1P#2k)}\');q.12=b}2o(2p){}}17{q.12=a}},1x:y(a,b,c){u(1R b==\'1S\'||b===2V){b=0}u(b.2W.2q().1y(\'2X\')==-1){b=b.2q().2Y(/[^0-9 ]/g,\'\').1T(\' \')}H(t i=0;i<4;i++){b[i]=(!b[i]&&b[i]!==0)?b[C.1e((i-2),0)]:b[i]}u(q.12){u(q.12.1x){t d=a.1T(\',\');H(t i=0;i<d.1U;i++){q.12.1x(d[i],\'1l:2Z(K.1V.2r(q, [\'+b.1W(\',\')+\']))\')}}17 u(c){t e=b.1W(\'F \')+\'F\';q.12.1z(D.2s(a+\' {Q-1f:\'+e+\'; -30-Q-1f:\'+e+\';}\'));q.12.1z(D.2s(a+\' {-1A-Q-1m-1n-1f:\'+b[0]+\'F \'+b[0]+\'F; -1A-Q-1m-1X-1f:\'+b[1]+\'F \'+b[1]+\'F; -1A-Q-1Y-1X-1f:\'+b[2]+\'F \'+b[2]+\'F; -1A-Q-1Y-1n-1f:\'+b[3]+\'F \'+b[3]+\'F;}\'))}}17 u(q.1d){q.1O.31({\'2t\':a,\'2u\':b})}},2v:y(a){2w(32.33){I\'z.Q\':I\'z.34\':I\'z.1B\':q.1o(a);13;I\'z.2x\':q.1Z(a);13;I\'z.1p\':I\'z.2y\':I\'z.2z\':q.1o(a);13;I\'z.20\':a.18.z.20=(a.z.20==\'S\')?\'S\':\'35\';13;I\'z.21\':q.22(a);13;I\'z.1c\':a.18.z.1c=a.z.1c;13}},1o:y(a){a.14.23=\'\';q.2A(a);q.1Z(a);q.1C(a);q.1D(a);q.24(a);q.2B(a);q.22(a)},22:y(a){u(a.W.21.1y(\'36\')!=-1){t b=a.W.21;b=1g(b.37(b.25(\'=\')+1,b.25(\')\')),10)/2C;H(t v 1h a.x){a.x[v].1i.38=b}}},2A:y(a){u(!a.W){1q}17{t b=a.W}a.14.1p=\'\';a.14.1E=\'\';t c=(b.1p==\'2D\');t d=M;u(b.1E!=\'S\'||a.1F){u(!a.1F){a.J=b.1E;a.J=a.J.39(5,a.J.25(\'")\')-5)}17{a.J=a.26}t e=q;u(!e.1b[a.J]){t f=D.1k(\'3a\');f.1r(\'3b\',y(){q.1s=q.3c;q.1t=q.3d;e.1D(a)});f.3e=e.16+\'3f\';f.14.23=\'1l:S; 1j:27; 1m:-2E; 1n:-2E; Q:S;\';f.26=a.J;f.2F(\'1s\');f.2F(\'1t\');D.2G.1Q(f,D.2G.1w);e.1b[a.J]=f}a.x.Z.1i.26=a.J;d=G}a.x.Z.2H=!d;a.x.Z.1G=\'S\';a.x.1u.2H=!c;a.x.1u.1G=b.1p;a.14.1E=\'S\';a.14.1p=\'2D\'},1Z:y(a){a.x.1H.1G=a.W.2x},1C:y(a){t c=[\'N\',\'19\',\'1a\',\'O\'];a.P={};H(t b=0;b<4;b++){a.P[c[b]]=1g(a.W[\'Q\'+c[b]+\'U\'],10)||0}},1D:y(c){t e=[\'O\',\'N\',\'U\',\'V\'];H(t d=0;d<4;d++){c.E[e[d]]=c[\'3g\'+e[d]]}t f=y(a,b){a.z.1n=(b?0:c.E.O)+\'F\';a.z.1m=(b?0:c.E.N)+\'F\';a.z.1s=c.E.U+\'F\';a.z.1t=c.E.V+\'F\'};H(t v 1h c.x){t g=(v==\'Z\')?1:2;c.x[v].3h=(c.E.U*g)+\', \'+(c.E.V*g);f(c.x[v],M)}f(c.18,G);u(K.1d){c.x.1H.z.28=\'-3i\';u(1R c.P==\'1S\'){q.1C(c)}c.x.1u.z.28=(c.P.N-1)+\'F \'+(c.P.O-1)+\'F\'}},24:y(j){t k=y(a,w,h,r,b,c,d){t e=a?[\'m\',\'1I\',\'l\',\'1J\',\'l\',\'1I\',\'l\',\'1J\',\'l\']:[\'1J\',\'l\',\'1I\',\'l\',\'1J\',\'l\',\'1I\',\'l\',\'m\'];b*=d;c*=d;w*=d;h*=d;t R=r.2I();H(t i=0;i<4;i++){R[i]*=d;R[i]=C.3j(w/2,h/2,R[i])}t f=[e[0]+C.11(0+b)+\',\'+C.11(R[0]+c),e[1]+C.11(R[0]+b)+\',\'+C.11(0+c),e[2]+C.15(w-R[1]+b)+\',\'+C.11(0+c),e[3]+C.15(w+b)+\',\'+C.11(R[1]+c),e[4]+C.15(w+b)+\',\'+C.15(h-R[2]+c),e[5]+C.15(w-R[2]+b)+\',\'+C.15(h+c),e[6]+C.11(R[3]+b)+\',\'+C.15(h+c),e[7]+C.11(0+b)+\',\'+C.15(h-R[3]+c),e[8]+C.11(0+b)+\',\'+C.11(R[0]+c)];u(!a){f.3k()}t g=f.1W(\'\');1q g};u(1R j.P==\'1S\'){q.1C(j)}t l=j.P;t m=j.2J.2I();t n=k(M,j.E.U,j.E.V,m,0,0,2);m[0]-=C.1e(l.O,l.N);m[1]-=C.1e(l.N,l.19);m[2]-=C.1e(l.19,l.1a);m[3]-=C.1e(l.1a,l.O);H(t i=0;i<4;i++){m[i]=C.1e(m[i],0)}t o=k(G,j.E.U-l.O-l.19,j.E.V-l.N-l.1a,m,l.O,l.N,2);t p=k(M,j.E.U-l.O-l.19+1,j.E.V-l.N-l.1a+1,m,l.O,l.N,1);j.x.1u.29=o;j.x.Z.29=p;j.x.1H.29=n+o;q.2K(j)},2B:y(a){t s=a.W;t b=[\'N\',\'O\',\'19\',\'1a\'];H(t i=0;i<4;i++){a.14[\'1B\'+b[i]]=(1g(s[\'1B\'+b[i]],10)||0)+(1g(s[\'Q\'+b[i]+\'U\'],10)||0)+\'F\'}a.14.Q=\'S\'},2K:y(e){t f=K;u(!e.J||!f.1b[e.J]){1q}t g=e.W;t h={\'X\':0,\'Y\':0};t i=y(a,b){t c=M;2w(b){I\'1n\':I\'1m\':h[a]=0;13;I\'3l\':h[a]=0.5;13;I\'1X\':I\'1Y\':h[a]=1;13;1P:u(b.1y(\'%\')!=-1){h[a]=1g(b,10)*0.3m}17{c=G}}t d=(a==\'X\');h[a]=C.15(c?((e.E[d?\'U\':\'V\']-(e.P[d?\'O\':\'N\']+e.P[d?\'19\':\'1a\']))*h[a])-(f.1b[e.J][d?\'1s\':\'1t\']*h[a]):1g(b,10));h[a]+=1};H(t b 1h h){i(b,g[\'2y\'+b])}e.x.Z.1i.1j=(h.X/(e.E.U-e.P.O-e.P.19+1))+\',\'+(h.Y/(e.E.V-e.P.N-e.P.1a+1));t j=g.2z;t c={\'T\':1,\'R\':e.E.U+1,\'B\':e.E.V+1,\'L\':1};t k={\'X\':{\'2a\':\'L\',\'2b\':\'R\',\'d\':\'U\'},\'Y\':{\'2a\':\'T\',\'2b\':\'B\',\'d\':\'V\'}};u(j!=\'2c\'){c={\'T\':(h.Y),\'R\':(h.X+f.1b[e.J].1s),\'B\':(h.Y+f.1b[e.J].1t),\'L\':(h.X)};u(j.1y(\'2c-\')!=-1){t v=j.1T(\'2c-\')[1].3n();c[k[v].2a]=1;c[k[v].2b]=e.E[k[v].d]+1}u(c.B>e.E.V){c.B=e.E.V+1}}e.x.Z.z.3o=\'3p(\'+c.T+\'F \'+c.R+\'F \'+c.B+\'F \'+c.L+\'F)\'},1v:y(a){t b=q;2d(y(){b.1o(a)},1)},2e:y(a){q.1D(a);q.24(a)},1V:y(b){q.z.1l=\'S\';u(!q.W){1q}17{t c=q.W}t d={3q:G,3r:G,3s:G,3t:G,3u:G,3v:G,3w:G};u(d[q.1K]===G){1q}t e=q;t f=K;q.2J=b;q.E={};t g={3x:\'2e\',3y:\'2e\'};u(q.1K==\'A\'){t i={3z:\'1v\',3A:\'1v\',3B:\'1v\',3C:\'1v\'};H(t a 1h i){g[a]=i[a]}}H(t h 1h g){q.1r(\'3D\'+h,y(){f[g[h]](e)})}q.1r(\'3E\',y(){f.2v(e)});t j=y(a){a.z.3F=1;u(a.W.1j==\'3G\'){a.z.1j=\'3H\'}};j(q.3I);j(q);q.18=D.1k(\'3J\');q.18.14.23=\'1l:S; 1j:27; 28:0; 1B:0; Q:0; 3K:S;\';q.18.z.1c=c.1c;q.x={\'1u\':M,\'Z\':M,\'1H\':M};H(t v 1h q.x){q.x[v]=D.1k(f.16+\':3L\');q.x[v].1i=D.1k(f.16+\':3M\');q.x[v].1z(q.x[v].1i);q.x[v].3N=G;q.x[v].z.1j=\'27\';q.x[v].z.1c=c.1c;q.x[v].3O=\'1,1\';q.18.1z(q.x[v])}q.x.Z.1G=\'S\';q.x.Z.1i.3P=\'3Q\';q.3R.1Q(q.18,q);q.1F=G;u(q.1K==\'3S\'){q.1F=M;q.z.3T=\'3U\'}2d(y(){f.1o(e)},1)}};2n{D.3V("3W",G,M)}2o(2p){}K.2f();K.2j();K.2l();u(K.1d&&D.1r&&K.2h){D.1r(\'3X\',y(){u(D.3Y==\'3Z\'){t d=K.1O;t e=d.1U;t f=y(a,b,c){2d(y(){K.1V.2r(a,b)},c*2C)};H(t i=0;i<e;i++){t g=D.2i(d[i].2t);t h=g.1U;H(t r=0;r<h;r++){u(g[r].1K!=\'40\'){f(g[r],d[i].2u,r)}}}}})}',62,249,'||||||||||||||||||||||||||this|||var|if|||vml|function|style|||Math|document|dim|px|false|for|case|vmlBg|DD_roundies||true|Top|Left|bW|border||none||Width|Height|currentStyle|||image||floor|styleSheet|break|runtimeStyle|ceil|ns|else|vmlBox|Right|Bottom|imgSize|zIndex|IE8|max|radius|parseInt|in|filler|position|createElement|behavior|top|left|applyVML|backgroundColor|return|attachEvent|width|height|color|pseudoClass|firstChild|addRule|search|appendChild|webkit|padding|vmlStrokeWeight|vmlOffsets|backgroundImage|isImg|fillcolor|stroke|qy|qx|nodeName|IE6|IE7|namespaces|selectorsToProcess|default|insertBefore|typeof|undefined|split|length|roundify|join|right|bottom|vmlStrokeColor|display|filter|vmlOpacity|cssText|vmlPath|lastIndexOf|src|absolute|margin|path|b1|b2|repeat|setTimeout|reposition|IEversion|documentMode|querySelector|querySelectorAll|createVmlNameSpace|VML|createVmlStyleSheet|documentElement|try|catch|err|toString|call|createTextNode|selector|radii|readPropertyChanges|switch|borderColor|backgroundPosition|backgroundRepeat|vmlFill|nixBorder|100|transparent|10000px|removeAttribute|body|filled|slice|DD_radii|clipImage|add|urn|schemas|microsoft|com|writeln|import|namespace|implementation|url|null|constructor|Array|replace|expression|moz|push|event|propertyName|borderWidth|block|lpha|substring|opacity|substr|img|onload|offsetWidth|offsetHeight|className|_sizeFinder|offset|coordsize|1px|min|reverse|center|01|toUpperCase|clip|rect|BODY|TABLE|TR|TD|SELECT|OPTION|TEXTAREA|resize|move|mouseleave|mouseenter|focus|blur|on|onpropertychange|zoom|static|relative|offsetParent|ignore|background|shape|fill|stroked|coordorigin|type|tile|parentNode|IMG|visibility|hidden|execCommand|BackgroundImageCache|onreadystatechange|readyState|complete|INPUT'.split('|'),0,{}))
/* ToggleVal 3.0 */
;eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.l.e=5(2){4(!2||t 2==\'G\'){2=$.r({},$.l.e.B,2)}E 4(t 2==\'J\'&&2.I()==\'g\'){s g=m}b 0.H(5(){4(g){$(0).u(\'v.8\').u(\'F.8\').M(\'1\');b a}s 1=\'\';P(2.z){i\'f\':4($(0).9(\'f\')){1=$(0).9(\'f\');$(0).3(1)}j;i\'k\':4($(0).9(\'c\')){1=$(\'k[q="\'+$(0).9(\'c\')+\'"]\').o();$(0).3(1)}j;i\'N\':1=2.o;$(0).3(1);j;C:1=$(0).3()}$(0).d(\'8\').6(\'1\',1);4(2.x==m&&$(0).9(\'c\')){$(\'k[q="\'+$(0).9(\'c\')+\'"]\').L()}$(0).y(\'v.8\',5(){4($(0).3()==$(0).6(\'1\')){$(0).3(\'\')}$(0).d(2.h)}).y(\'F.8\',5(){4($(0).3()==\'\'&&!2.p){$(0).3($(0).6(\'1\'))}$(0).D(2.h);4($(0).3()!=\'\'&&$(0).3()!=$(0).6(\'1\')){$(0).d(2.n)}E{$(0).D(2.n)}})})};$.l.e.B={h:\'A-Q\',n:\'A-w\',z:\'C\',o:K,x:a,p:a};$.r($.O[\':\'],{8:5(7){b $(7).6(\'1\')||a},w:5(7){4($(7).6(\'1\')&&$(7).3()!=$(7).6(\'1\')){b m}b a}})})(R);',54,54,'this|defText|theOptions|val|if|function|data|elem|toggleval|attr|false|return|id|addClass|toggleVal|title|destroy|focusClass|case|break|label|fn|true|changedClass|text|sticky|for|extend|var|typeof|unbind|focus|changed|removeLabels|bind|populateFrom|tv|defaults|default|removeClass|else|blur|object|each|toLowerCase|string|null|remove|removeData|custom|expr|switch|focused|jQuery'.split('|'),0,{}))
/* ColorBox v1.3.8 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 */
eval(function(b,gb){var v="none",t="click",N="LoadedContent",d=false,x="resize.",o="y",u="auto",f=true,M="nofollow",q="on",n="x";function e(a,c){a=a?' id="'+k+a+'"':"";return b("<div"+a+(c?' style="'+c+'"':"")+"/>")}function p(a,b){b=b===n?m.width():m.height();return typeof a==="string"?Math.round(a.match(/%/)?b/100*parseInt(a,10):parseInt(a,10)):a}function Q(c){c=b.isFunction(c)?c.call(h):c;return a.photo||c.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function cb(){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!==q)a[c]=a[c].call(h);a.rel=a.rel||h.rel||M;a.href=a.href||b(h).attr("href");a.title=a.title||h.title}function db(d){h=d;a=b.extend({},b(h).data(r));cb();if(a.rel!==M){i=b("."+H).filter(function(){return (b(this).data(r).rel||this.rel)===a.rel});g=i.index(h);if(g===-1){i=i.add(h);g=i.length-1}}else{i=b(h);g=0}if(!w){w=F=f;R=h;try{R.blur()}catch(e){}b.event.trigger(hb);a.onOpen&&a.onOpen.call(h);y.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":u}).show();a.w=p(a.initialWidth,n);a.h=p(a.initialHeight,o);c.position(0);S&&m.bind(x+O+" scroll."+O,function(){y.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll."+O)}T.add(I).add(J).add(z).add(U).hide();V.html(a.close).show();c.slideshow();c.load()}var eb={transition:"elastic",speed:300,width:d,initialWidth:"600",innerWidth:d,maxWidth:d,height:d,initialHeight:"450",innerHeight:d,maxHeight:d,scalePhotos:f,scrolling:f,inline:d,html:d,iframe:d,photo:d,href:d,title:d,rel:d,opacity:.9,preloading:f,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:d,loop:f,slideshow:d,slideshowAuto:f,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:d,onLoad:d,onComplete:d,onCleanup:d,onClosed:d,overlayClose:f,escKey:f,arrowKey:f},r="colorbox",k="cbox",hb=k+"_open",P=k+"_load",W=k+"_complete",X=k+"_cleanup",fb=k+"_closed",G=b.browser.msie&&!b.support.opacity,S=G&&b.browser.version<7,O=k+"_IE6",y,j,E,s,Y,Z,ab,bb,i,m,l,K,L,U,T,z,J,I,V,C,D,A,B,h,R,g,a,w,F,c,H=k+"Element";c=b.fn[r]=b[r]=function(c,d){var a=this;if(!a[0]&&a.selector)return a;c=c||{};if(d)c.onComplete=d;if(!a[0]||a.selector===undefined){a=b("<a/>");c.open=f}a.each(function(){b(this).data(r,b.extend({},b(this).data(r)||eb,c)).addClass(H)});c.open&&db(a[0]);return a};c.init=function(){var h="hover";m=b(gb);j=e().attr({id:r,"class":G?k+"IE":""});y=e("Overlay",S?"position:absolute":"").hide();E=e("Wrapper");s=e("Content").append(l=e(N,"width:0; height:0"),L=e("LoadingOverlay").add(e("LoadingGraphic")),U=e("Title"),T=e("Current"),J=e("Next"),I=e("Previous"),z=e("Slideshow"),V=e("Close"));E.append(e().append(e("TopLeft"),Y=e("TopCenter"),e("TopRight")),e().append(Z=e("MiddleLeft"),s,ab=e("MiddleRight")),e().append(e("BottomLeft"),bb=e("BottomCenter"),e("BottomRight"))).children().children().css({"float":"left"});K=e(d,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(y,j.append(E,K));s.children().hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)}).addClass(h);C=Y.height()+bb.height()+s.outerHeight(f)-s.height();D=Z.width()+ab.width()+s.outerWidth(f)-s.width();A=l.outerHeight(f);B=l.outerWidth(f);j.css({"padding-bottom":C,"padding-right":D}).hide();J.click(c.next);I.click(c.prev);V.click(c.close);s.children().removeClass(h);b("."+H).live(t,function(a){if(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)return f;else{db(this);return d}});y.click(function(){a.overlayClose&&c.close()});b(document).bind("keydown",function(b){if(w&&a.escKey&&b.keyCode===27){b.preventDefault();c.close()}if(w&&a.arrowKey&&!F&&i[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();I.click()}else if(b.keyCode===39&&(g<i.length-1||a.loop)){b.preventDefault();J.click()}})};c.remove=function(){j.add(y).remove();b("."+H).die(t).removeData(r).removeClass(H)};c.position=function(f,b){function c(a){Y[0].style.width=bb[0].style.width=s[0].style.width=a.style.width;L[0].style.height=L[1].style.height=s[0].style.height=Z[0].style.height=ab[0].style.height=a.style.height}var e,h=Math.max(m.height()-a.h-A-C,0)/2+m.scrollTop(),g=Math.max(m.width()-a.w-B-D,0)/2+m.scrollLeft();e=j.width()===a.w+B&&j.height()===a.h+A?0:f;E[0].style.width=E[0].style.height="9999px";j.dequeue().animate({width:a.w+B,height:a.h+A,top:h,left:g},{duration:e,complete:function(){c(this);F=d;E[0].style.width=a.w+B+D+"px";E[0].style.height=a.h+A+C+"px";b&&b()},step:function(){c(this)}})};c.resize=function(b){if(w){b=b||{};if(b.width)a.w=p(b.width,n)-B-D;if(b.innerWidth)a.w=p(b.innerWidth,n);l.css({width:a.w});if(b.height)a.h=p(b.height,o)-A-C;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=l.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}l.css({height:a.h});c.position(a.transition===v?0:a.speed)}};c.prep=function(o){var d="hidden";function n(t){var o,q,s,n,d=i.length,e=a.loop;c.position(t,function(){function t(){G&&j[0].style.removeAttribute("filter")}if(w){G&&p&&l.fadeIn(100);a.iframe&&b("<iframe frameborder=0"+(a.scrolling?"":" scrolling='no'")+(G?" allowtransparency='true'":"")+"/>").appendTo(l).attr({src:a.href,name:(new Date).getTime()});l.show();U.show().html(a.title);if(d>1){T.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,d)).show();J[e||g<d-1?"show":"hide"]().html(a.next);I[e||g?"show":"hide"]().html(a.previous);o=g?i[g-1]:i[d-1];s=g<d-1?i[g+1]:i[0];if(a.slideshow){z.show();g===d-1&&!e&&j.is("."+k+"Slideshow_on")&&z.click()}if(a.preloading){n=b(s).data(r).href||s.href;q=b(o).data(r).href||o.href;if(Q(n))b("<img/>")[0].src=n;if(Q(q))b("<img/>")[0].src=q}}L.hide();a.transition==="fade"?j.fadeTo(f,1,function(){t()}):t();m.bind(x+k,function(){c.position(0)});b.event.trigger(W);a.onComplete&&a.onComplete.call(h)}})}if(w){var p,f=a.transition===v?0:a.speed;m.unbind(x+k);l.remove();l=e(N).html(o);l.hide().appendTo(K.show()).css({width:function(){a.w=a.w||l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?u:d}).css({height:function(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(s);K.hide();b("#"+k+"Photo").css({cssFloat:v});S&&b("select").not(j.find("select")).filter(function(){return this.style.visibility!==d}).css({visibility:d}).one(X,function(){this.style.visibility="inherit"});a.transition==="fade"?j.fadeTo(f,0,function(){n(0)}):n(f)}};c.load=function(){var j,d,q,m=c.prep;F=f;h=i[g];a=b.extend({},b(h).data(r));cb();b.event.trigger(P);a.onLoad&&a.onLoad.call(h);a.h=a.height?p(a.height,o)-A-C:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,n)-B-D:a.innerWidth&&p(a.innerWidth,n);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,n)-B-D;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-A-C;a.mh=a.h&&a.h<a.mh?a.h:a.mh}j=a.href;L.show();if(a.inline){e("InlineTemp").hide().insertBefore(b(j)[0]).bind(P+" "+X,function(){b(this).replaceWith(l.children())});m(b(j))}else if(a.iframe)m(" ");else if(a.html)m(a.html);else if(Q(j)){d=new Image;d.onload=function(){var e;d.onload=null;d.id=k+"Photo";b(d).css({margin:u,border:v,display:"block",cssFloat:"left"});if(a.scalePhotos){q=function(){d.height-=d.height*e;d.width-=d.width*e};if(a.mw&&d.width>a.mw){e=(d.width-a.mw)/d.width;q()}if(a.mh&&d.height>a.mh){e=(d.height-a.mh)/d.height;q()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";setTimeout(function(){m(d)},1);i[1]&&(g<i.length-1||a.loop)&&b(d).css({cursor:"pointer"}).click(c.next);if(G)d.style.msInterpolationMode="bicubic"};d.src=j}else e().appendTo(K).load(j,function(c,a,b){m(a==="error"?"Request unsuccessful: "+b.statusText:this)})};c.next=function(){if(!F){g=g<i.length-1?g+1:0;c.load()}};c.prev=function(){if(!F){g=g?g-1:i.length-1;c.load()}};c.slideshow=function(){function f(){z.text(a.slideshowStop).bind(W,function(){d=setTimeout(c.next,a.slideshowSpeed)}).bind(P,function(){clearTimeout(d)}).one(t,function(){e()});j.removeClass(b+"off").addClass(b+q)}var e,d,b=k+"Slideshow_";z.bind(fb,function(){z.unbind();clearTimeout(d);j.removeClass(b+"off "+b+q)});e=function(){clearTimeout(d);z.text(a.slideshowStart).unbind(W+" "+P).one(t,function(){f();d=setTimeout(c.next,a.slideshowSpeed)});j.removeClass(b+q).addClass(b+"off")};if(a.slideshow&&i[1])a.slideshowAuto?f():e()};c.close=function(){if(w){w=d;b.event.trigger(X);a.onCleanup&&a.onCleanup.call(h);m.unbind("."+k+" ."+O);y.fadeTo("fast",0);j.stop().fadeTo("fast",0,function(){j.find("iframe").attr("src","about:blank");l.remove();j.add(y).css({opacity:1,cursor:u}).hide();try{R.focus()}catch(c){}setTimeout(function(){b.event.trigger(fb);a.onClosed&&a.onClosed.call(h)},1)})}};c.element=function(){return b(h)};c.settings=eb;b(c.init)})(jQuery,this)


/* Fonctions Générales */
function myInitPages() {
    jQuery('body').addClass('hasJS');
	imgRollover('.swapImg');
	myToggleVal('.swapValue');
    jQuery('a[rel="external"]').click( function() { window.open( jQuery(this).attr('href') ); return false; });
	if(jQuery('#popupPrintPage').size() > 0) { if(window.print){ jQuery('#printLink').click(function() { window.print(); return false; }); } };
	if(jQuery('.rond').size() > 0){ DD_roundies.addRule('.rond', '0px 0px 10px 10px'); }
	/* Les Blocs Clicables */
	if(jQuery('.albumALire').length){ blockClick('.albumALire'); }
	if(jQuery('.listeAgenda li').length){ blockClick('.listeAgenda li'); }
	if(jQuery('.listeActus li').length){ blockClick('.listeActus li'); }
	if(jQuery('li.liensCache').length){ blockClick('#listeInterview ul li'); }
	if(jQuery('.unVisuel.actus li').length){ blockClick('.unVisuel.actus li'); }
	if(jQuery('.item .unite').length){ blockClick('.item .unite'); }
	if(jQuery('.ficheSeries #tousLesTitres tr').length){ blockClick('.ficheSeries #tousLesTitres tr'); }
}
/* Rollover sur les images appelées */
function imgRollover(elt) {
    jQuery(elt).each( function() {
		jQuery(this).hover(
			function() { jQuery(this).attr("src", jQuery(this).attr("src").replace("-off","-on")); },
			function () { jQuery(this).attr("src", jQuery(this).attr("src").replace("-on","-off")); }
		);
	});
}
/* Rollover sur les fleches */
function flechesRollover(elt) {
    jQuery(elt).each( function() {
		jQuery(this).hover(
			function() {
				couleur = jQuery(this).parent('.multiPage').children('span.couleur').attr('title');
				jQuery(this).children('img').attr("src", jQuery(this).children('img').attr("src").replace("-off","-"+couleur));
			},function() { jQuery(this).children('img').attr("src", jQuery(this).children('img').attr("src").replace("-"+couleur,"-off")); }
		);
	});
}
/* Rollover sur les blocs */
function blocsTableRollover(elt) {
    jQuery(elt).each( function() {
		jQuery(this).hover(
			function(){
				if(jQuery('body.orange').length){ couleur='#f0d6a2'; };
				//if(jQuery('body.rose').length){ couleur='#f7c7d9'; };
				// if(jQuery('body.vert')){ couleur=vert; };
				// if(jQuery('body.violet')){ couleur=violet; };
				// if(jQuery('body.orange')) couleur=orange;
				// if(jQuery('body.orange')) couleur=orange;
				// if(jQuery('body.orange')) couleur=orange;
				// couleur = jQuery('body').attr('class');
				/* TODO Récupérer en filtrant la CLASSE couleur qui se trouve sur la home */
				jQuery(this).children('td').animate({ backgroundColor: couleur}, 150);
			},function() {
				jQuery(this).not('.second').children('td').animate({ backgroundColor: '#ffffff'}, 150);
				jQuery(this).children('.second td').animate({ backgroundColor: '#e6e6e6'}, 150);
			}
		);
	});
}
/* Changement de valeur sur les Input */
myToggleVal = function(elt) {
	jQuery(elt).toggleVal();
}
function myImgOpacity(elt){
	jQuery(elt).hover(
		function(){jQuery(this).find('img').animate({opacity: 0.5}, 350);},
		function(){jQuery(this).find('img').animate({opacity: 1}, 350);}
	)
}
function myToggleSpan(elt){
	jQuery('.actif a').each(function(){
		jQuery(this).replaceWith("<span>"+$(this).html()+"</span>");
	});
}
function mySlider(elt){
	/* Les TABS */
	jQuery(".lesTabs").tabs(".slides > div.item", { effect: 'fade', rotate: true }).slideshow({clickable:false});
	// jQuery(".multiPage").tabs(".slides > div.item", { effect: 'fade', prev: '.precedante', next: '.suivante', rotate: true }).slideshow();
	// jQuery("#decouvertePlus .multiPage").tabs("#decouvertePlus .slides > div.item", { effect: 'fade', prev: '.precedante', next: '.suivante', rotate: true });
	// jQuery("#decouvertePlus .multiPage").tabs("#decouvertePlus .slides > div.item", { effect: 'fade', prev: '.precedante', next: '.suivante', rotate: true }).slideshow();
}
function myUne(){
	jQuery('.une').hide();
	jQuery('.une').first().show();
	jQuery('#autresUnes a').each(function(){
		jQuery(this).click(function(){
			lien = jQuery(this).attr('id');
			jQuery('.une').hide();
			jQuery('.'+lien).show();
			// jQuery('.'+lien).css('opacity','0').show().animate({opacity: 1},500);
			// jQuery('.'+lien+' .laUne, .'+lien+' .laUnePlusDInfos, .'+lien+' .laUneImage').css('opacity','0').show().animate({opacity: 1},500);
			return false;
		});
	});
}
function myGoodies(){
	jQuery('.taillesGoodies').hide();
	jQuery('.unGoodie').each(function(){
		jQuery(this).hover(
			function(){ jQuery(this).children('.taillesGoodies').toggle(); },
			function(){ jQuery(this).children('.taillesGoodies').toggle(); }
		);
	});	    
}

/* Fonction de block enfatns de hauteur egale  */
function hauteurEgale(elt){
	
  jQuery(elt).each(function(){
		var currentTallest = 0;
		jQuery(this).children().each(function(i){
			if (jQuery(this).height() > currentTallest) { currentTallest = jQuery(this).height(); }
		});
		// for ie6, set height since min-height isn't supported
		if (jQuery.browser.msie && jQuery.browser.version == 6.0) { jQuery(this).children().css({'height': currentTallest}); }
		jQuery(this).children().css({'min-height': currentTallest}); 
	});
	jQuery('.resultatConcours').hide();
	return this;
}
/* Bloc clicable */
function blockClick(elt) {
	jQuery(elt).each(function() {
		var lien = '';
		lien = jQuery(this).find('a');
		
		var where2go = '';
		where2go = jQuery(lien).attr('href');
		if(where2go){ 
			jQuery(this).css('cursor','pointer').hover(function(){ jQuery(lien).css('text-decoration','underline'); },function(){ jQuery(lien).css('text-decoration','none'); });
			jQuery(this).click(function() {
				window.location = where2go;
			});
		}
	});
}


/* Fonction de slide pour les annonces des precedetns concours */
function sliderConcours(elt) {
  
  jQuery('ul.tabs li a').bind({
    
	click : function(){
		
		var resultat = jQuery(this).attr('href');
		jQuery(this).animate({ opacity: 1 }).addClass('current').parents('.tabulation').addClass('ouvert').children('.panneauxResultat').find(resultat).addClass('ouverture').slideDown('slow').siblings().slideUp('normal');
		jQuery(this).parent().siblings('li').find('a').removeClass('current').animate({ opacity: 0.25 });
		// jQuery(this).animate({ opacity: 1 }).addClass('current').parent().siblings('li').find('a').removeClass('current').animate({ opacity: 0.25 }).parents('.tabulation').addClass('ouvert').children('.panneauxResultat').find(resultat).addClass('ouverture').slideDown('slow').siblings().slideUp('normal');
		
		if (jQuery(this).parents('.tabulation.ouvert').length) {
			jQuery(this).parents('.tabulation').siblings('.ouvert').removeClass('ouvert').find('a.current').removeClass('current').animate({ opacity: 0.25 }, function(){
				jQuery(this).parents('.tabulation').find('.ouverture').removeClass('ouverture').slideUp();
			});
		;}
		
		jQuery(this).parents('.tabulation').siblings().find('a').animate({ opacity: 0.25 });
		
      return false;
    }
    
  })
}
function myColorBox(){
	jQuery('a.modalBox').colorbox();
	jQuery('a.iFrameBox').colorbox({iframe:true, innerWidth:590, innerHeight:435});
}

/*function blocsTableToggle(){
	var i=0;
	
	//recup de la couleur de ligne autre que blanc pour reassign après sort//
	jQuery('#listeToutesLesSeries tbody tr.second:last').each(function(){
		var bgcolor=jQuery(this).children('td:first').css('background-color');
		if(bgcolor!='rgb(255, 255, 255)'){colorNotWhite=bgcolor;}
	});
	
	jQuery('#listeToutesLesSeries tbody tr').each(function(){
		if(i==1){
			jQuery(this).attr('class','second');
			jQuery(this).children('td').animate({ backgroundColor: colorNotWhite}, 0);
			i=0;
		}else{
			jQuery(this).removeAttr('class');
			jQuery(this).children('td').animate({ backgroundColor: '#ffffff'}, 0);
			i++;
		}
	});
}*/

function checkConcoursForm(){   
            var formOk = true;
            var msgError = '';
           
            //¤¤ On a des réponses pour tout ? ¤¤
            //Les checkbox
            var checkOk = true;
            $('.form-radio').each(function(iter) {
                var internCheck = false;
                $("input[name="+$(this).attr("name")+"]").each(function(iter2){
                    if($(this).attr('checked')) internCheck = true;
                });
               
                if(internCheck == false) checkOk = false;
            });
            //Texte
            $('.form-text').each(function(iter) {
                if($(this).val()==''){
                    msgError+= 'Il faut remplir les boites de texte.\n';
                    formOk = false;
                }
            });
            //Box du règlement cochée ?
            if(!$('#accordReglement').attr('checked')){
                formOk = false;
                msgError+= 'Il faut accepter le règlement.\n';
            }
            if(checkOk == false){
                formOk = false;
                msgError+= 'Il faut cocher une proposition par question.\n';
            }

            if(formOk == false){
                alert(msgError);
                return false;
            }
           
            return true;
}

function add_pub_clic(id){
	$.ajax({
		type: "GET",
		url: '/',
		async: false,
		data: 'action=add_pub_clic&id='+id,
		success: function(msg){
		}
	});
}

jQuery(document).ready(function(){
	initMyInitPages = myInitPages();	
	//if(jQuery("#sommaire #autresUnes").length){ jQuery("#sommaire #autresUnes").tabs("#sommaire .une", {event:'mouseover'}); }
	if(jQuery("#sommaire #autresUnes").length){ jQuery("#sommaire #autresUnes").tabs("#sommaire .une", {event:'mouseover',rotate: true}).slideshow({
		clickable:false,
		autoplay:true,
		interval:5000,
		next:null, //pour éviter impact des boutons .next nouveautés
		prev:null //pour éviter impact des boutons .prev nouveautés
	});}

	if(jQuery('#autresUnes').size() > 0){ initMyImgOpacity = myImgOpacity('#autresUnes a'); }
	//if(jQuery('.actif a').size() > 0){ initMyToggleSpan = myToggleSpan(); }
	if(jQuery('.multiPage').size() > 0){ initMySlider = mySlider(); flechesRollover('.precedante'); flechesRollover('.suivante'); }
	if(jQuery('#nouveautes .centre .unite').size() > 0){ jQuery('#contenu #nouveautes .centre .unite').hover( function(){jQuery(this).animate({ backgroundColor: "#e8f3c8"}, 400);}, function(){jQuery(this).animate({ backgroundColor: "#ffffff" }, 400);} );}
	if(jQuery('#decouvertePlus .centre .unite').size() > 0){ jQuery('#contenu #decouvertePlus .centre .unite').hover( function(){jQuery(this).animate({ backgroundColor: "#edd7c2"}, 400);}, function(){jQuery(this).animate({ backgroundColor: "#ffffff" }, 400);} );}
	if(jQuery('#une .une').size() > 0){ initMyUne = myUne(); }
	/*if(jQuery('#listeToutesLesSeries').length){jQuery('#listeToutesLesSeries').tablesorter({postSort: function(table){blocsTableToggle();}}); }*/
	if(jQuery("ul#visuelsExtraboxDeclencheurs").length){
		jQuery("ul#visuelsExtraboxDeclencheurs").tabs("#visuelsExtrabox .unVisuel", {event:'mouseover'});
		jQuery('#visuelsExtraboxDeclencheurs li').each( function() {
			jQuery(this).hover(
				function() { 
					if(jQuery(this).hasClass('ba')){ jQuery(this).parent('ul').removeClass().addClass('bgBa'); }
					if(jQuery(this).hasClass('itw')){ jQuery(this).parent('ul').removeClass().addClass('bgItw'); }
					if(jQuery(this).hasClass('actus')){ jQuery(this).parent('ul').removeClass().addClass('bgActus'); }
					if(jQuery(this).hasClass('goodies')){ jQuery(this).parent('ul').removeClass().addClass('bgGoodies'); }
					jQuery('#visuelsExtraboxDeclencheurs li').not(this).removeClass('expose');jQuery(this).addClass('expose');
				},
				function() {}
			);
		});	    
	}
	if(jQuery('.goodies').length){ initMyGoodies = myGoodies();	}
	if(jQuery('.jScrollPane').length){jQuery('.jScrollPane').jScrollPane();}
	/*if(jQuery('#listeToutesLesSeries tbody tr').length){ initMyBlocsTableRollover = blocsTableRollover('#listeToutesLesSeries tbody tr'); }*/
	
	//if(jQuery('.listeToutesLesSeriesExtra').length){jQuery('.listeToutesLesSeriesExtra').tablesorter({widthFixed: true}); }
	//if(jQuery('.listeToutesLesSeriesExtra tbody tr').length){ initMyBlocsTableRollover = blocsTableRollover('.listeToutesLesSeriesExtra tbody tr'); }

	if (jQuery('#formulaireMembre').length){ hauteurEgale('#formulaireInscriptionHaut'); }
	if (jQuery('#conteneurResultat').length) {sliderConcours('#conteneurResultat');hauteurEgale('.resultatConcours');}
	
	if (jQuery('#extra').length) {
		myImgOpacity('.visuel a, #extraBox #listeBandeAnnonce ul li, #extraBox #listeFondEcran ul li ');
	}
	
	jQuery('#sel_selectionnervotrehabillage').change(function(){
		jQuery('#form-habillage').submit();
	})
	
	if(jQuery('#modalBoxToShow,a.modalBox,a.iFrameBox').length){ initColorbox=myColorBox(); }	
	if(jQuery('#modalBoxToShow').length){ jQuery('#modalBoxToShow').click(); }	
	
	//BANDES ANNONCES
	//jQuery('#bandesAnnonces .vignetteExtra .visuel a').colorbox();
	// jQuery('#laBandeAnnonce .centre a').colorbox();
	// jQuery('.uneBandeAnnonce a').colorbox();
	// jQuery('#visuelsExtrabox .ba a[name="pop"]').colorbox();
	
	if(jQuery("#recherche").size() > 0){
		jQuery("#recherche").autocomplete("/recherche.html", {extraParams: {action: 'recherche'}});
		jQuery('input#recherche').result(function(event, data, formatted) {
			document.location.href = data["1"];
		});
	}
	if(jQuery("#recherche-footer").size() > 0){
		jQuery("#recherche-footer").autocomplete("/recherche.html", {extraParams: {action: 'recherche'}});
		jQuery('input#recherche-footer').result(function(event, data, formatted) {
			document.location.href = data["1"];
		});
	}
});

