//by dJuL - LOGIMEDIA (http://www.logimedia.fr)
function array(b){for(i=0;i<b;i++){this[i]=0}this.length=b}function integer(b){return b%(4294967295+1)}function shr(b,f){b=integer(b);f=integer(f);if(b-2147483648>=0){b=b%2147483648;b>>=f;b+=1073741824>>(f-1)}else{b>>=f}return b}function shl1(c){c=c%2147483648;if(c&1073741824==1073741824){c-=1073741824;c*=2;c+=2147483648}else{c*=2}return c}function shl(f,g){f=integer(f);g=integer(g);for(var b=0;b<g;b++){f=shl1(f)}return f}function and(h,k){h=integer(h);k=integer(k);var b=(h-2147483648);var g=(k-2147483648);if(b>=0){if(g>=0){return((b&g)+2147483648)}else{return(b&k)}}else{if(g>=0){return(h&g)}else{return(h&k)}}}function or(h,k){h=integer(h);k=integer(k);var b=(h-2147483648);var g=(k-2147483648);if(b>=0){if(g>=0){return((b|g)+2147483648)}else{return((b|k)+2147483648)}}else{if(g>=0){return((h|g)+2147483648)}else{return(h|k)}}}function xor(h,k){h=integer(h);k=integer(k);var b=(h-2147483648);var g=(k-2147483648);if(b>=0){if(g>=0){return(b^g)}else{return((b^k)+2147483648)}}else{if(g>=0){return((h^g)+2147483648)}else{return(h^k)}}}function not(c){c=integer(c);return(4294967295-c)}var state=new array(4);var count=new array(2);count[0]=0;count[1]=0;var buffer=new array(64);var transformBuffer=new array(16);var digestBits=new array(16);var S11=7;var S12=12;var S13=17;var S14=22;var S21=5;var S22=9;var S23=14;var S24=20;var S31=4;var S32=11;var S33=16;var S34=23;var S41=6;var S42=10;var S43=15;var S44=21;function F(f,g,d){return or(and(f,g),and(not(f),d))}function G(f,g,d){return or(and(f,d),and(g,not(d)))}function H(f,g,d){return xor(xor(f,g),d)}function I(f,g,d){return xor(g,or(f,not(d)))}function rotateLeft(d,f){return or(shl(d,f),(shr(d,(32-f))))}function FF(o,p,b,c,q,n,d){o=o+F(p,b,c)+q+d;o=rotateLeft(o,n);o=o+p;return o}function GG(o,p,b,c,q,n,d){o=o+G(p,b,c)+q+d;o=rotateLeft(o,n);o=o+p;return o}function HH(o,p,b,c,q,n,d){o=o+H(p,b,c)+q+d;o=rotateLeft(o,n);o=o+p;return o}function II(o,p,b,c,q,n,d){o=o+I(p,b,c)+q+d;o=rotateLeft(o,n);o=o+p;return o}function transform(n,c){var o=0,p=0,b=0,d=0;var q=transformBuffer;o=state[0];p=state[1];b=state[2];d=state[3];for(i=0;i<16;i++){q[i]=and(n[i*4+c],255);for(j=1;j<4;j++){q[i]+=shl(and(n[i*4+j+c],255),j*8)}}o=FF(o,p,b,d,q[0],S11,3614090360);d=FF(d,o,p,b,q[1],S12,3905402710);b=FF(b,d,o,p,q[2],S13,606105819);p=FF(p,b,d,o,q[3],S14,3250441966);o=FF(o,p,b,d,q[4],S11,4118548399);d=FF(d,o,p,b,q[5],S12,1200080426);b=FF(b,d,o,p,q[6],S13,2821735955);p=FF(p,b,d,o,q[7],S14,4249261313);o=FF(o,p,b,d,q[8],S11,1770035416);d=FF(d,o,p,b,q[9],S12,2336552879);b=FF(b,d,o,p,q[10],S13,4294925233);p=FF(p,b,d,o,q[11],S14,2304563134);o=FF(o,p,b,d,q[12],S11,1804603682);d=FF(d,o,p,b,q[13],S12,4254626195);b=FF(b,d,o,p,q[14],S13,2792965006);p=FF(p,b,d,o,q[15],S14,1236535329);o=GG(o,p,b,d,q[1],S21,4129170786);d=GG(d,o,p,b,q[6],S22,3225465664);b=GG(b,d,o,p,q[11],S23,643717713);p=GG(p,b,d,o,q[0],S24,3921069994);o=GG(o,p,b,d,q[5],S21,3593408605);d=GG(d,o,p,b,q[10],S22,38016083);b=GG(b,d,o,p,q[15],S23,3634488961);p=GG(p,b,d,o,q[4],S24,3889429448);o=GG(o,p,b,d,q[9],S21,568446438);d=GG(d,o,p,b,q[14],S22,3275163606);b=GG(b,d,o,p,q[3],S23,4107603335);p=GG(p,b,d,o,q[8],S24,1163531501);o=GG(o,p,b,d,q[13],S21,2850285829);d=GG(d,o,p,b,q[2],S22,4243563512);b=GG(b,d,o,p,q[7],S23,1735328473);p=GG(p,b,d,o,q[12],S24,2368359562);o=HH(o,p,b,d,q[5],S31,4294588738);d=HH(d,o,p,b,q[8],S32,2272392833);b=HH(b,d,o,p,q[11],S33,1839030562);p=HH(p,b,d,o,q[14],S34,4259657740);o=HH(o,p,b,d,q[1],S31,2763975236);d=HH(d,o,p,b,q[4],S32,1272893353);b=HH(b,d,o,p,q[7],S33,4139469664);p=HH(p,b,d,o,q[10],S34,3200236656);o=HH(o,p,b,d,q[13],S31,681279174);d=HH(d,o,p,b,q[0],S32,3936430074);b=HH(b,d,o,p,q[3],S33,3572445317);p=HH(p,b,d,o,q[6],S34,76029189);o=HH(o,p,b,d,q[9],S31,3654602809);d=HH(d,o,p,b,q[12],S32,3873151461);b=HH(b,d,o,p,q[15],S33,530742520);p=HH(p,b,d,o,q[2],S34,3299628645);o=II(o,p,b,d,q[0],S41,4096336452);d=II(d,o,p,b,q[7],S42,1126891415);b=II(b,d,o,p,q[14],S43,2878612391);p=II(p,b,d,o,q[5],S44,4237533241);o=II(o,p,b,d,q[12],S41,1700485571);d=II(d,o,p,b,q[3],S42,2399980690);b=II(b,d,o,p,q[10],S43,4293915773);p=II(p,b,d,o,q[1],S44,2240044497);o=II(o,p,b,d,q[8],S41,1873313359);d=II(d,o,p,b,q[15],S42,4264355552);b=II(b,d,o,p,q[6],S43,2734768916);p=II(p,b,d,o,q[13],S44,1309151649);o=II(o,p,b,d,q[4],S41,4149444226);d=II(d,o,p,b,q[11],S42,3174756917);b=II(b,d,o,p,q[2],S43,718787259);p=II(p,b,d,o,q[9],S44,3951481745);state[0]+=o;state[1]+=p;state[2]+=b;state[3]+=d}function init(){count[0]=count[1]=0;state[0]=1732584193;state[1]=4023233417;state[2]=2562383102;state[3]=271733878;for(i=0;i<digestBits.length;i++){digestBits[i]=0}}function update(b){var g,f;g=and(shr(count[0],3),63);if(count[0]<4294967295-7){count[0]+=8}else{count[1]++;count[0]-=4294967295+1;count[0]+=8}buffer[g]=and(b,255);if(g>=63){transform(buffer,0)}}function finish(){var k=new array(8);var h;var l=0,f=0,g=0;for(l=0;l<4;l++){k[l]=and(shr(count[0],(l*8)),255)}for(l=0;l<4;l++){k[l+4]=and(shr(count[1],(l*8)),255)}f=and(shr(count[0],3),63);g=(f<56)?(56-f):(120-f);h=new array(64);h[0]=128;for(l=0;l<g;l++){update(h[l])}for(l=0;l<8;l++){update(k[l])}for(l=0;l<4;l++){for(j=0;j<4;j++){digestBits[l*4+j]=and(shr(state[l],(j*8)),255)}}}function hexa(h){var k="0123456789abcdef";var g="";var f=h;for(hexa_i=0;hexa_i<8;hexa_i++){g=k.charAt(Math.abs(f)%16)+g;f=Math.floor(f/16)}return g}var ascii="01234567890123456789012345678901 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";function MD5(m){var l,o,k,n,p,q,r;init();for(k=0;k<m.length;k++){l=m.charAt(k);update(ascii.lastIndexOf(l))}finish();n=p=q=r=0;for(i=0;i<4;i++){n+=shl(digestBits[15-i],(i*8))}for(i=4;i<8;i++){p+=shl(digestBits[15-i],((i-4)*8))}for(i=8;i<12;i++){q+=shl(digestBits[15-i],((i-8)*8))}for(i=12;i<16;i++){r+=shl(digestBits[15-i],((i-12)*8))}o=hexa(r)+hexa(q)+hexa(p)+hexa(n);return o}function $defined(b){return(b!=undefined)}function $type(c){if(!$defined(c)){return false}if(c.htmlElement){return"element"}var d=typeof c;if(d=="object"&&c.nodeName){switch(c.nodeType){case 1:return"element";case 3:return(/\S/).test(c.nodeValue)?"textnode":"whitespace"}}if(d=="object"||d=="function"){switch(c.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class"}if(typeof c.length=="number"){if(c.item){return"collection"}if(c.callee){return"arguments"}}}return d}function $merge(){var l={};for(var k=0;k<arguments.length;k++){for(var g in arguments[k]){var h=arguments[k][g];var m=l[g];if(m&&$type(h)=="object"&&$type(m)=="object"){l[g]=$merge(m,h)}else{l[g]=h}}}return l}var $extend=function(){var d=arguments;if(!d[1]){d=[this,d[0]]}for(var c in d[1]){d[0][c]=d[1][c]}return d[0]};var $native=function(){for(var c=0,d=arguments.length;c<d;c++){arguments[c].extend=function(b){for(var f in b){if(!this.prototype[f]){this.prototype[f]=b[f]}if(!this[f]){this[f]=$native.generic(f)}}}}};$native.generic=function(b){return function(c){return this.prototype[b].apply(c,Array.prototype.slice.call(arguments,1))}};$native(Function,Array,String,Number);function $chk(b){return !!(b||b===0)}function $pick(c,d){return $defined(c)?c:d}function $random(c,d){return Math.floor(Math.random()*(d-c+1)+c)}function $time(){return new Date().getTime()}function $clear(b){clearTimeout(b);clearInterval(b);return null}var Abstract=function(b){b=b||{};b.extend=$extend;return b};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true}else{if(document.getBoxObjectFor!=null){window.gecko=true}}}window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};if(window.webkit){document.createElement("iframe")}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{}}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}var Class=function(c){var d=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this};$extend(d,this);d.prototype=c;d.constructor=Class;return d};Class.empty=function(){};Class.prototype={extend:function(h){var k=new this(null);for(var f in h){var g=k[f];k[f]=Class.Merge(g,h[f])}return new Class(k)},implement:function(){for(var c=0,d=arguments.length;c<d;c++){$extend(this.prototype,arguments[c])}}};Class.Merge=function(k,f){if(k&&k!=f){var h=$type(f);if(h!=$type(k)){return f}switch(h){case"function":var g=function(){this.parent=arguments.callee.parent;return f.apply(this,arguments)};g.parent=k;return g;case"object":return $merge(k,f)}}return f};var Chain=new Class({chain:function(b){this.chains=this.chains||[];this.chains.push(b);return this},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this)}},clearChain:function(){this.chains=[]}});var Events=new Class({addEvent:function(c,d){if(d!=Class.empty){this.$events=this.$events||{};this.$events[c]=this.$events[c]||[];this.$events[c].include(d)}return this},fireEvent:function(d,g,f){if(this.$events&&this.$events[d]){this.$events[d].each(function(b){b.create({bind:this,delay:f,"arguments":g})()},this)}return this},removeEvent:function(c,d){if(this.$events&&this.$events[c]){this.$events[c].remove(d)}return this}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var b in this.options){if($type(this.options[b]=="function")&&(/^on[A-Z]/).test(b)){this.addEvent(b,this.options[b])}}}return this}});Array.extend({forEach:function(k,f){for(var h=0,g=this.length;h<g;h++){k.call(f,this[h],h,this)}},filter:function(m,g){var l=[];for(var k=0,h=this.length;k<h;k++){if(m.call(g,this[k],k,this)){l.push(this[k])}}return l},map:function(m,g){var l=[];for(var k=0,h=this.length;k<h;k++){l[k]=m.call(g,this[k],k,this)}return l},every:function(k,f){for(var h=0,g=this.length;h<g;h++){if(!k.call(f,this[h],h,this)){return false}}return true},some:function(k,f){for(var h=0,g=this.length;h<g;h++){if(k.call(f,this[h],h,this)){return true}}return false},indexOf:function(k,f){var g=this.length;for(var h=(f<0)?Math.max(0,g+f):f||0;h<g;h++){if(this[h]===k){return h}}return -1},copy:function(f,k){f=f||0;if(f<0){f=this.length+f}k=k||(this.length-f);var g=[];for(var h=0;h<k;h++){g[h]=this[f++]}return g},remove:function(d){var g=0;var f=this.length;while(g<f){if(this[g]===d){this.splice(g,1);f--}else{g++}}return this},contains:function(d,c){return this.indexOf(d,c)!=-1},associate:function(k){var f={},h=Math.min(this.length,k.length);for(var g=0;g<h;g++){f[k[g]]=this[g]}return f},extend:function(d){for(var g=0,f=d.length;g<f;g++){this.push(d[g])}return this},merge:function(d){for(var g=0,f=d.length;g<f;g++){this.include(d[g])}return this},include:function(b){if(!this.contains(b)){this.push(b)}return this},getRandom:function(){return this[$random(0,this.length-1)]||null},getLast:function(){return this[this.length-1]||null}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(b){return Array.copy(b)}function $each(k,h,f){if(k&&typeof k.length=="number"&&$type(k)!="object"){Array.forEach(k,h,f)}else{for(var g in k){h.call(f||k,k[g],g)}}}Array.prototype.test=Array.prototype.contains;String.extend({test:function(d,c){return(($type(d)=="string")?new RegExp(d,c):d).test(this)},toInt:function(){return parseInt(this,10)},toFloat:function(){return parseFloat(this)},camelCase:function(){return this.replace(/-\D/g,function(b){return b.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(b){return(b.charAt(0)+"-"+b.charAt(1).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(b){return b.toUpperCase()})},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s{2,}/g," ").trim()},rgbToHex:function(c){var d=this.match(/\d{1,3}/g);return(d)?d.rgbToHex(c):false},hexToRgb:function(c){var d=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(d)?d.slice(1).hexToRgb(c):false},contains:function(d,c){return(c)?(c+this+c).indexOf(c+d+c)>-1:this.indexOf(d)>-1},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}});Array.extend({rgbToHex:function(f){if(this.length<3){return false}if(this.length==4&&this[3]==0&&!f){return"transparent"}var h=[];for(var g=0;g<3;g++){var k=(this[g]-0).toString(16);h.push((k.length==1)?"0"+k:k)}return f?h:"#"+h.join("")},hexToRgb:function(d){if(this.length!=3){return false}var f=[];for(var g=0;g<3;g++){f.push(parseInt((this[g].length==1)?this[g]+this[g]:this[g],16))}return d?f:"rgb("+f.join(",")+")"}});Function.extend({create:function(d){var c=this;d=$merge({bind:c,event:false,"arguments":null,delay:false,periodical:false,attempt:false},d);if($chk(d.arguments)&&$type(d.arguments)!="array"){d.arguments=[d.arguments]}return function(k){var b;if(d.event){k=k||window.event;b=[(d.event===true)?k:new d.event(k)];if(d.arguments){b.extend(d.arguments)}}else{b=d.arguments||arguments}var l=function(){return c.apply($pick(d.bind,c),b)};if(d.delay){return setTimeout(l,d.delay)}if(d.periodical){return setInterval(l,d.periodical)}if(d.attempt){try{return l()}catch(h){return false}}return l()}},pass:function(d,c){return this.create({"arguments":d,bind:c})},attempt:function(d,c){return this.create({"arguments":d,bind:c,attempt:true})()},bind:function(c,d){return this.create({bind:c,"arguments":d})},bindAsEventListener:function(c,d){return this.create({bind:c,event:true,"arguments":d})},delay:function(g,d,f){return this.create({delay:g,bind:d,"arguments":f})()},periodical:function(f,d,g){return this.create({periodical:f,bind:d,"arguments":g})()}});Number.extend({toInt:function(){return parseInt(this)},toFloat:function(){return parseFloat(this)},limit:function(c,d){return Math.min(d,Math.max(c,this))},round:function(b){b=Math.pow(10,b||0);return Math.round(this*b)/b},times:function(c){for(var d=0;d<this;d++){c(d)}}});var Element=new Class({initialize:function(f,k){if($type(f)=="string"){if(window.ie&&k&&(k.name||k.type)){var g=(k.name)?' name="'+k.name+'"':"";var h=(k.type)?' type="'+k.type+'"':"";delete k.name;delete k.type;f="<"+f+g+h+">"}f=document.createElement(f)}f=$(f);return(!k||!f)?f:f.set(k)}});var Elements=new Class({initialize:function(b){return(b)?$extend(b,this):this}});Elements.extend=function(d){for(var c in d){this.prototype[c]=d[c];this[c]=$native.generic(c)}};function $(c){if(!c){return null}if(c.htmlElement){return Garbage.collect(c)}if([window,document].contains(c)){return c}var d=$type(c);if(d=="string"){c=document.getElementById(c);d=(c)?"element":false}if(d!="element"){return null}if(c.htmlElement){return Garbage.collect(c)}if(["object","embed"].contains(c.tagName.toLowerCase())){return c}$extend(c,Element.prototype);c.htmlElement=function(){};return Garbage.collect(c)}document.getElementsBySelector=document.getElementsByTagName;function $$(){var f=[];for(var k=0,h=arguments.length;k<h;k++){var g=arguments[k];switch($type(g)){case"element":f.push(g);case"boolean":break;case false:break;case"string":g=document.getElementsBySelector(g,true);default:f.extend(g)}}return $$.unique(f)}$$.unique=function(k){var o=[];for(var n=0,l=k.length;n<l;n++){if(k[n].$included){continue}var m=$(k[n]);if(m&&!m.$included){m.$included=true;o.push(m)}}for(var q=0,p=o.length;q<p;q++){o[q].$included=null}return new Elements(o)};Elements.Multi=function(b){return function(){var n=arguments;var l=[];var k=true;for(var o=0,m=this.length,p;o<m;o++){p=this[o][b].apply(this[o],n);if($type(p)!="element"){k=false}l.push(p)}return(k)?$$.unique(l):l}};Element.extend=function(f){for(var g in f){HTMLElement.prototype[g]=f[g];Element.prototype[g]=f[g];Element[g]=$native.generic(g);var d=(Array.prototype[g])?g+"Elements":g;Elements.prototype[d]=Elements.Multi(g)}};Element.extend({set:function(f){for(var d in f){var g=f[d];switch(d){case"styles":this.setStyles(g);break;case"events":if(this.addEvents){this.addEvents(g)}break;case"properties":this.setProperties(g);break;default:this.setProperty(d,g)}}return this},inject:function(k,g){k=$(k);switch(g){case"before":k.parentNode.insertBefore(this,k);break;case"after":var h=k.getNext();if(!h){k.parentNode.appendChild(this)}else{k.parentNode.insertBefore(this,h)}break;case"top":var f=k.firstChild;if(f){k.insertBefore(this,f);break}default:k.appendChild(this)}return this},injectBefore:function(b){return this.inject(b,"before")},injectAfter:function(b){return this.inject(b,"after")},injectInside:function(b){return this.inject(b,"bottom")},injectTop:function(b){return this.inject(b,"top")},adopt:function(){var b=[];$each(arguments,function(c){b=b.concat(c)});$$(b).inject(this);return this},remove:function(){return this.parentNode.removeChild(this)},clone:function(d){var g=$(this.cloneNode(d!==false));if(!g.$events){return g}g.$events={};for(var f in this.$events){g.$events[f]={keys:$A(this.$events[f].keys),values:$A(this.$events[f].values)}}return g.removeEvents()},replaceWith:function(b){b=$(b);this.parentNode.replaceChild(b,this);return b},appendText:function(b){this.appendChild(document.createTextNode(b));return this},hasClass:function(b){return this.className.contains(b," ")},addClass:function(b){if(!this.hasClass(b)){this.className=(this.className+" "+b).clean()}return this},removeClass:function(b){this.className=this.className.replace(new RegExp("(^|\\s)"+b+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(b){return this.hasClass(b)?this.removeClass(b):this.addClass(b)},setStyle:function(c,d){switch(c){case"opacity":return this.setOpacity(parseFloat(d));case"float":c=(window.ie)?"styleFloat":"cssFloat"}c=c.camelCase();switch($type(d)){case"number":if(!["zIndex","zoom"].contains(c)){d+="px"}break;case"array":d="rgb("+d.join(",")+")"}this.style[c]=d;return this},setStyles:function(b){switch($type(b)){case"object":Element.setMany(this,"setStyle",b);break;case"string":this.style.cssText=b}return this},setOpacity:function(b){if(b==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(window.ie){this.style.filter=(b==1)?"":"alpha(opacity="+b*100+")"}this.style.opacity=this.$tmp.opacity=b;return this},getStyle:function(k){k=k.camelCase();var g=this.style[k];if(!$chk(g)){if(k=="opacity"){return this.$tmp.opacity}g=[];for(var h in Element.Styles){if(k==h){Element.Styles[h].each(function(c){var b=this.getStyle(c);g.push(parseInt(b)?b:"0px")},this);if(k=="border"){var f=g.every(function(b){return(b==g[0])});return(f)?g[0]:false}return g.join(" ")}}if(k.contains("border")){if(Element.Styles.border.contains(k)){return["Width","Style","Color"].map(function(b){return this.getStyle(k+b)},this).join(" ")}else{if(Element.borderShort.contains(k)){return["Top","Right","Bottom","Left"].map(function(b){return this.getStyle("border"+b+k.replace("border",""))},this).join(" ")}}}if(document.defaultView){g=document.defaultView.getComputedStyle(this,null).getPropertyValue(k.hyphenate())}else{if(this.currentStyle){g=this.currentStyle[k]}}}if(window.ie){g=Element.fixStyle(k,g,this)}if(g&&k.test(/color/i)&&g.contains("rgb")){return g.split("rgb").splice(1,4).map(function(b){return b.rgbToHex()}).join(" ")}return g},getStyles:function(){return Element.getMany(this,"getStyle",arguments)},walk:function(f,d){f+="Sibling";var g=(d)?this[d]:this[f];while(g&&$type(g)!="element"){g=g[f]}return $(g)},getPrevious:function(){return this.walk("previous")},getNext:function(){return this.walk("next")},getFirst:function(){return this.walk("next","firstChild")},getLast:function(){return this.walk("previous","lastChild")},getParent:function(){return $(this.parentNode)},getChildren:function(){return $$(this.childNodes)},hasChild:function(b){return !!$A(this.getElementsByTagName("*")).contains(b)},getProperty:function(f){var h=Element.Properties[f];if(h){return this[h]}var g=Element.PropertiesIFlag[f]||0;if(!window.ie||g){return this.getAttribute(f,g)}var k=this.attributes[f];return(k)?k.nodeValue:null},removeProperty:function(c){var d=Element.Properties[c];if(d){this[d]=""}else{this.removeAttribute(c)}return this},getProperties:function(){return Element.getMany(this,"getProperty",arguments)},setProperty:function(d,g){var f=Element.Properties[d];if(f){this[f]=g}else{this.setAttribute(d,g)}return this},setProperties:function(b){return Element.setMany(this,"setProperty",b)},setHTML:function(){this.innerHTML=$A(arguments).join("");return this},setText:function(c){var d=this.getTag();if(["style","script"].contains(d)){if(window.ie){if(d=="style"){this.styleSheet.cssText=c}else{if(d=="script"){this.setProperty("text",c)}}return this}else{this.removeChild(this.firstChild);return this.appendText(c)}}this[$defined(this.innerText)?"innerText":"textContent"]=c;return this},getText:function(){var b=this.getTag();if(["style","script"].contains(b)){if(window.ie){if(b=="style"){return this.styleSheet.cssText}else{if(b=="script"){return this.getProperty("text")}}}else{return this.innerHTML}}return($pick(this.innerText,this.textContent))},getTag:function(){return this.tagName.toLowerCase()},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("")}});Element.fixStyle=function(g,h,m){if($chk(parseInt(h))){return h}if(["height","width"].contains(g)){var k=(g=="width")?["left","right"]:["top","bottom"];var l=0;k.each(function(b){l+=m.getStyle("border-"+b+"-width").toInt()+m.getStyle("padding-"+b).toInt()});return m["offset"+g.capitalize()]-l+"px"}else{if(g.test(/border(.+)Width|margin|padding/)){return"0px"}}return h};Element.Styles={border:[],padding:[],margin:[]};["Top","Right","Bottom","Left"].each(function(c){for(var d in Element.Styles){Element.Styles[d].push(d+c)}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(h,f,k){var g={};$each(k,function(b){g[b]=h[f](b)});return g};Element.setMany=function(h,f,k){for(var g in k){h[f](g,k[g])}return h};Element.Properties=new Abstract({"class":"className","for":"htmlFor",colspan:"colSpan",rowspan:"rowSpan",accesskey:"accessKey",tabindex:"tabIndex",maxlength:"maxLength",readonly:"readOnly",frameborder:"frameBorder",value:"value",disabled:"disabled",checked:"checked",multiple:"multiple",selected:"selected"});Element.PropertiesIFlag={href:2,src:2};Element.Methods={Listeners:{addListener:function(c,d){if(this.addEventListener){this.addEventListener(c,d,false)}else{this.attachEvent("on"+c,d)}return this},removeListener:function(c,d){if(this.removeEventListener){this.removeEventListener(c,d,false)}else{this.detachEvent("on"+c,d)}return this}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(b){if(!b.$tmp){Garbage.elements.push(b);b.$tmp={opacity:1}}return b},trash:function(n){for(var l=0,k=n.length,m;l<k;l++){if(!(m=n[l])||!m.$tmp){continue}if(m.$events){m.fireEvent("trash").removeEvents()}for(var o in m.$tmp){m.$tmp[o]=null}for(var h in Element.prototype){m[h]=null}Garbage.elements[Garbage.elements.indexOf(m)]=null;m.htmlElement=m.$tmp=m=null}Garbage.elements.remove(null)},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements)}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);if(window.ie){window.addListener("unload",CollectGarbage)}});var Event=new Class({initialize:function(d){if(d&&d.$extended){return d}this.$extended=true;d=d||window.event;this.event=d;this.type=d.type;this.target=d.target||d.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode}this.shift=d.shiftKey;this.control=d.ctrlKey;this.alt=d.altKey;this.meta=d.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(d.wheelDelta)?d.wheelDelta/120:-(d.detail||0)/3}else{if(this.type.contains("key")){this.code=d.which||d.keyCode;for(var g in Event.keys){if(Event.keys[g]==this.code){this.key=g;break}}if(this.type=="keydown"){var f=this.code-111;if(f>0&&f<13){this.key="f"+f}}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else{if(this.type.test(/(click|mouse|menu)/)){this.page={x:d.pageX||d.clientX+document.documentElement.scrollLeft,y:d.pageY||d.clientY+document.documentElement.scrollTop};this.client={x:d.pageX?d.pageX-window.pageXOffset:d.clientX,y:d.pageY?d.pageY-window.pageYOffset:d.clientY};this.rightClick=(d.which==3)||(d.button==2);switch(this.type){case"mouseover":this.relatedTarget=d.relatedTarget||d.fromElement;break;case"mouseout":this.relatedTarget=d.relatedTarget||d.toElement}this.fixRelatedTarget()}}}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(b){this.relatedTarget=this.target}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Element.Methods.Events={addEvent:function(k,h){this.$events=this.$events||{};this.$events[k]=this.$events[k]||{keys:[],values:[]};if(this.$events[k].keys.contains(h)){return this}this.$events[k].keys.push(h);var g=k;var f=Element.Events[k];if(f){if(f.add){f.add.call(this,h)}if(f.map){h=f.map}if(f.type){g=f.type}}if(!this.addEventListener){h=h.create({bind:this,event:true})}this.$events[k].values.push(h);return(Element.NativeEvents.contains(g))?this.addListener(g,h):this},removeEvent:function(m,l){if(!this.$events||!this.$events[m]){return this}var h=this.$events[m].keys.indexOf(l);if(h==-1){return this}var k=this.$events[m].keys.splice(h,1)[0];var o=this.$events[m].values.splice(h,1)[0];var n=Element.Events[m];if(n){if(n.remove){n.remove.call(this,l)}if(n.type){m=n.type}}return(Element.NativeEvents.contains(m))?this.removeListener(m,o):this},addEvents:function(b){return Element.setMany(this,"addEvent",b)},removeEvents:function(d){if(!this.$events){return this}if(!d){for(var c in this.$events){this.removeEvents(c)}this.$events=null}else{if(this.$events[d]){this.$events[d].keys.each(function(b){this.removeEvent(d,b)},this);this.$events[d]=null}}return this},fireEvent:function(d,g,f){if(this.$events&&this.$events[d]){this.$events[d].keys.each(function(b){b.create({bind:this,delay:f,"arguments":g})()},this)}return this},cloneEvents:function(d,f){if(!d.$events){return this}if(!f){for(var g in d.$events){this.cloneEvents(d,g)}}else{if(d.$events[f]){d.$events[f].keys.each(function(b){this.addEvent(f,b)},this)}}return this}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({mouseenter:{type:"mouseover",map:function(b){b=new Event(b);if(b.relatedTarget!=this&&!this.hasChild(b.relatedTarget)){this.fireEvent("mouseenter",b)}}},mouseleave:{type:"mouseout",map:function(b){b=new Event(b);if(b.relatedTarget!=this&&!this.hasChild(b.relatedTarget)){this.fireEvent("mouseleave",b)}}},mousewheel:{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(c,d){return this.create({bind:c,"arguments":d,event:Event})}});Elements.extend({filterByTag:function(b){return new Elements(this.filter(function(c){return(Element.getTag(c)==b)}))},filterByClass:function(f,d){var g=this.filter(function(b){return(b.className&&b.className.contains(f," "))});return(d)?g:new Elements(g)},filterById:function(d,g){var f=this.filter(function(b){return(b.id==d)});return(g)?f:new Elements(f)},filterByAttribute:function(k,h,m,g){var l=this.filter(function(b){var c=Element.getProperty(b,k);if(!c){return false}if(!h){return true}switch(h){case"=":return(c==m);case"*=":return(c.contains(m));case"^=":return(c.substr(0,m.length)==m);case"$=":return(c.substr(c.length-m.length)==m);case"!=":return(c!=m);case"~=":return c.contains(m," ")}return false});return(g)?l:new Elements(l)}});function $E(d,c){return($(c)||document).getElement(d)}function $ES(d,c){return($(c)||document).getElementsBySelector(d)}$$.shared={regexp:/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,xpath:{getParam:function(k,m,g,l){var h=[m.namespaceURI?"xhtml:":"",g[1]];if(g[2]){h.push('[@id="',g[2],'"]')}if(g[3]){h.push('[contains(concat(" ", @class, " "), " ',g[3],' ")]')}if(g[4]){if(g[5]&&g[6]){switch(g[5]){case"*=":h.push("[contains(@",g[4],', "',g[6],'")]');break;case"^=":h.push("[starts-with(@",g[4],', "',g[6],'")]');break;case"$=":h.push("[substring(@",g[4],", string-length(@",g[4],") - ",g[6].length,' + 1) = "',g[6],'"]');break;case"=":h.push("[@",g[4],'="',g[6],'"]');break;case"!=":h.push("[@",g[4],'!="',g[6],'"]')}}else{h.push("[@",g[4],"]")}}k.push(h.join(""));return k},getItems:function(m,p,k){var q=[];var l=document.evaluate(".//"+m.join("//"),p,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var o=0,n=l.snapshotLength;o<n;o++){q.push(l.snapshotItem(o))}return(k)?q:new Elements(q.map($))}},normal:{getParam:function(h,l,g,k){if(k==0){if(g[2]){var m=l.getElementById(g[2]);if(!m||((g[1]!="*")&&(Element.getTag(m)!=g[1]))){return false}h=[m]}else{h=$A(l.getElementsByTagName(g[1]))}}else{h=$$.shared.getElementsByTagName(h,g[1]);if(g[2]){h=Elements.filterById(h,g[2],true)}}if(g[3]){h=Elements.filterByClass(h,g[3],true)}if(g[4]){h=Elements.filterByAttribute(h,g[4],g[5],g[6],true)}return h},getItems:function(f,g,d){return(d)?f:$$.unique(f)}},resolver:function(b){return(b=="xhtml")?"http://www.w3.org/1999/xhtml":false},getElementsByTagName:function(m,l){var g=[];for(var k=0,h=m.length;k<h;k++){g.extend(m[k].getElementsByTagName(l))}return g}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(l,k){var n=[];l=l.trim().split(" ");for(var p=0,o=l.length;p<o;p++){var q=l[p];var r=q.match($$.shared.regexp);if(!r){break}r[1]=r[1]||"*";var m=$$.shared[$$.shared.method].getParam(n,this,r,p);if(!m){break}n=m}return $$.shared[$$.shared.method].getItems(n,this,k)},getElement:function(b){return $(this.getElements(b,true)[0]||false)},getElementsBySelector:function(h,g){var m=[];h=h.split(",");for(var l=0,k=h.length;l<k;l++){m=m.concat(this.getElements(h[l],true))}return(g)?m:$$.unique(m)}};Element.extend({getElementById:function(d){var g=document.getElementById(d);if(!g){return false}for(var f=g.parentNode;f!=this;f=f.parentNode){if(!f){return false}}return g},getElementsByClassName:function(b){return this.getElements("."+b)}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var b=[];$each(this.options,function(c){if(c.selected){b.push($pick(c.value,c.text))}});return(this.multiple)?b:b[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break}case"textarea":return this.value}return false},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"))},toQueryString:function(){var b=[];this.getFormElements().each(function(l){var k=l.name;var g=l.getValue();if(g===false||!k||l.disabled){return}var h=function(c){b.push(k+"="+encodeURIComponent(c))};if($type(g)=="array"){g.each(h)}else{h(g)}});return b.join("&")}});Element.extend({scrollTo:function(d,c){this.scrollLeft=d;this.scrollTop=c},getSize:function(){return{scroll:{x:this.scrollLeft,y:this.scrollTop},size:{x:this.offsetWidth,y:this.offsetHeight},scrollSize:{x:this.scrollWidth,y:this.scrollHeight}}},getPosition:function(g){g=g||[];var h=this,f=0,k=0;do{f+=h.offsetLeft||0;k+=h.offsetTop||0;h=h.offsetParent}while(h);g.each(function(b){f-=b.scrollLeft||0;k-=b.scrollTop||0});return{x:f,y:k}},getTop:function(b){return this.getPosition(b).y},getLeft:function(b){return this.getPosition(b).x},getCoordinates:function(g){var f=this.getPosition(g);var d={width:this.offsetWidth,height:this.offsetHeight,left:f.x,top:f.y};d.right=d.left+d.width;d.bottom=d.top+d.height;return d}});Element.Events.domready={add:function(g){if(window.loaded){g.call(this);return}var f=function(){if(window.loaded){return}window.loaded=true;window.timer=$clear(window.timer);this.fireEvent("domready")}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(["loaded","complete"].contains(document.readyState)){f()}}.periodical(50)}else{if(document.readyState&&window.ie){if(!$("ie_ready")){var d=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script id="ie_ready" defer src="'+d+'"><\/script>');$("ie_ready").onreadystatechange=function(){if(this.readyState=="complete"){f()}}}}else{window.addListener("load",f);document.addListener("DOMContentLoaded",f)}}}};window.onDomReady=function(b){return this.addEvent("domready",b)};window.extend({getWidth:function(){if(this.webkit419){return this.innerWidth}if(this.opera){return document.body.clientWidth}return document.documentElement.clientWidth},getHeight:function(){if(this.webkit419){return this.innerHeight}if(this.opera){return document.body.clientHeight}return document.documentElement.clientHeight},getScrollWidth:function(){if(this.ie){return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth)}if(this.webkit){return document.body.scrollWidth}return document.documentElement.scrollWidth},getScrollHeight:function(){if(this.ie){return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight)}if(this.webkit){return document.body.scrollHeight}return document.documentElement.scrollHeight},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop},getSize:function(){return{size:{x:this.getWidth(),y:this.getHeight()},scrollSize:{x:this.getScrollWidth(),y:this.getScrollHeight()},scroll:{x:this.getScrollLeft(),y:this.getScrollTop()}}},getPosition:function(){return{x:0,y:0}}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(b){return -(Math.cos(Math.PI*b)-1)/2},duration:500,unit:"px",wait:true,fps:50},initialize:function(b){this.element=this.element||null;this.setOptions(b);if(this.options.initialize){this.options.initialize.call(this)}},step:function(){var b=$time();if(b<this.time+this.options.duration){this.delta=this.options.transition((b-this.time)/this.options.duration);this.setNow();this.increase()}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain()}},set:function(b){this.now=b;this.increase();return this},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(c,d){return(d-c)*this.delta+c},start:function(c,d){if(!this.options.wait){this.stop()}else{if(this.timer){return this}}this.from=c;this.to=d;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent("onStart",this.element);return this},stop:function(b){if(!this.timer){return this}this.timer=$clear(this.timer);if(!b){this.fireEvent("onCancel",this.element)}return this},custom:function(c,d){return this.start(c,d)},clearTimer:function(b){return this.stop(b)}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(g,d){if(g.test(/color/i)){return this.Color}var f=$type(d);if((f=="array")||(f=="string"&&d.contains(" "))){return this.Multi}return this.Single},parse:function(m,n,k){if(!k.push){k=[k]}var h=k[0],o=k[1];if(!$chk(o)){o=h;h=m.getStyle(n)}var l=this.select(n,o);return{from:l.parse(h),to:l.parse(o),css:l}}};Fx.CSS.Single={parse:function(b){return parseFloat(b)},getNow:function(d,g,f){return f.compute(d,g)},getValue:function(d,f,g){if(f=="px"&&g!="opacity"){d=Math.round(d)}return d+f}};Fx.CSS.Multi={parse:function(b){return b.push?b:b.split(" ").map(function(c){return parseFloat(c)})},getNow:function(g,m,l){var h=[];for(var k=0;k<g.length;k++){h[k]=l.compute(g[k],m[k])}return h},getValue:function(d,f,g){if(f=="px"&&g!="opacity"){d=d.map(Math.round)}return d.join(f+" ")+f}};Fx.CSS.Color={parse:function(b){return b.push?b:b.hexToRgb(true)},getNow:function(g,m,l){var h=[];for(var k=0;k<g.length;k++){h[k]=Math.round(l.compute(g[k],m[k]))}return h},getValue:function(b){return"rgb("+b.join(",")+")"}};Fx.Style=Fx.Base.extend({initialize:function(g,d,f){this.element=$(g);this.property=d;this.parent(f)},hide:function(){return this.set(0)},setNow:function(){this.now=this.css.getNow(this.from,this.to,this)},set:function(b){this.css=Fx.CSS.select(this.property,b);return this.parent(this.css.parse(b))},start:function(d,g){if(this.timer&&this.options.wait){return this}var f=Fx.CSS.parse(this.element,this.property,[d,g]);this.css=f.css;return this.parent(f.from,f.to)},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property))}});Element.extend({effect:function(c,d){return new Fx.Style(this,c,d)}});Fx.Styles=Fx.Base.extend({initialize:function(c,d){this.element=$(c);this.parent(d)},setNow:function(){for(var b in this.from){this.now[b]=this.css[b].getNow(this.from[b],this.to[b],this)}},set:function(d){var f={};this.css={};for(var g in d){this.css[g]=Fx.CSS.select(g,d[g]);f[g]=this.css[g].parse(d[g])}return this.parent(f)},start:function(l){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var g={},m={};for(var k in l){var h=Fx.CSS.parse(this.element,k,l[k]);g[k]=h.from;m[k]=h.to;this.css[k]=h.css}return this.parent(g,m)},increase:function(){for(var b in this.now){this.element.setStyle(b,this.css[b].getValue(this.now[b],this.options.unit,b))}}});Element.extend({effects:function(b){return new Fx.Styles(this,b)}});Fx.Elements=Fx.Base.extend({initialize:function(c,d){this.elements=$$(c);this.parent(d)},setNow:function(){for(var m in this.from){var h=this.from[m],o=this.to[m],l=this.css[m],k=this.now[m]={};for(var n in h){k[n]=l[n].getNow(h[n],o[n],this)}}},set:function(k){var m={};this.css={};for(var o in k){var q=k[o],n=this.css[o]={},l=m[o]={};for(var p in q){n[p]=Fx.CSS.select(p,q[p]);l[p]=n[p].parse(q[p])}}return this.parent(m)},start:function(u){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var p={},q={};for(var l in u){var n=u[l],r=p[l]={},o=q[l]={},t=this.css[l]={};for(var s in n){var m=Fx.CSS.parse(this.elements[l],s,n[s]);r[s]=m.from;o[s]=m.to;t[s]=m.css}}return this.parent(p,q)},increase:function(){for(var k in this.now){var g=this.now[k],h=this.css[k];for(var f in g){this.elements[k].setStyle(f,h[f].getValue(g[f],this.options.unit,f))}}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{x:0,y:0},wheelStops:true},initialize:function(c,d){this.now=[];this.element=$(c);this.bound={stop:this.stop.bind(this,false)};this.parent(d);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop)}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop)}.bind(this))}},setNow:function(){for(var b=0;b<2;b++){this.now[b]=this.compute(this.from[b],this.to[b])}},scrollTo:function(l,h){if(this.timer&&this.options.wait){return this}var n=this.element.getSize();var m={x:l,y:h};for(var o in n.size){var k=n.scrollSize[o]-n.size[o];if($chk(m[o])){m[o]=($type(m[o])=="number")?m[o].limit(0,k):k}else{m[o]=n.scroll[o]}m[o]+=this.options.offset[o]}return this.start([n.scroll.x,n.scroll.y],[m.x,m.y])},toTop:function(){return this.scrollTo(false,0)},toBottom:function(){return this.scrollTo(false,"full")},toLeft:function(){return this.scrollTo(0,false)},toRight:function(){return this.scrollTo("full",false)},toElement:function(g){var f=this.element.getPosition(this.options.overflown);var d=$(g).getPosition(this.options.overflown);return this.scrollTo(d.x-f.x,d.y-f.y)},increase:function(){this.element.scrollTo(this.now[0],this.now[1])}});Fx.Slide=Fx.Base.extend({options:{mode:"vertical"},initialize:function(c,d){this.element=$(c);this.wrapper=new Element("div",{styles:$extend(this.element.getStyles("margin"),{overflow:"hidden"})}).injectAfter(this.element).adopt(this.element);this.element.setStyle("margin",0);this.setOptions(d);this.now=[];this.parent(this.options);this.open=true;this.addEvent("onComplete",function(){this.open=(this.now[0]===0)});if(window.webkit419){this.addEvent("onComplete",function(){if(this.open){this.element.remove().inject(this.wrapper)}})}},setNow:function(){for(var b=0;b<2;b++){this.now[b]=this.compute(this.from[b],this.to[b])}},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},slideIn:function(b){this[b||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset])},slideOut:function(b){this[b||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0])},hide:function(b){this[b||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(b){this[b||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(b){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0){return this.slideIn(b)}return this.slideOut(b)},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit)}});Fx.Transition=function(c,d){d=d||[];if($type(d)!="array"){d=[d]}return $extend(c,{easeIn:function(b){return c(b,d)},easeOut:function(b){return 1-c(1-b,d)},easeInOut:function(b){return(b<=0.5)?c(2*b,d)/2:(2-c(2*(1-b),d))/2}})};Fx.Transitions=new Abstract({linear:function(b){return b}});Fx.Transitions.extend=function(d){for(var c in d){Fx.Transitions[c]=new Fx.Transition(d[c]);Fx.Transitions.compat(c)}};Fx.Transitions.compat=function(b){["In","Out","InOut"].each(function(c){Fx.Transitions[b.toLowerCase()+c]=Fx.Transitions[b]["ease"+c]})};Fx.Transitions.extend({Pow:function(c,d){return Math.pow(c,d[0]||6)},Expo:function(b){return Math.pow(2,8*(b-1))},Circ:function(b){return 1-Math.sin(Math.acos(b))},Sine:function(b){return 1-Math.sin((1-b)*Math.PI/2)},Back:function(c,d){d=d[0]||1.618;return Math.pow(c,2)*((d+1)*c-d)},Bounce:function(f){var k;for(var h=0,g=1;1;h+=g,g/=2){if(f>=(7-4*h)/11){k=-Math.pow((11-6*h-11*f)/4,2)+g*g;break}}return k},Elastic:function(c,d){return Math.pow(2,10*--c)*Math.cos(20*c*Math.PI*(d[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(c,d){Fx.Transitions[c]=new Fx.Transition(function(b){return Math.pow(b,[d+2])});Fx.Transitions.compat(c)});var Drag={};Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(c,d){this.setOptions(d);this.element=$(c);this.handle=$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.bound={start:this.start.bindWithEvent(this),check:this.check.bindWithEvent(this),drag:this.drag.bindWithEvent(this),stop:this.stop.bind(this)};this.attach();if(this.options.initialize){this.options.initialize.call(this)}},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this},start:function(k){this.fireEvent("onBeforeStart",this.element);this.mouse.start=k.page;var g=this.options.limit;this.limit={x:[],y:[]};for(var f in this.options.modifiers){if(!this.options.modifiers[f]){continue}this.value.now[f]=this.element.getStyle(this.options.modifiers[f]).toInt();this.mouse.pos[f]=k.page[f]-this.value.now[f];if(g&&g[f]){for(var h=0;h<2;h++){if($chk(g[f][h])){this.limit[f][h]=($type(g[f][h])=="function")?g[f][h]():g[f][h]}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);this.fireEvent("onStart",this.element);k.stop()},check:function(d){var c=Math.round(Math.sqrt(Math.pow(d.page.x-this.mouse.start.x,2)+Math.pow(d.page.y-this.mouse.start.y,2)));if(c>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(d);this.fireEvent("onSnap",this.element)}d.stop()},drag:function(d){this.out=false;this.mouse.now=d.page;for(var c in this.options.modifiers){if(!this.options.modifiers[c]){continue}this.value.now[c]=this.mouse.now[c]-this.mouse.pos[c];if(this.limit[c]){if($chk(this.limit[c][1])&&(this.value.now[c]>this.limit[c][1])){this.value.now[c]=this.limit[c][1];this.out=true}else{if($chk(this.limit[c][0])&&(this.value.now[c]<this.limit[c][0])){this.value.now[c]=this.limit[c][0];this.out=true}}}if(this.options.grid[c]){this.value.now[c]-=(this.value.now[c]%this.options.grid[c])}this.element.setStyle(this.options.modifiers[c],this.value.now[c]+this.options.unit)}this.fireEvent("onDrag",this.element);d.stop()},stop:function(){document.removeListener("mousemove",this.bound.check);document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);this.fireEvent("onComplete",this.element)}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(b){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},b))}});Drag.Move=Drag.Base.extend({options:{droppables:[],container:false,overflown:[]},initialize:function(h,g){this.setOptions(g);this.element=$(h);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);this.position={element:this.element.getStyle("position"),container:false};if(this.container){this.position.container=this.container.getStyle("position")}if(!["relative","absolute","fixed"].contains(this.position.element)){this.position.element="absolute"}var f=this.element.getStyle("top").toInt();var k=this.element.getStyle("left").toInt();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){f=$chk(f)?f:this.element.getTop(this.options.overflown);k=$chk(k)?k:this.element.getLeft(this.options.overflown)}else{f=$chk(f)?f:0;k=$chk(k)?k:0}this.element.setStyles({top:f,left:k,position:this.position.element});this.parent(this.element)},start:function(d){this.overed=null;if(this.container){var f=this.container.getCoordinates();var g=this.element.getCoordinates();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){this.options.limit={x:[f.left,f.right-g.width],y:[f.top,f.bottom-g.height]}}else{this.options.limit={y:[0,f.height-g.height],x:[0,f.width-g.width]}}}this.parent(d)},drag:function(d){this.parent(d);var c=this.out?false:this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=c){if(this.overed){this.overed.fireEvent("leave",[this.element,this])}this.overed=c?c.fireEvent("over",[this.element,this]):null}return this},checkAgainst:function(c){c=c.getCoordinates(this.options.overflown);var d=this.mouse.now;return(d.x>c.left&&d.x<c.right&&d.y<c.bottom&&d.y>c.top)},stop:function(){if(this.overed&&!this.out){this.overed.fireEvent("drop",[this.element,this])}else{this.element.fireEvent("emptydrop",this)}this.parent();return this}});Element.extend({makeDraggable:function(b){return new Drag.Move(this,b)}});var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false);return this},initialize:function(d){this.setTransport().setOptions(d);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:"";this.setHeader("Content-type","application/x-www-form-urlencoded"+c)}if(this.options.initialize){this.options.initialize.call(this)}},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return}this.running=false;var d=0;try{d=this.transport.status}catch(c){}if(this.options.isSuccess.call(this,d)){this.onSuccess()}else{this.onFailure()}this.transport.onreadystatechange=Class.empty},isSuccess:function(b){return((b>=200)&&(b<300))},onSuccess:function(){this.response={text:this.transport.responseText,xml:this.transport.responseXML};this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain()},onFailure:function(){this.fireEvent("onFailure",this.transport)},setHeader:function(d,c){this.headers[d]=c;return this},send:function(g,k){if(this.options.autoCancel){this.cancel()}else{if(this.running){return this}}this.running=true;if(k&&this.options.method=="get"){g=g+(g.contains("?")?"&":"?")+k;k=null}this.transport.open(this.options.method.toUpperCase(),g,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=="post")&&this.transport.overrideMimeType){this.setHeader("Connection","close")}$extend(this.headers,this.options.headers);for(var h in this.headers){try{this.transport.setRequestHeader(h,this.headers[h])}catch(f){}}this.fireEvent("onRequest");this.transport.send($pick(k,null));return this},cancel:function(){if(!this.running){return this}this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent("onCancel");return this}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(c,d){this.addEvent("onSuccess",this.onComplete);this.setOptions(d);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;this.options.method="post"}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.url=c},onComplete:function(){if(this.options.update){$(this.options.update).empty().setHTML(this.response.text)}if(this.options.evalScripts||this.options.evalResponse){this.evalScripts()}this.fireEvent("onComplete",[this.response.text,this.response.xml],20)},request:function(b){b=b||this.options.data;switch($type(b)){case"element":b=$(b).toQueryString();break;case"object":b=Object.toQueryString(b)}if(this._method){b=(b)?[this._method,b].join("&"):this._method}return this.send(this.url,b)},evalScripts:function(){var g,f;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){f=this.response.text}else{f=[];var d=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((g=d.exec(this.response.text))){f.push(g[1])}f=f.join("\n")}if(f){(window.execScript)?window.execScript(f):window.setTimeout(f,0)}},getHeader:function(d){try{return this.transport.getResponseHeader(d)}catch(c){}return null}});Object.toQueryString=function(g){var d=[];for(var f in g){d.push(encodeURIComponent(f)+"="+encodeURIComponent(g[f]))}return d.join("&")};Element.extend({send:function(b){return new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},b,{method:"post"})).request()}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(k,f,h){h=$merge(this.options,h);f=encodeURIComponent(f);if(h.domain){f+="; domain="+h.domain}if(h.path){f+="; path="+h.path}if(h.duration){var g=new Date();g.setTime(g.getTime()+h.duration*24*60*60*1000);f+="; expires="+g.toGMTString()}if(h.secure){f+="; secure"}document.cookie=k+"="+f;return $extend(h,{key:k,value:f})},get:function(d){var c=document.cookie.match("(?:^|;)\\s*"+d.escapeRegExp()+"=([^;]*)");return c?decodeURIComponent(c[1]):false},remove:function(c,d){if($type(c)=="object"){this.set(c.key,"",$merge(c,{duration:-1}))}else{this.set(c,"",$merge(d,{duration:-1}))}}});var Json={toString:function(d){switch($type(d)){case"string":return'"'+d.replace(/(["\\])/g,"\\$1")+'"';case"array":return"["+d.map(Json.toString).join(",")+"]";case"object":var f=[];for(var g in d){f.push(Json.toString(g)+":"+Json.toString(d[g]))}return"{"+f.join(",")+"}";case"number":if(isFinite(d)){break}case false:return"null"}return String(d)},evaluate:function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval("("+str+")")}};Json.Remote=XHR.extend({initialize:function(c,d){this.url=c;this.addEvent("onSuccess",this.onComplete);this.parent(d);this.setHeader("X-Request","JSON")},send:function(b){return this.parent(this.url,"json="+Json.toString(b))},onComplete:function(){this.fireEvent("onComplete",[Json.evaluate(this.response.text,this.options.secure)])}});var Asset=new Abstract({javascript:function(d,g){g=$merge({onload:Class.empty},g);var f=new Element("script",{src:d}).addEvents({load:g.onload,readystatechange:function(){if(this.readyState=="complete"){this.fireEvent("load")}}});delete g.onload;return f.setProperties(g).inject(document.head)},css:function(c,d){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:c},d)).inject(document.head)},image:function(k,h){h=$merge({onload:Class.empty,onabort:Class.empty,onerror:Class.empty},h);var f=new Image();f.src=k;var g=new Element("img",{src:k});["load","abort","error"].each(function(b){var c=h["on"+b];delete h["on"+b];g.addEvent(b,function(){this.removeEvent(b,arguments.callee);c.call(this)})});if(f.width&&f.height){g.fireEvent("load",g,1)}return g.setProperties(h)},images:function(f,k){k=$merge({onComplete:Class.empty,onProgress:Class.empty},k);if(!f.push){f=[f]}var g=[];var h=0;f.each(function(c){var b=new Asset.image(c,{onload:function(){k.onProgress.call(this,h);h++;if(h==f.length){k.onComplete()}}});g.push(b)});return new Elements(g)}});var Hash=new Class({length:0,initialize:function(b){this.obj=b||{};this.setLength()},get:function(b){return(this.hasKey(b))?this.obj[b]:null},hasKey:function(b){return(b in this.obj)},set:function(d,c){if(!this.hasKey(d)){this.length++}this.obj[d]=c;return this},setLength:function(){this.length=0;for(var b in this.obj){this.length++}return this},remove:function(b){if(this.hasKey(b)){delete this.obj[b];this.length--}return this},each:function(d,c){$each(this.obj,d,c)},extend:function(b){$extend(this.obj,b);return this.setLength()},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength()},empty:function(){this.obj={};this.length=0;return this},keys:function(){var d=[];for(var c in this.obj){d.push(c)}return d},values:function(){var d=[];for(var c in this.obj){d.push(this.obj[c])}return d}});function $H(b){return new Hash(b)}Hash.Cookie=Hash.extend({initialize:function(c,d){this.name=c;this.options=$extend({autoSave:true},d||{});this.load()},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true}var b=Json.toString(this.obj);if(b.length>4096){return false}Cookie.set(this.name,b,this.options);return true},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength()}});Hash.Cookie.Methods={};["extend","set","merge","empty","remove"].each(function(b){Hash.Cookie.Methods[b]=function(){Hash.prototype[b].apply(this,arguments);if(this.options.autoSave){this.save()}return this}});Hash.Cookie.implement(Hash.Cookie.Methods);var Color=new Class({initialize:function(h,f){f=f||(h.push?"rgb":"hex");var k,g;switch(f){case"rgb":k=h;g=k.rgbToHsb();break;case"hsb":k=h.hsbToRgb();g=h;break;default:k=h.hexToRgb(true);g=k.rgbToHsb()}k.hsb=g;k.hex=k.rgbToHex();return $extend(k,Color.prototype)},mix:function(){var f=$A(arguments);var d=($type(f[f.length-1])=="number")?f.pop():50;var g=this.copy();f.each(function(b){b=new Color(b);for(var c=0;c<3;c++){g[c]=Math.round((g[c]/100*(100-d))+(b[c]/100*d))}});return new Color(g,"rgb")},invert:function(){return new Color(this.map(function(b){return 255-b}))},setHue:function(b){return new Color([b,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(b){return new Color([this.hsb[0],b,this.hsb[2]],"hsb")},setBrightness:function(b){return new Color([this.hsb[0],this.hsb[1],b],"hsb")}});function $RGB(d,g,f){return new Color([d,g,f],"rgb")}function $HSB(d,g,f){return new Color([d,g,f],"hsb")}Array.extend({rgbToHsb:function(){var w=this[0],x=this[1],s=this[2];var p,o,q;var r=Math.max(w,x,s),n=Math.min(w,x,s);var t=r-n;q=r/255;o=(r!=0)?t/r:0;if(o==0){p=0}else{var y=(r-w)/t;var v=(r-x)/t;var u=(r-s)/t;if(w==r){p=u-v}else{if(x==r){p=2+y-u}else{p=4+v-y}}p/=6;if(p<0){p++}}return[Math.round(p*360),Math.round(o*100),Math.round(q*100)]},hsbToRgb:function(){var m=Math.round(this[2]/100*255);if(this[1]==0){return[m,m,m]}else{var k=this[0]%360;var o=k%60;var h=Math.round((this[2]*(100-this[1]))/10000*255);var n=Math.round((this[2]*(6000-this[1]*o))/600000*255);var l=Math.round((this[2]*(6000-this[1]*(60-o)))/600000*255);switch(Math.floor(k/60)){case 0:return[m,l,h];case 1:return[n,m,h];case 2:return[h,m,l];case 3:return[h,n,m];case 4:return[l,h,m];case 5:return[m,h,n]}}return false}});var Scroller=new Class({options:{area:20,velocity:1,onChange:function(d,c){this.element.scrollTo(d,c)}},initialize:function(c,d){this.setOptions(d);this.element=$(c);this.mousemover=([window,document].contains(c))?$(document.body):this.element},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener("mousemove",this.coord)},stop:function(){this.mousemover.removeListener("mousemove",this.coord);this.timer=$clear(this.timer)},getCoords:function(b){this.page=(this.element==window)?b.client:b.page;if(!this.timer){this.timer=this.scroll.periodical(50,this)}},scroll:function(){var g=this.element.getSize();var f=this.element.getPosition();var k={x:0,y:0};for(var h in this.page){if(this.page[h]<(this.options.area+f[h])&&g.scroll[h]!=0){k[h]=(this.page[h]-this.options.area-f[h])*this.options.velocity}else{if(this.page[h]+this.options.area>(g.size[h]+f[h])&&g.scroll[h]+g.size[h]!=g.scrollSize[h]){k[h]=(this.page[h]-g.size[h]+this.options.area-f[h])*this.options.velocity}}}if(k.y||k.x){this.fireEvent("onChange",[g.scroll.x+k.x,g.scroll.y+k.y])}}});Scroller.implement(new Events,new Options);var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(b){this.knob.setStyle(this.p,b)},mode:"horizontal",steps:100,offset:0},initialize:function(n,k,l){this.element=$(n);this.knob=$(k);this.setOptions(l);this.previousChange=-1;this.previousEnd=-1;this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var m,h;switch(this.options.mode){case"horizontal":this.z="x";this.p="left";m={x:"left",y:false};h="offsetWidth";break;case"vertical":this.z="y";this.p="top";m={x:false,y:"top"};h="offsetHeight"}this.max=this.element[h]-this.knob[h]+(this.options.offset*2);this.half=this.knob[h]/2;this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);var o={};o[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:o,modifiers:m,snap:0,onStart:function(){this.draggedKnob()}.bind(this),onDrag:function(){this.draggedKnob()}.bind(this),onComplete:function(){this.draggedKnob();this.end()}.bind(this)});if(this.options.initialize){this.options.initialize.call(this)}},set:function(b){this.step=b.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent("onTick",this.toPosition(this.step));return this},clickedElement:function(c){var d=c.page[this.z]-this.getPos()-this.half;d=d.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(d);this.checkStep();this.end();this.fireEvent("onTick",d)},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("onChange",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("onComplete",this.step+"")}},toStep:function(b){return Math.round((b+this.options.offset)/this.max*this.options.steps)},toPosition:function(b){return this.max*b/this.options.steps}});Slider.implement(new Events);Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(c){this.parent(window,c);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var d=window.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(f){if(f.href.indexOf(d)!=0){return}var b=f.href.substr(d.length);if(b&&$(b)){this.useLink(f,b)}},this);if(!window.webkit419){this.addEvent("onComplete",function(){window.location.hash=this.anchor})}},useLink:function(c,d){c.addEvent("click",function(b){this.anchor=d;this.toElement(d);b.stop()}.bindWithEvent(this))}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(d,c){c.setStyle("opacity",0.7);d.setStyle("opacity",0.7)},onDragComplete:function(d,c){d.setStyle("opacity",1);c.remove();this.trash.remove()}},initialize:function(f,h){this.setOptions(h);this.list=$(f);this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;this.bound={start:[],moveGhost:this.moveGhost.bindWithEvent(this)};for(var k=0,g=this.handles.length;k<g;k++){this.bound.start[k]=this.start.bindWithEvent(this,this.elements[k])}this.attach();if(this.options.initialize){this.options.initialize.call(this)}this.bound.move=this.move.bindWithEvent(this);this.bound.end=this.end.bind(this)},attach:function(){this.handles.each(function(c,d){c.addEvent("mousedown",this.bound.start[d])},this)},detach:function(){this.handles.each(function(c,d){c.removeEvent("mousedown",this.bound.start[d])},this)},start:function(d,g){this.active=g;this.coordinates=this.list.getCoordinates();if(this.options.ghost){var f=g.getPosition();this.offset=d.page.y-f.y;this.trash=new Element("div").inject(document.body);this.ghost=g.clone().inject(this.trash).setStyles({position:"absolute",left:f.x,top:d.page.y-this.offset});document.addListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragStart",[g,this.ghost])}document.addListener("mousemove",this.bound.move);document.addListener("mouseup",this.bound.end);this.fireEvent("onStart",g);d.stop()},moveGhost:function(d){var c=d.page.y-this.offset;c=c.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle("top",c);d.stop()},move:function(g){var k=g.page.y;this.previous=this.previous||k;var h=((this.previous-k)>0);var m=this.active.getPrevious();var l=this.active.getNext();if(m&&h&&k<m.getCoordinates().bottom){this.active.injectBefore(m)}if(l&&!h&&k>l.getCoordinates().top){this.active.injectAfter(l)}this.previous=k},serialize:function(b){return this.list.getChildren().map(b||function(c){return this.elements.indexOf(c)},this)},end:function(){this.previous=null;document.removeListener("mousemove",this.bound.move);document.removeListener("mouseup",this.bound.end);if(this.options.ghost){document.removeListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragComplete",[this.active,this.ghost])}this.fireEvent("onComplete",this.active)}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(b){b.setStyle("visibility","visible")},onHide:function(b){b.setStyle("visibility","hidden")},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{x:16,y:16},fixed:false},initialize:function(c,d){this.setOptions(d);this.toolTip=new Element("div",{"class":this.options.className+"-tip",styles:{position:"absolute",top:"0",left:"0",visibility:"hidden"}}).inject(document.body);this.wrapper=new Element("div").inject(this.toolTip);$$(c).each(this.build,this);if(this.options.initialize){this.options.initialize.call(this)}},build:function(g){g.$tmp.myTitle=(g.href&&g.getTag()=="a")?g.href.replace("http://",""):(g.rel||false);if(g.title){var d=g.title.split("::");if(d.length>1){g.$tmp.myTitle=d[0].trim();g.$tmp.myText=d[1].trim()}else{g.$tmp.myText=g.title}g.removeAttribute("title")}else{g.$tmp.myText=false}if(g.$tmp.myTitle&&g.$tmp.myTitle.length>this.options.maxTitleChars){g.$tmp.myTitle=g.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;"}g.addEvent("mouseenter",function(b){this.start(g);if(!this.options.fixed){this.locate(b)}else{this.position(g)}}.bind(this));if(!this.options.fixed){g.addEvent("mousemove",this.locate.bindWithEvent(this))}var f=this.end.bind(this);g.addEvent("mouseleave",f);g.addEvent("trash",f)},start:function(b){this.wrapper.empty();if(b.$tmp.myTitle){this.title=new Element("span").inject(new Element("div",{"class":this.options.className+"-title"}).inject(this.wrapper)).setHTML(b.$tmp.myTitle)}if(b.$tmp.myText){this.text=new Element("span").inject(new Element("div",{"class":this.options.className+"-text"}).inject(this.wrapper)).setHTML(b.$tmp.myText)}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this)},end:function(b){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this)},position:function(d){var c=d.getPosition();this.toolTip.setStyles({left:c.x+this.options.offsets.x,top:c.y+this.options.offsets.y})},locate:function(m){var o={x:window.getWidth(),y:window.getHeight()};var l={x:window.getScrollLeft(),y:window.getScrollTop()};var n={x:this.toolTip.offsetWidth,y:this.toolTip.offsetHeight};var k={x:"left",y:"top"};for(var p in k){var q=m.page[p]+this.options.offsets[p];if((q+n[p]-l[p])>o[p]){q=m.page[p]-this.options.offsets[p]-n[p]}this.toolTip.setStyle(k[p],q)}},show:function(){if(this.options.timeout){this.timer=this.hide.delay(this.options.timeout,this)}this.fireEvent("onShow",[this.toolTip])},hide:function(){this.fireEvent("onHide",[this.toolTip])}});Tips.implement(new Events,new Options);var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={}},addEvent:function(c,d){this.checker[c]=this.checker[c]||{};this.events[c]=this.events[c]||[];if(this.events[c].contains(d)){return false}else{this.events[c].push(d)}this.instances.each(function(b,f){b.addEvent(c,this.check.bind(this,[c,b,f]))},this);return this},check:function(k,g,h){this.checker[k][h]=true;var f=this.instances.every(function(c,b){return this.checker[k][b]||false},this);if(!f){return}this.checker[k]={};this.events[k].each(function(b){b.call(this,this.instances,g)},this)}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var m,o,h,l;$each(arguments,function(d,c){switch($type(d)){case"object":m=d;break;case"element":l=$(d);break;default:var b=$$(d);if(!o){o=b}else{h=b}}});this.togglers=o||[];this.elements=h||[];this.container=$(l);this.setOptions(m);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var n=0,k=this.togglers.length;n<k;n++){this.addSection(this.togglers[n],this.elements[n])}this.elements.each(function(c,b){if(this.options.show===b){this.fireEvent("onActive",[this.togglers[b],c])}else{for(var d in this.effects){c.setStyle(d,0)}}},this);this.parent(this.elements);if($chk(this.options.display)){this.display(this.options.display)}},addSection:function(p,n,k){p=$(p);n=$(n);var q=this.togglers.contains(p);var m=this.togglers.length;this.togglers.include(p);this.elements.include(n);if(m&&(!q||k)){k=$pick(k,m-1);p.injectBefore(this.togglers[k]);n.injectAfter(p)}else{if(this.container&&!q){p.inject(this.container);n.inject(this.container)}}var l=this.togglers.indexOf(p);p.addEvent("click",this.display.bind(this,l));if(this.options.height){n.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){n.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}n.fullOpacity=1;if(this.options.fixedWidth){n.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){n.fullHeight=this.options.fixedHeight}n.setStyle("overflow","hidden");if(!q){for(var o in this.effects){n.setStyle(o,0)}}return this},display:function(d){d=($type(d)=="element")?this.elements.indexOf(d):d;if((this.timer&&this.options.wait)||(d===this.previous&&!this.options.alwaysHide)){return this}this.previous=d;var c={};this.elements.each(function(k,h){c[h]={};var b=(h!=d)||(this.options.alwaysHide&&(k.offsetHeight>0));this.fireEvent(b?"onBackground":"onActive",[this.togglers[h],k]);for(var l in this.effects){c[h][l]=b?0:k[this.effects[l]]}},this);return this.start(c)},showThisHideOpen:function(b){return this.display(b)}});Fx.Accordion=Accordion;var conf={sounds:true,delayload:3000,sound:{now:"",load:"",toload:"",conf:{mute:false,global:30,zicloop:{path:"sounds/8178E194g859.tmp",vol:90,loop:true},menu:{path:"sounds/9FBCD70Dd24A.tmp",vol:30,load:true},trans:{path:"sounds/DBCAF77Be84.tmp",vol:11,load:true},fourmie:{path:"sounds/389BDF94e05C.tmp",vol:25,load:true},fxstart:{path:"sounds/24FF4D478a4b.tmp",vol:60,load:true}}}};var slidevol,slidemute;var soundManager;function SoundManager(h,k){this.flashVersion=8;this.debugMode=false;this.useConsole=true;this.consoleOnly=false;this.waitForWindowLoad=false;this.nullURL="null.mp3";this.allowPolling=true;this.useMovieStar=false;this.bgColor="#ffffff";this.useHighPerformance=false;this.flashLoadTimeout=750;this.wmode=null;this.allowFullScreen=true;this.defaultOptions={autoLoad:false,stream:true,autoPlay:false,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5000,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:true,position:null,pan:0,volume:100};this.flash9Options={isMovieStar:null,usePeakData:false,useWaveformData:false,useEQData:false,onbufferchange:null,ondataerror:null};this.movieStarOptions={onmetadata:null,useVideo:false,bufferTime:null};var m=null;var n=this;this.version=null;this.versionNumber="V2.95a.20090501";this.movieURL=null;this.url=null;this.altURL=null;this.swfLoaded=false;this.enabled=false;this.o=null;this.id=(k||"sm2movie");this.oMC=null;this.sounds={};this.soundIDs=[];this.muted=false;this.isFullScreen=false;this.isIE=(navigator.userAgent.match(/MSIE/i));this.isSafari=(navigator.userAgent.match(/safari/i));this.isGecko=(navigator.userAgent.match(/gecko/i));this.debugID="soundmanager-debug";this.specialWmodeCase=false;this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._windowLoaded=false;this._hasConsole=(typeof console!="undefined"&&typeof console.log!="undefined");this._debugLevels=["log","info","warn","error"];this._defaultFlashVersion=8;this._oRemoved=null;this._oRemovedHTML=null;var l=function(b){return document.getElementById(b)};this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=new RegExp("\\.("+this.netStreamTypes.join("|")+")(\\?.*)?$","i");this.filePattern=null;this.features={buffering:false,peakData:false,waveformData:false,eqData:false,movieStar:false};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local + internet access)"},description:null,noRemote:null,noLocal:null};this._setVersionInfo=function(){if(n.flashVersion!=8&&n.flashVersion!=9){alert('soundManager.flashVersion must be 8 or 9. "'+n.flashVersion+'" is invalid. Reverting to '+n._defaultFlashVersion+".");n.flashVersion=n._defaultFlashVersion}n.version=n.versionNumber+(n.flashVersion==9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(n.flashVersion>8){n.defaultOptions=n._mergeObjects(n.defaultOptions,n.flash9Options);n.features.buffering=true}if(n.flashVersion>8&&n.useMovieStar){n.defaultOptions=n._mergeObjects(n.defaultOptions,n.movieStarOptions);n.filePatterns.flash9=new RegExp("\\.(mp3|"+n.netStreamTypes.join("|")+")(\\?.*)?$","i");n.features.movieStar=true}else{n.useMovieStar=false;n.features.movieStar=false}n.filePattern=n.filePatterns[(n.flashVersion!=8?"flash9":"flash8")];n.movieURL=(n.flashVersion==8?"soundmanager2.swf":"soundmanager2_flash9.swf");n.features.peakData=n.features.waveformData=n.features.eqData=(n.flashVersion>8)};this._overHTTP=(document.location?document.location.protocol.match(/http/i):null);this._waitingforEI=false;this._initPending=false;this._tryInitOnFocus=(this.isSafari&&typeof document.hasFocus=="undefined");this._isFocused=(typeof document.hasFocus!="undefined"?document.hasFocus():null);this._okToDisable=!this._tryInitOnFocus;this.useAltURL=!this._overHTTP;var o="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";this.strings={notReady:"Not loaded yet",appXHTML:"appendChild/innerHTML set failed."};this.supported=function(){return(n._didInit&&!n._disabled)};this.getMovie=function(b){return n.isIE?window[b]:(n.isSafari?l(b)||document[b]:l(b))};this.loadFromXML=function(c){try{n.o._loadFromXML(c)}catch(b){n._failSafely();return true}};this.createSound=function(c){if(arguments.length==2){c={id:arguments[0],url:arguments[1]}}var b=n._mergeObjects(c);var d=b;if(n._idCheck(d.id,true)){return n.sounds[d.id]}if(n.flashVersion>8&&n.useMovieStar){if(d.isMovieStar===null){d.isMovieStar=(d.url.match(n.netStreamPattern)?true:false)}if(d.isMovieStar){}if(d.isMovieStar&&(d.usePeakData||d.useWaveformData||d.useEQData)){d.usePeakData=false;d.useWaveformData=false;d.useEQData=false}}n.sounds[d.id]=new m(d);n.soundIDs[n.soundIDs.length]=d.id;if(n.flashVersion==8){n.o._createSound(d.id,d.onjustbeforefinishtime)}else{n.o._createSound(d.id,d.url,d.onjustbeforefinishtime,d.usePeakData,d.useWaveformData,d.useEQData,d.isMovieStar,(d.isMovieStar?d.useVideo:false),(d.isMovieStar?d.bufferTime:false))}if(d.autoLoad||d.autoPlay){if(n.sounds[d.id]){n.sounds[d.id].load(d)}}if(d.autoPlay){n.sounds[d.id].play()}return n.sounds[d.id]};this.createVideo=function(b){if(arguments.length==2){b={id:arguments[0],url:arguments[1]}}if(n.flashVersion>=9){b.isMovieStar=true;b.useVideo=true}else{return false}if(!n.useMovieStar){}return n.createSound(b)};this.destroySound=function(c,d){if(!n._idCheck(c)){return false}for(var b=0;b<n.soundIDs.length;b++){if(n.soundIDs[b]==c){n.soundIDs.splice(b,1);continue}}n.sounds[c].unload();if(!d){n.sounds[c].destruct()}delete n.sounds[c]};this.destroyVideo=this.destroySound;this.load=function(c,b){if(!n._idCheck(c)){return false}n.sounds[c].load(b)};this.unload=function(b){if(!n._idCheck(b)){return false}n.sounds[b].unload()};this.play=function(c,b){if(!n._idCheck(c)){if(typeof b!="Object"){b={url:b}}if(b&&b.url){b.id=c;n.createSound(b)}else{return false}}n.sounds[c].play(b)};this.start=this.play;this.setPosition=function(c,b){if(!n._idCheck(c)){return false}n.sounds[c].setPosition(b)};this.stop=function(b){if(!n._idCheck(b)){return false}n.sounds[b].stop()};this.stopAll=function(){for(var b in n.sounds){if(n.sounds[b] instanceof m){n.sounds[b].stop()}}};this.pause=function(b){if(!n._idCheck(b)){return false}n.sounds[b].pause()};this.pauseAll=function(){for(var b=n.soundIDs.length;b--;){n.sounds[n.soundIDs[b]].pause()}};this.resume=function(b){if(!n._idCheck(b)){return false}n.sounds[b].resume()};this.resumeAll=function(){for(var b=n.soundIDs.length;b--;){n.sounds[n.soundIDs[b]].resume()}};this.togglePause=function(b){if(!n._idCheck(b)){return false}n.sounds[b].togglePause()};this.setPan=function(c,b){if(!n._idCheck(c)){return false}n.sounds[c].setPan(b)};this.setVolume=function(b,c){if(!n._idCheck(b)){return false}n.sounds[b].setVolume(c)};this.mute=function(c){if(typeof c!="string"){c=null}if(!c){for(var b=n.soundIDs.length;b--;){n.sounds[n.soundIDs[b]].mute()}n.muted=true}else{if(!n._idCheck(c)){return false}n.sounds[c].mute()}};this.muteAll=function(){n.mute()};this.unmute=function(c){if(typeof c!="string"){c=null}if(!c){for(var b=n.soundIDs.length;b--;){n.sounds[n.soundIDs[b]].unmute()}n.muted=false}else{if(!n._idCheck(c)){return false}n.sounds[c].unmute()}};this.unmuteAll=function(){n.unmute()};this.getMemoryUse=function(){if(n.flashVersion==8){return 0}if(n.o){return parseInt(n.o._getMemoryUse(),10)}};this.setPolling=function(b){if(!n.o||!n.allowPolling){return false}n.o._setPolling(b)};this.disable=function(b){if(typeof b=="undefined"){b=false}if(n._disabled){return false}n._disabled=true;for(var c=n.soundIDs.length;c--;){n._disableObject(n.sounds[n.soundIDs[c]])}n.initComplete(b)};this.canPlayURL=function(b){return(b?(b.match(n.filePattern)?true:false):null)};this.getSoundById=function(c,b){if(!c){throw new Error("SoundManager.getSoundById(): sID is null/undefined")}var d=n.sounds[c];if(!d&&!b){}return d};this.onload=function(){soundManager._wD("Warning: soundManager.onload() is undefined.",2)};this.onerror=function(){};this._idCheck=this.getSoundById;this._complain=function(c,b){};var p=function(){return false};p._protected=true;this._disableObject=function(b){for(var c in b){if(typeof b[c]=="function"&&typeof b[c]._protected=="undefined"){b[c]=p}}c=null};this._failSafely=function(b){if(typeof b=="undefined"){b=false}if(!n._disabled||b){n.disable(b)}};this._normalizeMovieURL=function(c){var b=null;if(c){if(c.match(/\.swf(\?.*)?$/i)){b=c.substr(c.toLowerCase().lastIndexOf(".swf?")+4);if(b){return c}}else{if(c.lastIndexOf("/")!=c.length-1){c=c+"/"}}}return(c&&c.lastIndexOf("/")!=-1?c.substr(0,c.lastIndexOf("/")+1):"./")+n.movieURL};this._getDocument=function(){return(document.body?document.body:(document.documentElement?document.documentElement:document.getElementsByTagName("div")[0]))};this._getDocument._protected=true;this._createMovie=function(c,L){if(n._didAppend&&n._appendSuccess){return false}if(window.location.href.indexOf("debug=1")+1){n.debugMode=true}n._didAppend=true;n._setVersionInfo();var d=(L?L:n.url);var x=(n.altURL?n.altURL:d);n.url=n._normalizeMovieURL(n._overHTTP?d:x);L=n.url;var s=null;if(n.useHighPerformance&&n.useMovieStar&&n.defaultOptions.useVideo===true){s="soundManager note: disabling highPerformance, not applicable with movieStar mode + useVideo";n.useHighPerformance=false}n.wmode=(!n.wmode&&n.useHighPerformance&&!n.useMovieStar?"transparent":n.wmode);if(n.wmode!==null&&n.flashLoadTimeout!==0&&!n.useHighPerformance&&!n.isIE&&navigator.platform.match(/win32/i)){n.specialWmodeCase=true;n.wmode=null}if(n.flashVersion==8){n.allowFullScreen=false}var E={name:c,id:c,src:L,width:"100%",height:"100%",quality:"high",allowScriptAccess:"always",bgcolor:n.bgColor,pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:n.wmode,allowfullscreen:(n.allowFullScreen?"true":"false")};if(!n.wmode){delete E.wmode}var R={id:c,data:L,type:"application/x-shockwave-flash",width:"100%",height:"100%",wmode:n.wmode};var K=null;var C=null;if(n.isIE){K=document.createElement("div");var g='<object id="'+c+'" data="'+L+'" type="application/x-shockwave-flash" width="100%" height="100%"><param name="movie" value="'+L+'" /><param name="AllowScriptAccess" value="always" /><param name="quality" value="high" />'+(n.wmode?'<param name="wmode" value="'+n.wmode+'" /> ':"")+'<param name="bgcolor" value="'+n.bgColor+'" /><param name="allowFullScreen" value="'+(n.allowFullScreen?"true":"false")+'" /><!-- --></object>'}else{K=document.createElement("embed");for(C in E){if(E.hasOwnProperty(C)){K.setAttribute(C,E[C])}}}var P=document.createElement("div");P.id=n.debugID+"-toggle";var O={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};P.appendChild(document.createTextNode("-"));P.onclick=n._toggleDebug;P.title="Toggle SM2 debug console";if(navigator.userAgent.match(/msie 6/i)){P.style.position="absolute";P.style.cursor="hand"}for(C in O){if(O.hasOwnProperty(C)){P.style[C]=O[C]}}var f=n._getDocument();if(f){n.oMC=l("sm2-container")?l("sm2-container"):document.createElement("div");if(!n.oMC.id){n.oMC.id="sm2-container";n.oMC.className="movieContainer";var J=null;var D=null;if(n.useHighPerformance){J={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px"}}else{J={position:"absolute",width:"1px",height:"1px",top:"-999px",left:"-999px"}}var N=null;for(N in J){if(J.hasOwnProperty(N)){n.oMC.style[N]=J[N]}}try{if(!n.isIE){n.oMC.appendChild(K)}f.appendChild(n.oMC);if(n.isIE){D=n.oMC.appendChild(document.createElement("div"));D.className="sm2-object-box";D.innerHTML=g}n._appendSuccess=true}catch(b){throw new Error(n.strings.appXHTML)}}else{n.oMC.appendChild(K);if(n.isIE){D=n.oMC.appendChild(document.createElement("div"));D.className="sm2-object-box";D.innerHTML=g}n._appendSuccess=true}if(!l(n.debugID)&&((!n._hasConsole||!n.useConsole)||(n.useConsole&&n._hasConsole&&!n.consoleOnly))){var M=document.createElement("div");M.id=n.debugID;M.style.display=(n.debugMode?"block":"none");if(n.debugMode&&!l(P.id)){try{f.appendChild(P)}catch(Q){throw new Error(n.strings.appXHTML)}f.appendChild(M)}}f=null}if(s){}};this._writeDebug=function(g,r,d){if(!n.debugMode){return false}if(typeof d!="undefined"&&d){g=g+" | "+new Date().getTime()}if(n._hasConsole&&n.useConsole){var q=n._debugLevels[r];if(typeof console[q]!="undefined"){console[q](g)}else{console.log(g)}if(n.useConsoleOnly){return true}}var s="soundmanager-debug";try{var b=l(s);if(!b){return false}var c=document.createElement("div");if(++n._wdCount%2===0){c.className="sm2-alt"}if(typeof r=="undefined"){r=0}else{r=parseInt(r,10)}c.appendChild(document.createTextNode(g));if(r){if(r>=2){c.style.fontWeight="bold"}if(r==3){c.style.color="#ff3333"}}b.insertBefore(c,b.firstChild)}catch(f){}b=null};this._writeDebug._protected=true;this._wdCount=0;this._wdCount._protected=true;this._wD=this._writeDebug;this._wDAlert=function(b){alert(b)};if(window.location.href.indexOf("debug=alert")+1&&n.debugMode){n._wD=n._wDAlert}this._toggleDebug=function(){var b=l(n.debugID);var c=l(n.debugID+"-toggle");if(!b){return false}if(n._debugOpen){c.innerHTML="+";b.style.display="none"}else{c.innerHTML="-";b.style.display="block"}n._debugOpen=!n._debugOpen};this._toggleDebug._protected=true;this._debug=function(){for(var b=0,c=n.soundIDs.length;b<c;b++){n.sounds[n.soundIDs[b]]._debug()}};this._debugTS=function(b,f,d){if(typeof sm2Debugger!="undefined"){try{sm2Debugger.handleEvent(b,f,d)}catch(c){}}};this._debugTS._protected=true;this._mergeObjects=function(f,g){var b={};for(var d in f){if(f.hasOwnProperty(d)){b[d]=f[d]}}var c=(typeof g=="undefined"?n.defaultOptions:g);for(var q in c){if(c.hasOwnProperty(q)&&typeof b[q]=="undefined"){b[q]=c[q]}}return b};this.createMovie=function(b){if(b){n.url=b}n._initMovie()};this.go=this.createMovie;this._initMovie=function(){if(n.o){return false}n.o=n.getMovie(n.id);if(!n.o){if(!n.oRemoved){n._createMovie(n.id,n.url)}else{if(!n.isIE){n.oMC.appendChild(n.oRemoved)}else{n.oMC.innerHTML=n.oRemovedHTML}n.oRemoved=null;n._didAppend=true}n.o=n.getMovie(n.id)}if(n.o){if(n.flashLoadTimeout>0){}}};this.waitForExternalInterface=function(){if(n._waitingForEI){return false}n._waitingForEI=true;if(n._tryInitOnFocus&&!n._isFocused){return false}if(n.flashLoadTimeout>0){if(!n._didInit){}setTimeout(function(){if(!n._didInit){if(!n._overHTTP){}n._debugTS("flashtojs",false,": Timed out"+(n._overHTTP)?" (Check flash security)":" (No plugin/missing SWF?)")}if(!n._didInit&&n._okToDisable){n._failSafely(true)}},n.flashLoadTimeout)}else{if(!n.didInit){}}};this.handleFocus=function(){if(n._isFocused||!n._tryInitOnFocus){return true}n._okToDisable=true;n._isFocused=true;if(n._tryInitOnFocus){window.removeEventListener("mousemove",n.handleFocus,false)}n._waitingForEI=false;setTimeout(n.waitForExternalInterface,500);if(window.removeEventListener){window.removeEventListener("focus",n.handleFocus,false)}else{if(window.detachEvent){window.detachEvent("onfocus",n.handleFocus)}}};this.initComplete=function(b){if(n._didInit){return false}n._didInit=true;if(n._disabled||b){n._debugTS("onload",false);n.onerror.apply(window);return false}else{n._debugTS("onload",true)}if(n.waitForWindowLoad&&!n._windowLoaded){if(window.addEventListener){window.addEventListener("load",n.initUserOnload,false)}else{if(window.attachEvent){window.attachEvent("onload",n.initUserOnload)}}return false}else{if(n.waitForWindowLoad&&n._windowLoaded){}n.initUserOnload()}};this.initUserOnload=function(){n.onload.apply(window)};this.init=function(){n._initMovie();if(n._didInit){return false}if(window.removeEventListener){window.removeEventListener("load",n.beginDelayedInit,false)}else{if(window.detachEvent){window.detachEvent("onload",n.beginDelayedInit)}}try{n.o._externalInterfaceTest(false);if(!n.allowPolling){}n.setPolling(true);if(!n.debugMode){n.o._disableDebug()}n.enabled=true;n._debugTS("jstoflash",true)}catch(b){n._debugTS("jstoflash",false);n._failSafely(true);n.initComplete();return false}n.initComplete()};this.beginDelayedInit=function(){n._windowLoaded=true;setTimeout(n.waitForExternalInterface,500);setTimeout(n.beginInit,20)};this.beginInit=function(){if(n._initPending){return false}n.createMovie();n._initMovie();n._initPending=true;return true};this.domContentLoaded=function(){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",n.domContentLoaded,false)}n.go()};this._externalInterfaceOK=function(){if(n.swfLoaded){return false}n._debugTS("swf",true);n._debugTS("flashtojs",true);n.swfLoaded=true;n._tryInitOnFocus=false;if(n.isIE){setTimeout(n.init,100)}else{n.init()}};this._setSandboxType=function(c){var b=n.sandbox;b.type=c;b.description=b.types[(typeof b.types[c]!="undefined"?c:"unknown")];if(b.type=="localWithFile"){b.noRemote=true;b.noLocal=false}else{if(b.type=="localWithNetwork"){b.noRemote=false;b.noLocal=true}else{if(b.type=="localTrusted"){b.noRemote=false;b.noLocal=false}}}};this.reboot=function(){if(n.soundIDs.length){}for(var c=n.soundIDs.length;c--;){n.sounds[n.soundIDs[c]].destruct()}try{if(n.isIE){n.oRemovedHTML=n.o.innerHTML}n.oRemoved=n.o.parentNode.removeChild(n.o)}catch(b){}n.enabled=false;n._didInit=false;n._waitingForEI=false;n._initPending=false;n._didInit=false;n._didAppend=false;n._appendSuccess=false;n._didInit=false;n._disabled=false;n._waitingforEI=true;n.swfLoaded=false;n.soundIDs={};n.sounds=[];n.o=null;window.setTimeout(function(){soundManager.beginDelayedInit()},20)};this.destruct=function(){n.disable(true)};m=function(c){var b=this;this.sID=c.id;this.url=c.url;this.options=n._mergeObjects(c);this.instanceOptions=this.options;this._iO=this.instanceOptions;this.pan=this.options.pan;this.volume=this.options.volume;this._lastURL=null;this._debug=function(){if(n.debugMode){var f=null;var r=[];var g=null;var d=null;var q=64;for(f in b.options){if(b.options[f]!==null){if(b.options[f] instanceof Function){g=b.options[f].toString();g=g.replace(/\s\s+/g," ");d=g.indexOf("{");r[r.length]=" "+f+": {"+g.substr(d+1,(Math.min(Math.max(g.indexOf("\n")-1,q),q))).replace(/\n/g,"")+"... }"}else{r[r.length]=" "+f+": "+b.options[f]}}}}};this._debug();this.id3={};this.resetProperties=function(d){b.bytesLoaded=null;b.bytesTotal=null;b.position=null;b.duration=null;b.durationEstimate=null;b.loaded=false;b.playState=0;b.paused=false;b.readyState=0;b.muted=false;b.didBeforeFinish=false;b.didJustBeforeFinish=false;b.isBuffering=false;b.instanceOptions={};b.instanceCount=0;b.peakData={left:0,right:0};b.waveformData={left:[],right:[]};b.eqData=[]};b.resetProperties();this.load=function(f){if(typeof f!="undefined"){b._iO=n._mergeObjects(f);b.instanceOptions=b._iO}else{f=b.options;b._iO=f;b.instanceOptions=b._iO;if(b._lastURL&&b._lastURL!=b.url){b._iO.url=b.url;b.url=null}}if(typeof b._iO.url=="undefined"){b._iO.url=b.url}if(b._iO.url==b.url&&b.readyState!==0&&b.readyState!=2){return false}b.url=b._iO.url;b._lastURL=b._iO.url;b.loaded=false;b.readyState=1;b.playState=0;try{if(n.flashVersion==8){n.o._load(b.sID,b._iO.url,b._iO.stream,b._iO.autoPlay,(b._iO.whileloading?1:0))}else{n.o._load(b.sID,b._iO.url,b._iO.stream?true:false,b._iO.autoPlay?true:false);if(b._iO.isMovieStar&&b._iO.autoLoad&&!b._iO.autoPlay){b.pause()}}}catch(d){n._debugTS("onload",false);n.onerror();n.disable()}};this.unload=function(){if(b.readyState!==0){if(b.readyState!=2){b.setPosition(0,true)}n.o._unload(b.sID,n.nullURL);b.resetProperties()}};this.destruct=function(){n.o._destroySound(b.sID);n.destroySound(b.sID,true)};this.play=function(d){if(!d){d={}}b._iO=n._mergeObjects(d,b._iO);b._iO=n._mergeObjects(b._iO,b.options);b.instanceOptions=b._iO;if(b.playState==1){var f=b._iO.multiShot;if(!f){return false}else{}}if(!b.loaded){if(b.readyState===0){b._iO.stream=true;b._iO.autoPlay=true;b.load(b._iO)}else{if(b.readyState==2){return false}else{}}}else{}if(b.paused){b.resume()}else{b.playState=1;if(!b.instanceCount||n.flashVersion>8){b.instanceCount++}b.position=(typeof b._iO.position!="undefined"&&!isNaN(b._iO.position)?b._iO.position:0);if(b._iO.onplay){b._iO.onplay.apply(b)}b.setVolume(b._iO.volume,true);b.setPan(b._iO.pan,true);n.o._start(b.sID,b._iO.loop||1,(n.flashVersion==9?b.position:b.position/1000))}};this.start=this.play;this.stop=function(d){if(b.playState==1){b.playState=0;b.paused=false;if(b._iO.onstop){b._iO.onstop.apply(b)}n.o._stop(b.sID,d);b.instanceCount=0;b._iO={}}};this.setPosition=function(f,g){if(typeof f=="undefined"){f=0}var d=Math.min(b.duration,Math.max(f,0));b._iO.position=d;if(!g){}n.o._setPosition(b.sID,(n.flashVersion==9?b._iO.position:b._iO.position/1000),(b.paused||!b.playState))};this.pause=function(){if(b.paused||b.playState===0){return false}b.paused=true;n.o._pause(b.sID);if(b._iO.onpause){b._iO.onpause.apply(b)}};this.resume=function(){if(!b.paused||b.playState===0){return false}b.paused=false;n.o._pause(b.sID);if(b._iO.onresume){b._iO.onresume.apply(b)}};this.togglePause=function(){if(b.playState===0){b.play({position:(n.flashVersion==9?b.position:b.position/1000)});return false}if(b.paused){b.resume()}else{b.pause()}};this.setPan=function(d,f){if(typeof d=="undefined"){d=0}if(typeof f=="undefined"){f=false}n.o._setPan(b.sID,d);b._iO.pan=d;if(!f){b.pan=d}};this.setVolume=function(f,d){if(typeof f=="undefined"){f=100}if(typeof d=="undefined"){d=false}n.o._setVolume(b.sID,(n.muted&&!b.muted)||b.muted?0:f);b._iO.volume=f;if(!d){b.volume=f}};this.mute=function(){b.muted=true;n.o._setVolume(b.sID,0)};this.unmute=function(){b.muted=false;var d=typeof b._iO.volume!="undefined";n.o._setVolume(b.sID,d?b._iO.volume:b.options.volume)};this._whileloading=function(g,f,d){if(!b._iO.isMovieStar){b.bytesLoaded=g;b.bytesTotal=f;b.duration=Math.floor(d);b.durationEstimate=parseInt((b.bytesTotal/b.bytesLoaded)*b.duration,10);if(b.readyState!=3&&b._iO.whileloading){b._iO.whileloading.apply(b)}}else{b.bytesLoaded=g;b.bytesTotal=f;b.duration=Math.floor(d);b.durationEstimate=b.duration;if(b.readyState!=3&&b._iO.whileloading){b._iO.whileloading.apply(b)}}};this._onid3=function(r,g){var q=[];for(var d=0,f=r.length;d<f;d++){q[r[d]]=g[d]}b.id3=n._mergeObjects(b.id3,q);if(b._iO.onid3){b._iO.onid3.apply(b)}};this._whileplaying=function(g,f,r,q,d){if(isNaN(g)||g===null){return false}if(b.playState===0&&g>0){g=0}b.position=g;if(b._iO.usePeakData&&typeof f!="undefined"&&f){b.peakData={left:f.leftPeak,right:f.rightPeak}}if(b._iO.useWaveformData&&typeof r!="undefined"&&r){b.waveformData={left:r.split(","),right:q.split(",")}}if(b._iO.useEQData&&typeof d!="undefined"&&d){b.eqData=d}if(b.playState==1){if(b.isBuffering){b._onbufferchange(0)}if(b._iO.whileplaying){b._iO.whileplaying.apply(b)}if(b.loaded&&b._iO.onbeforefinish&&b._iO.onbeforefinishtime&&!b.didBeforeFinish&&b.duration-b.position<=b._iO.onbeforefinishtime){b._onbeforefinish()}}};this._onload=function(d){d=(d==1?true:false);if(!d){if(n.sandbox.noRemote===true){}if(n.sandbox.noLocal===true){}}b.loaded=d;b.readyState=d?3:2;if(b._iO.onload){b._iO.onload.apply(b)}};this._onbeforefinish=function(){if(!b.didBeforeFinish){b.didBeforeFinish=true;if(b._iO.onbeforefinish){b._iO.onbeforefinish.apply(b)}}};this._onjustbeforefinish=function(d){if(!b.didJustBeforeFinish){b.didJustBeforeFinish=true;if(b._iO.onjustbeforefinish){b._iO.onjustbeforefinish.apply(b)}}};this._onfinish=function(){if(b._iO.onbeforefinishcomplete){b._iO.onbeforefinishcomplete.apply(b)}b.didBeforeFinish=false;b.didJustBeforeFinish=false;if(b.instanceCount){b.instanceCount--;if(!b.instanceCount){b.playState=0;b.paused=false;b.instanceCount=0;b.instanceOptions={};if(b._iO.onfinish){b._iO.onfinish.apply(b)}}}else{if(b.useVideo){}}};this._onmetadata=function(d){if(!d.width&&!d.height){d.width=320;d.height=240}b.metadata=d;b.width=d.width;b.height=d.height;if(b._iO.onmetadata){b._iO.onmetadata.apply(b)}};this._onbufferchange=function(d){if(b.playState===0){return false}if(d==b.isBuffering){return false}b.isBuffering=(d==1?true:false);if(b._iO.onbufferchange){b._iO.onbufferchange.apply(b)}};this._ondataerror=function(d){if(b.playState>0){if(b._iO.ondataerror){b._iO.ondataerror.apply(b)}}else{}}};this._onfullscreenchange=function(c){n.isFullScreen=(c==1?true:false);if(!n.isFullScreen){try{window.focus()}catch(b){}}};if(window.addEventListener){window.addEventListener("focus",n.handleFocus,false);window.addEventListener("load",n.beginDelayedInit,false);window.addEventListener("unload",n.destruct,false);if(n._tryInitOnFocus){window.addEventListener("mousemove",n.handleFocus,false)}}else{if(window.attachEvent){window.attachEvent("onfocus",n.handleFocus);window.attachEvent("onload",n.beginDelayedInit);window.attachEvent("unload",n.destruct)}else{n._debugTS("onload",false);soundManager.onerror();soundManager.disable()}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",n.domContentLoaded,false)}}var GalleryPassOpened=[];var gallery={initialize:function(k,f){this.setOptions({showArrows:true,showCarousel:true,showInfopane:true,embedLinks:true,fadeDuration:500,timed:false,delay:9000,preloader:true,preloaderImage:true,preloaderErrorImage:true,manualData:[],populateFrom:false,populateData:true,destroyAfterPopulate:true,elementSelector:"div.imageElement",titleSelector:"h3",subtitleSelector:"p",linkSelector:"a.open",imageSelector:"img.full",thumbnailSelector:"img.thumbnail",defaultTransition:"fade",slideInfoZoneOpacity:0.8,slideInfoZoneSlide:true,carouselMinimizedOpacity:0.5,carouselMinimizedHeight:20,carouselMaximizedOpacity:1,thumbHeight:75,thumbWidth:100,thumbSpacing:10,thumbIdleOpacity:0.3,textShowCarousel:"Pictures",showCarouselLabel:true,thumbCloseCarousel:true,useThumbGenerator:false,thumbGenerator:"resizer.php",useExternalCarousel:false,carouselElement:false,carouselHorizontal:true,activateCarouselScroller:true,carouselPreloader:true,textPreloadingCarousel:"Loading...",baseClass:"jdGallery",withArrowsClass:"withArrows",useHistoryManager:false,customHistoryKey:false},f);this.fireEvent("onInit");this.currentIter=0;this.lastIter=0;this.maxIter=0;this.galleryElement=k;this.galleryData=this.options.manualData;this.galleryInit=1;this.galleryElements=Array();this.thumbnailElements=Array();this.galleryElement.addClass(this.options.baseClass);this.populateFrom=k;if(this.options.populateFrom){this.populateFrom=this.options.populateFrom}if(this.options.populateData){this.populateData()}k.style.display="block";if(this.options.useHistoryManager){this.initHistory()}if(this.options.embedLinks){this.currentLink=new Element("a").addClass("open").addEvent("focus",(function(){this.blur()})).setProperties({href:"#",title:"",rel:"lightbox"}).injectInside(k);if((!this.options.showArrows)&&(!this.options.showCarousel)){this.galleryElement=k=this.currentLink}else{this.currentLink.setStyle("display","none")}}this.constructElements();if((this.galleryData.length>1)&&(this.options.showArrows)){var h=new Element("a").addClass("left").addEvent("click",this.prevItem.bind(this)).injectInside(k);var g=new Element("a").addClass("right").addEvent("click",this.nextItem.bind(this)).injectInside(k);this.galleryElement.addClass(this.options.withArrowsClass)}this.loadingElement=new Element("div").addClass("loadingElement").injectInside(k);if(this.options.showInfopane){this.initInfoSlideshow()}if(this.options.showCarousel){this.initCarousel()}this.doSlideShow(1)},populateData:function(){currentArrayPlace=this.galleryData.length;options=this.options;var b=$A(this.galleryData);b.extend(this.populateGallery(this.populateFrom,currentArrayPlace));this.galleryData=b;this.fireEvent("onPopulated")},populateGallery:function(f,g){var d=[];options=this.options;currentArrayPlace=g;f.getElements(options.elementSelector).each(function(b){elementDict={image:b.getElement(options.imageSelector).getProperty("src"),number:currentArrayPlace,transition:this.options.defaultTransition};elementDict.extend=$extend;if((options.showInfopane)|(options.showCarousel)){elementDict.extend({title:b.getElement(options.titleSelector).innerHTML,description:b.getElement(options.subtitleSelector).innerHTML})}if(options.embedLinks){elementDict.extend({link:b.getElement(options.linkSelector).href||false,linkTitle:b.getElement(options.linkSelector).title||false,linkTarget:b.getElement(options.linkSelector).getProperty("target")||false})}if((!options.useThumbGenerator)&&(options.showCarousel)){elementDict.extend({thumbnail:b.getElement(options.thumbnailSelector).getProperty("src")})}else{if(options.useThumbGenerator){elementDict.extend({thumbnail:options.thumbGenerator+"?imgfile="+elementDict.image+"&max_width="+options.thumbWidth+"&max_height="+options.thumbHeight})}}d.extend([elementDict]);currentArrayPlace++;if(this.options.destroyAfterPopulate){b.remove()}});return d},constructElements:function(){el=this.galleryElement;this.maxIter=this.galleryData.length;var b;for(i=0;i<this.galleryData.length;i++){var b=new Fx.Styles(new Element("div").addClass("slideElement").setStyles({position:"absolute",left:"0px",right:"0px",margin:"0px",padding:"0px",backgroundPosition:"center center",opacity:"0"}).injectInside(el),"opacity",{duration:this.options.fadeDuration});if(this.options.preloader){b.source=this.galleryData[i].image;b.loaded=false;b.load=function(c){if(!c.loaded){new Asset.image(c.source,{onload:function(d){d.element.setStyle("backgroundImage","url('"+d.source+"')");d.loaded=true}.bind(this,c)})}}.pass(b,this)}else{b.element.setStyle("backgroundImage","url('"+this.galleryData[i].image+"')")}this.galleryElements[parseInt(i)]=b}},destroySlideShow:function(f){var d=f.className;var g=new Element("div").addClass("myClassName");f.parentNode.replaceChild(g,f)},startSlideShow:function(){this.fireEvent("onStart");this.loadingElement.style.display="none";this.lastIter=this.maxIter-1;this.currentIter=0;this.galleryInit=0;this.galleryElements[parseInt(this.currentIter)].set({opacity:1});if(this.options.showInfopane){this.showInfoSlideShow.delay(1000,this)}var b=formatString(this.options.textShowCarousel,this.currentIter+1,this.maxIter);if(this.options.showCarousel&&(!this.options.carouselPreloader)){this.carouselBtn.getFirst().setText(b)}this.prepareTimer();if(this.options.embedLinks){this.makeLink(this.currentIter)}},nextItem:function(){this.hideCarousel();this.fireEvent("onNextCalled");this.nextIter=this.currentIter+1;if(this.nextIter>=this.maxIter){this.nextIter=0}this.galleryInit=0;this.goTo(this.nextIter)},prevItem:function(){this.hideCarousel();this.fireEvent("onPreviousCalled");this.nextIter=this.currentIter-1;if(this.nextIter<=-1){this.nextIter=this.maxIter-1}this.galleryInit=0;this.goTo(this.nextIter)},goTo:function(b){this.clearTimer();if(this.options.preloader){this.galleryElements[b].load();if(b==0){this.galleryElements[this.maxIter-1].load()}else{this.galleryElements[b-1].load()}if(b==(this.maxIter-1)){this.galleryElements[0].load()}else{this.galleryElements[b+1].load()}}if(this.options.embedLinks){this.clearLink()}if(this.options.showInfopane){this.slideInfoZone.clearChain();this.hideInfoSlideShow().chain(this.changeItem.pass(b,this))}else{this.currentChangeDelay=this.changeItem.delay(500,this,b)}if(this.options.embedLinks){this.makeLink(b)}this.prepareTimer()},changeItem:function(c){this.fireEvent("onStartChanging");this.galleryInit=0;if(this.currentIter!=c){for(i=0;i<this.maxIter;i++){if((i!=this.currentIter)){this.galleryElements[i].set({opacity:0})}}gallery.Transitions[this.galleryData[c].transition].pass([this.galleryElements[this.currentIter],this.galleryElements[c],this.currentIter,c],this)();this.currentIter=c}var d=formatString(this.options.textShowCarousel,c+1,this.maxIter);if(this.options.showCarousel){this.carouselBtn.getFirst().setText(d)}this.doSlideShow.bind(this)();this.fireEvent("onChanged")},clearTimer:function(){if(this.options.timed){$clear(this.timer)}},prepareTimer:function(){if(this.options.timed){this.timer=this.nextItem.delay(this.options.delay,this)}},doSlideShow:function(b){if(this.galleryInit==1){imgPreloader=new Image();imgPreloader.onload=function(){this.startSlideShow.delay(10,this)}.bind(this);imgPreloader.src=this.galleryData[0].image;if(this.options.preloader){this.galleryElements[0].load()}}else{if(this.options.showInfopane){if(this.options.showInfopane){this.showInfoSlideShow.delay((500+this.options.fadeDuration),this)}else{if((this.options.showCarousel)&&(this.options.activateCarouselScroller)){this.centerCarouselOn(b)}}}}},createCarousel:function(){var c;if(!this.options.useExternalCarousel){var d=new Element("div").addClass("carouselContainer").injectInside(this.galleryElement);this.carouselContainer=new Fx.Styles(d,{transition:Fx.Transitions.expoOut});this.carouselContainer.normalHeight=d.offsetHeight;this.carouselContainer.set({opacity:this.options.carouselMinimizedOpacity,top:(this.options.carouselMinimizedHeight-this.carouselContainer.normalHeight)});this.carouselBtn=new Element("a").addClass("carouselBtn").setProperty("title","Afficher les vignettes").injectInside(d).adopt(new Element("span"));if(this.options.carouselPreloader){this.carouselBtn.getFirst().setText(this.options.textPreloadingCarousel)}else{this.carouselBtn.getFirst().setText(this.options.textShowCarousel)}this.ClickCarousel=false;this.carouselBtn.addEvents({click:function(){this.ClickCarousel=true;this.carouselContainer.clearTimer();this.toggleCarousel()}.bind(this),mouseenter:function(){if(!this.ClickCarousel){fxbtgal(this.carouselBtn.getParent(),0.8)}}.bind(this),mouseleave:function(){if(!this.ClickCarousel){fxbtgal(this.carouselBtn.getParent(),0.5)}}.bind(this)});this.carouselActive=false;c=new Element("div").addClass("carousel").injectInside(d);this.carousel=new Fx.Styles(c)}else{c=$(this.options.carouselElement).addClass("jdExtCarousel")}this.carouselElement=new Fx.Styles(c,{transition:Fx.Transitions.expoOut});this.carouselElement.normalHeight=c.offsetHeight;if(this.options.showCarouselLabel){this.carouselLabel=new Element("p").addClass("label").injectInside(c)}carouselWrapper=new Element("div").addClass("carouselWrapper").injectInside(c);this.carouselWrapper=new Fx.Styles(carouselWrapper,{transition:Fx.Transitions.expoOut});this.carouselWrapper.normalHeight=carouselWrapper.offsetHeight;this.carouselInner=new Element("div").addClass("carouselInner").injectInside(carouselWrapper);if(this.options.activateCarouselScroller){this.carouselWrapper.scroller=new Scroller(carouselWrapper,{area:100,velocity:0.2});this.carouselWrapper.elementScroller=new Fx.Scroll(carouselWrapper,{duration:400,onStart:this.carouselWrapper.scroller.stop.bind(this.carouselWrapper.scroller),onComplete:this.carouselWrapper.scroller.start.bind(this.carouselWrapper.scroller)})}},fillCarousel:function(){this.constructThumbnails();this.carouselInner.normalWidth=((this.maxIter*(this.options.thumbWidth+this.options.thumbSpacing+2))+this.options.thumbSpacing)+"px";this.carouselInner.style.width=this.carouselInner.normalWidth},initCarousel:function(){this.createCarousel();this.fillCarousel();if(this.options.carouselPreloader){this.preloadThumbnails()}},flushCarousel:function(){this.thumbnailElements.each(function(b){b.element.remove();b=b.element=null});this.thumbnailElements=[]},toggleCarousel:function(){if(this.carouselActive){this.hideCarousel()}else{if(!this.waithide){this.animatego=true;this.showCarousel();this.carouselBtn.addClass("carouselBtnS");this.carouselBtn.setProperty("title","Masquer les vignettes")}}},showCarousel:function(){this.fireEvent("onShowCarousel");this.carouselContainer.set({opacity:this.options.carouselMaximizedOpacity});this.carouselContainer.start({opacity:this.options.carouselMaximizedOpacity,top:0}).chain(function(){this.carouselActive=true;this.carouselWrapper.scroller.start();this.fireEvent("onCarouselShown");this.carouselContainer.options.onComplete=null;(function(){this.animatego=false}).delay(100,this)}.bind(this))},hideCarousel:function(){if((this.animatego||this.carouselActive)&&!this.waithide){this.waithide=true;gohide=(function(){this.fireEvent("onHideCarousel");this.carouselBtn.removeClass("carouselBtnS");this.carouselBtn.setProperty("title","Afficher les vignettes");var b=this.options.carouselMinimizedHeight-this.carouselContainer.normalHeight;this.carouselContainer.start({opacity:this.options.carouselMinimizedOpacity,top:b}).chain(function(){this.carouselWrapper.scroller.stop();this.fireEvent("onCarouselHidden");this.carouselContainer.options.onComplete=null;this.carouselActive=false;this.waithide=false}.bind(this));this.ClickCarousel=false}).bind(this);checkgo=(function(){if(!this.animatego){gohide()}else{checkgo.delay(100)}}).bind(this);checkgo()}},constructThumbnails:function(){element=this.carouselInner;for(i=0;i<this.galleryData.length;i++){var b=new Fx.Style(new Element("div").addClass("thumbnail").setStyles({backgroundImage:"url('"+this.galleryData[i].thumbnail+"')",backgroundPosition:"center center",backgroundRepeat:"no-repeat",marginLeft:this.options.thumbSpacing+"px",width:this.options.thumbWidth+"px",height:this.options.thumbHeight+"px"}).injectInside(element),"opacity",{duration:200}).set(this.options.thumbIdleOpacity);b.element.addEvents({mouseover:function(c){c.clearTimer();c.start(1);if(this.options.showCarouselLabel){$(this.carouselLabel).setHTML('<span class="number">'+(c.relatedImage.number+1)+"/"+this.maxIter+":</span> "+c.relatedImage.title)}}.pass(b,this),mouseout:function(c){c.clearTimer();c.start(this.options.thumbIdleOpacity)}.pass(b,this),click:function(c){this.goTo(c.relatedImage.number);if(this.options.thumbCloseCarousel){this.hideCarousel()}}.pass(b,this)});b.relatedImage=this.galleryData[i];this.thumbnailElements[parseInt(i)]=b}},log:function(b){if(console.log){console.log(b)}},preloadThumbnails:function(){var b=[];for(i=0;i<this.galleryData.length;i++){b[parseInt(i)]=this.galleryData[i].thumbnail}this.thumbnailPreloader=new Preloader();this.thumbnailPreloader.addEvent("onComplete",function(){var c=formatString(this.options.textShowCarousel,this.currentIter+1,this.maxIter);this.carouselBtn.getFirst().setText(c)}.bind(this));this.thumbnailPreloader.load(b)},clearThumbnailsHighlights:function(){for(i=0;i<this.galleryData.length;i++){this.thumbnailElements[i].clearTimer();this.thumbnailElements[i].start(0.2)}},changeThumbnailsSize:function(c,d){for(i=0;i<this.galleryData.length;i++){this.thumbnailElements[i].clearTimer();this.thumbnailElements[i].element.setStyles({width:c+"px",height:d+"px"})}},centerCarouselOn:function(o){if(!this.carouselWallMode){var m=this.thumbnailElements[o];var k=m.element.offsetLeft+(m.element.offsetWidth/2);var n=this.carouselWrapper.element.offsetWidth;var h=this.carouselInner.offsetWidth;var p=n/2;var l=k-p;this.carouselWrapper.elementScroller.scrollTo(l,0)}},initInfoSlideshow:function(){this.slideInfoZone=new Fx.Styles(new Element("div").addClass("slideInfoZone").injectInside($(this.galleryElement))).set({opacity:0});var c=new Element("h2").injectInside(this.slideInfoZone.element);var d=new Element("p").injectInside(this.slideInfoZone.element);this.slideInfoZone.normalHeight=this.slideInfoZone.element.offsetHeight;this.slideInfoZone.element.setStyle("opacity",0)},changeInfoSlideShow:function(){this.hideInfoSlideShow.delay(10,this);this.showInfoSlideShow.delay(500,this)},showInfoSlideShow:function(){this.fireEvent("onShowInfopane");this.slideInfoZone.clearTimer();element=this.slideInfoZone.element;element.getElement("h2").setHTML(this.galleryData[this.currentIter].title);element.getElement("p").setHTML(this.galleryData[this.currentIter].description);if(this.options.slideInfoZoneSlide){this.slideInfoZone.start({opacity:[0,this.options.slideInfoZoneOpacity],height:[0,this.slideInfoZone.normalHeight]})}else{this.slideInfoZone.start({opacity:[0,this.options.slideInfoZoneOpacity]})}if(this.options.showCarousel){this.slideInfoZone.chain(this.centerCarouselOn.pass(this.currentIter,this))}return this.slideInfoZone},hideInfoSlideShow:function(){this.fireEvent("onHideInfopane");this.slideInfoZone.clearTimer();if(this.options.slideInfoZoneSlide){this.slideInfoZone.start({opacity:0,height:0})}else{this.slideInfoZone.start({opacity:0})}return this.slideInfoZone},makeLink:function(b){this.currentLink.setProperties({href:this.galleryData[b].link,title:this.galleryData[b].linkTitle}).addEvent("click",(function(){this.hideCarousel()}).bind(this));if(!((this.options.embedLinks)&&(!this.options.showArrows)&&(!this.options.showCarousel))){this.currentLink.setStyle("display","block")}},clearLink:function(){this.currentLink.setProperties({href:"",title:""});if(!((this.options.embedLinks)&&(!this.options.showArrows)&&(!this.options.showCarousel))){this.currentLink.setStyle("display","none")}},flushGallery:function(){this.galleryElements.each(function(b){b.element.remove();b=b.element=null});this.galleryElements=[]},changeData:function(b){this.galleryData=b;this.clearTimer();this.flushGallery();if(this.options.showCarousel){this.flushCarousel()}this.constructElements();if(this.options.showCarousel){this.fillCarousel()}if(this.options.showInfopane){this.hideInfoSlideShow()}this.galleryInit=1;this.lastIter=0;this.currentIter=0;this.doSlideShow(1)},initHistory:function(){this.fireEvent("onHistoryInit");this.historyKey=this.galleryElement.id+"-picture";if(this.options.customHistoryKey){this.historyKey=this.options.customHistoryKey()}this.history=HistoryManager.register(this.historyKey,[1],function(b){if(parseInt(b[0])-1<this.maxIter){this.goTo(parseInt(b[0])-1)}}.bind(this),function(b){return[this.historyKey,"(",b[0],")"].join("")}.bind(this),this.historyKey+"\\((\\d+)\\)");this.addEvent("onChanged",function(){this.history.setValue(0,this.currentIter+1)}.bind(this));this.fireEvent("onHistoryInited")}};gallery=new Class(gallery);gallery.implement(new Events);gallery.implement(new Options);gallery.Transitions=new Abstract({fade:function(k,h,g,f){k.options.transition=h.options.transition=Fx.Transitions.linear;k.options.duration=h.options.duration=this.options.fadeDuration;if(f>g){h.start({opacity:1})}else{h.set({opacity:1});k.start({opacity:0})}},crossfade:function(k,h,g,f){k.options.transition=h.options.transition=Fx.Transitions.linear;k.options.duration=h.options.duration=this.options.fadeDuration;h.start({opacity:1});k.start({opacity:0})},fadebg:function(k,h,g,f){k.options.transition=h.options.transition=Fx.Transitions.linear;k.options.duration=h.options.duration=this.options.fadeDuration/2;k.start({opacity:0}).chain(h.start.pass([{opacity:1}],h))}});var Preloader=new Class({Implements:[Events,Options],options:{root:"",period:100},initialize:function(b){this.setOptions(b)},load:function(b){this.index=0;this.images=[];this.sources=this.temps=b;this.total=this.sources.length;this.fireEvent("onStart",[this.index,this.total]);this.timer=this.progress.periodical(this.options.period,this);this.sources.each(function(f,d){this.images[d]=new Asset.image(this.options.root+f,{onload:function(){this.index++;if(this.images[d]){this.fireEvent("onLoad",[this.images[d],d,f])}}.bind(this),onerror:function(){this.index++;this.fireEvent("onError",[this.images.splice(d,1),d,f])}.bind(this),onabort:function(){this.index++;this.fireEvent("onError",[this.images.splice(d,1),d,f])}.bind(this)})},this)},progress:function(){this.fireEvent("onProgress",[Math.min(this.index,this.total),this.total]);if(this.index>=this.total){this.complete()}},complete:function(){$clear(this.timer);this.fireEvent("onComplete",[this.images])},cancel:function(){$clear(this.timer)}});Preloader.implement(new Events,new Options);function formatString(){var f=arguments.length;var g=arguments[0];for(var l=1;l<f;l++){var h="\\{"+(l-1)+"\\}";var k=new RegExp(h,"g");g=g.replace(k,arguments[l])}return g}var gallerySet=gallery.extend({initialize:function(c,d){this.setOptions({manualSetData:[],gallerySelector:"div.galleryElement",galleryTitleSelector:"h2",textGallerySelector:"Galerie Photo",textShowGallerySelector:"Retour Galeries",textGalleryInfo:"{0} photos",startWithSelector:true,textShowCarousel:"Photo {0}/{1}",carouselPreloader:false},d);this.gallerySet=this.options.manualSetData;this.addEvent("onPopulated",this.createGallerySelectorTab.bind(this));this.addEvent("onPopulated",this.createGallerySelector.bind(this));this.startWithSelectorFn=this.toggleGallerySelector.pass(true,this);if(this.options.startWithSelector){this.addEvent("onGallerySelectorCreated",this.startWithSelectorFn)}this.parent(c,this.options)},populateData:function(){options=this.options;var b=$A(this.gallerySet);this.populateFrom.getElements(options.gallerySelector).each(function(c){currentGalArrayPlace=0;var d=c.getElement(options.galleryTitleSelector);galleryDict={title:d.innerHTML,thumb:d.id,id:c.id,elements:[]};galleryDict.elements.extend(this.populateGallery(c,0));b.extend([galleryDict]);if(this.options.destroyAfterPopulate){c.remove()}},this);this.gallerySet=b;this.galleryData=b[0].elements;this.currentGallery=0;this.fireEvent("onPopulated")},changeGallery:function(b){var c=checkGalPassword(this.gallerySet[b]);if(c){if(b!=this.currentGallery||c.password){this.changeData(c);this.maxIter=c.length;this.currentGallery=b;this.gallerySelectorBtn.getFirst().setText(this.gallerySet[b].title);this.fireEvent("onGalleryChanged")}this.toggleGallerySelector(false)}},createGallerySelectorTab:function(){this.gallerySelectorBtn=(new Element("a").addClass("gallerySelectorBtn").setProperties({title:this.options.textShowGallerySelector}).adopt(new Element("span").setText(this.gallerySet[0].title))).addEvents({click:function(){this.toggleGallerySelector(true)}.bind(this),mouseenter:function(){fxbtgal(this,0.8)},mouseleave:function(){fxbtgal(this,0.5)}}).injectInside(this.galleryElement);this.addEvent("onShowCarousel",function(){this.gallerySelectorBtn.setStyle("zIndex",10)}.bind(this));this.addEvent("onCarouselHidden",function(){this.gallerySelectorBtn.setStyle("zIndex",15)}.bind(this))},createGallerySelector:function(){this.gallerySelector=new Fx.Styles(new Element("div").addClass("gallerySelector").injectInside(this.galleryElement).setStyles({display:"none",opacity:"0"}));var b=this.galleryElement.offsetHeight-45;this.gallerySelectorWrapper=new Fx.Style(new Element("div").addClass("gallerySelectorWrapper").setStyle("height",b+"px").injectInside(this.gallerySelector.element));this.gallerySelectorInner=new Element("div").addClass("gallerySelectorInner").injectInside(this.gallerySelectorWrapper.element);this.gallerySelectorWrapper.scroller=new Scroller(this.gallerySelectorWrapper.element,{area:100,velocity:0.3}).start();this.createGalleryButtons();this.fireEvent("onGallerySelectorCreated")},createGalleryButtons:function(){var b=((this.galleryElement.offsetWidth-30)/2)-14;this.gallerySet.each(function(h,f){var l=new Element("div").addClass("galleryButton").injectInside(this.gallerySelectorInner).addEvents({mouseover:function(c){c.button.addClass("hover")}.pass(h,this),mouseout:function(c){c.button.removeClass("hover")}.pass(h,this),click:function(d,c){this.changeGallery.pass(c,this)()}.pass([h,f],this)}).setStyle("width",b);h.button=l;var k="";if(this.options.showCarousel){if(h.thumb!="nothumb"){k=h.elements[0].thumbnail.substring(0,h.elements[0].thumbnail.lastIndexOf("/thumb/"))+"/preview/"+h.thumb}}else{k=h.elements[0].image}var g=(/password/i.test(h.id))?true:false;h.previewGal=new Element("div").addClass("preview").injectInside(l);new Element("h3").setHTML(h.title).injectInside(l);if(GalleryPassOpened[h.id]){if(GalleryPassOpened[h.id].preview){h.previewGal.setStyle("backgroundImage","url('"+GalleryPassOpened[h.id].preview+"')")}new Element("p").addClass("locked").setStyles({color:"#20b040","font-size":"80%","margin-top":"-1px"}).setHTML("Galerie d&eacute;v&eacute;rouill&eacute;e").injectInside(l);new Element("p").addClass("info").setStyles({"font-size":"80%","margin-top":"-1px"}).setText(formatString(this.options.textGalleryInfo,GalleryPassOpened[h.id].nbr)).injectInside(l)}else{if(g){h.previewGal.setStyle("background","url('img/locked.gif') center center");new Element("p").addClass("locked").setHTML("Galerie v&eacute;rouill&eacute;e").injectInside(l)}else{if(k){h.previewGal.setStyle("backgroundImage","url('"+k+"')")}new Element("p").addClass("info").setText(formatString(this.options.textGalleryInfo,h.elements.length)).injectInside(l)}}},this);new Element("br").injectInside(this.gallerySelectorInner).setStyle("clear","both");(function(){$("loading_gallery").remove()}).delay(750)},toggleGallerySelector:function(b){if(b){this.gallerySelector.start({opacity:1}).element.setStyle("display","block")}else{this.gallerySelector.start({opacity:0})}},initHistory:function(){this.fireEvent("onHistoryInit");this.historyKey=this.galleryElement.id+"-gallery";if(this.options.customHistoryKey){this.historyKey=this.options.customHistoryKey()}this.history=HistoryManager.register(this.historyKey,[1,1],function(b){this.changeGallery.pass(parseInt(b[0])-1,this).delay(10);if(this.gallerySelector){this.toggleGallerySelector.pass(false,this).delay(500)}this.goTo.pass(parseInt(b[1])-1,this).delay(100)}.bind(this),function(b){return[this.historyKey,"(",b[0],")","-picture","(",b[1],")"].join("")}.bind(this),this.historyKey+"\\((\\d+)\\)-picture\\((\\d+)\\)");updateHistory=function(){this.history.setValue(0,this.currentGallery+1);this.history.setValue(1,this.currentIter+1)}.bind(this);this.addEvent("onChanged",updateHistory);this.addEvent("onGalleryChanged",updateHistory);this.fireEvent("onHistoryInited")}});gallery.Transitions.extend({fadeslideleft:function(k,h,g,f){k.options.transition=h.options.transition=Fx.Transitions.Cubic.easeOut;k.options.duration=h.options.duration=1500;if(f>g){h.start({left:[this.galleryElement.offsetWidth,0],opacity:1});k.start({opacity:[1,0]})}else{h.start({opacity:[0,1]});k.start({left:[0,this.galleryElement.offsetWidth],opacity:0}).chain(function(b){b.set({left:0})}.pass(k))}},continuoushorizontal:function(k,h,g,f){k.options.transition=h.options.transition=Fx.Transitions.linear;if(((f>g)||((f==0)&&(g==(this.maxIter-1))))&&(!((f==(this.maxIter-1))&&(g==0)))){k.set({opacity:1});k.start({left:[0,this.galleryElement.offsetWidth*-1]});h.set({opacity:1,left:this.galleryElement.offsetWidth});h.start({left:[this.galleryElement.offsetWidth,0]})}else{k.set({opacity:1});k.start({left:[0,this.galleryElement.offsetWidth]});h.set({opacity:1,left:this.galleryElement.offsetWidth*-1});h.start({left:[this.galleryElement.offsetWidth*-1,0]})}},continuousvertical:function(k,h,g,f){k.options.transition=h.options.transition=Fx.Transitions.linear;if(((f>g)||((f==0)&&(g==(this.maxIter-1))))&&(!((f==(this.maxIter-1))&&(g==0)))){k.set({opacity:1});k.start({top:[0,this.galleryElement.offsetHeight*-1]});h.set({opacity:1,top:this.galleryElement.offsetHeight});h.start({top:[this.galleryElement.offsetHeight,0]})}else{k.set({opacity:1});k.start({top:[0,this.galleryElement.offsetHeight]});h.set({opacity:1,top:this.galleryElement.offsetHeight*-1});h.start({top:[this.galleryElement.offsetHeight*-1,0]})}}});function fxbtgal(c,b){if(c.fx){c.fx.stop();c.fx.start(b)}else{c.fx=c.effect("opacity",{duration:200}).start(b)}}gallery.load=function(){if($("myGallerySet")){document.myGallerySet=new gallerySet($("myGallerySet"),{timed:false,defaultTransition:"continuoushorizontal"});Slimbox.load()}};function checkGalPassword(c){if(GalleryPassOpened[c.id]){return(GalleryPassOpened[c.id])}else{if(/password/i.test(c.id)){this.div=c.previewGal;this.id=c.id;new Element("div").addClass("backblock").injectInside(document.body);this.pass=new Element("div").setOpacity(0.01).addClass("passwin").adopt(new Element("div").setOpacity(0).addClass("passload").adopt(new Element("div").setText("V\351rification en cours...")),new Element("div").addClass("passtitle").setText("Galerie prot\351g\351e"),new Element("div").addClass("passhr"),new Element("div").addClass("passname").setText("mot de passe"),new Element("div").addClass("passinput").adopt(new Element("input",{id:"passpassgal",type:"password"}).addClass("passtexte").addEvents({keydown:function(f){if((f.keyCode==10||f.keyCode==13||f.which==13)&&this.value){$("passcodegal").focus();f.returnValue=false;return(false)}},mousedown:function(f){nosel=true}})),new Element("div").addClass("passname").setStyle("margin-top","-4px").adopt(new Element("img",{id:"passimggal",src:"admin/antispam/AntiSpam-image.php?random="+Math.random()})),new Element("div").addClass("passinput").adopt(new Element("input",{id:"passcodegal",type:"texte"}).addClass("passtexte").addEvents({keydown:function(f){if((f.keyCode==10||f.keyCode==13||f.which==13)&&this.value){this.blur();$(this).getParent().getNext().getFirst().fireEvent("click");f.returnValue=false;return(false)}},mousedown:function(f){nosel=true}})),new Element("div").addClass("passsave").adopt(new Element("input",{type:"button"}).addClass("passapply").addEvents({focus:function(f){this.blur()},click:function(h){var g=$("passpassgal").getValue();var f=$("passcodegal").getValue();if(!g){alert("Veuillez saisir le mot de passe !");$("passpassgal").focus();return}if(!f){alert("Veuillez recopier le code de v\351rification !");$("passcodegal").focus();return}this.load=this.pass.getFirst().effect("opacity",{duration:500}).start(1);this.time=false;(function(){this.time=true}).delay(2000,this);new Ajax("gallery/ajaxConnect.php",{method:"post",data:"id="+this.id+"&pass="+MD5(g)+"&code="+f,onComplete:AjaxGalPass.bind(this),evalResponse:true,autoCancel:true}).request()}.bind(this)}),new Element("input",{type:"button"}).addClass("passcancel").addEvents({focus:function(f){this.blur()},click:function(f){this.removebox()}.bind(this)}))).injectInside(document.body);function b(){this.fx=this.pass.effect("opacity",{duration:500}).start(1);$("passpassgal").focus()}function d(){if($("passimggal").complete){b.bind(this)()}else{d.delay(100,this)}}d.delay(100,this);this.removebox=function(f){this.fx.addEvent("onComplete",function(){var g=this.pass.getPrevious();g.effect("opacity",{duration:300,onComplete:function(h){h.remove();if(f){f()}}}).start(0.7,0);this.pass.remove()}.bind(this));this.fx.start(0)};return(false)}else{return(c.elements)}}}function AjaxGalPass(){if(a=="erreur"){function k(){$("passimggal").setProperty("src","admin/antispam/AntiSpam-image.php?random="+Math.random());$("passcodegal").value="";$("passpassgal").value="";d.delay(200,this)}function d(){if(!this.time||!$("passimggal").complete){d.delay(200,this)}else{this.load.addEvent("onComplete",function(){messagebox("Erreur inconnue !",true)});this.load.start(0)}}k.delay(800,this)}else{if(a=="wrongcode"){function h(){$("passimggal").setProperty("src","admin/antispam/AntiSpam-image.php?random="+Math.random());$("passcodegal").value="";c.delay(200,this)}function c(){if(!this.time||!$("passimggal").complete){c.delay(200,this)}else{this.load.addEvent("onComplete",function(){messagebox("Le code de v\351rification ne correspond pas !",true);$("passcodegal").focus()});this.load.start(0)}}h.delay(800,this)}else{if(a=="wrongpass"){function f(){$("passimggal").setProperty("src","admin/antispam/AntiSpam-image.php?random="+Math.random());$("passcodegal").value="";$("passpassgal").value="";b.delay(200,this)}function b(){if(!this.time||!$("passimggal").complete){b.delay(200,this)}else{this.load.addEvent("onComplete",function(){messagebox("Le mot de pass est incorrect !",true);$("passpassgal").focus()});this.load.start(0)}}f.delay(800,this)}else{if(a){function g(){messagebox("Galerie d\351v\351rouill\351e");this.removebox(function(){GalleryPassOpened[this.id]=a;this.div.setStyle("background","#000 url('"+GalleryPassOpened[this.id].preview+"') no-repeat center center");this.div.getNext().getNext().setText("Galerie d\351v\351rouill\351e").setStyles({color:"#20b040","font-size":"80%","margin-top":"-1px"});new Element("p").addClass("info").setStyles({"font-size":"80%","margin-top":"-1px"}).setText(formatString(document.myGallerySet.options.textGalleryInfo,GalleryPassOpened[this.id].nbr)).injectInside(this.div.getParent());this.div.getParent().fireEvent("mouseover");(function(){this.div.getParent().fireEvent("click");this.div.getParent().fireEvent("mouseout")}.bind(this)).delay(750)})}g.delay(1000,this)}}}}}function imgVol(c){var b;if(c>=66){b="volume3"}else{if(c>=33){b="volume2"}else{if(c>=1){b="volume1"}else{b="muet"}}}b="url(img/"+b+".gif)";if(b!=($("volume").getStyle("background-image"))){$("volume").setStyle("background-image",b)}}function InitSounds(){if(conf.sounds){slidevol=new Slider($("volumecontent"),$("volbtn"),{onChange:function(b){imgVol(b)},onComplete:function(b){try{setVolumes(b)}catch(c){}if(!slidemute){conf.sound.now.global=b;conf.sound.now.mute=false}slidemute=false}});if(conf.sound.conf.mute){slidemute=true;slidevol.set(0)}else{slidevol.set(conf.sound.conf.global)}soundManager=new SoundManager();soundManager.onload=function(){var b;conf.sound.now=[];for(sd in conf.sound.conf){if(sd!="mute"&&sd!="global"){if(conf.sound.conf[sd].load){conf.sound.toload[sd]=true}b=(conf.sound.conf.mute)?0:(conf.sound.conf[sd].vol*(conf.sound.conf.global/100)).round();conf.sound.now[sd]=b;conf.sound.load[sd]=false;soundManager.createSound({id:sd,url:conf.sound.conf[sd].path,volume:b,autoLoad:(conf.sound.conf[sd].load)?true:false,onload:function(){conf.sound.load[this.sID]=true},onfinish:function(){if(conf.sound.conf[this.sID].loop){this.play()}}})}else{conf.sound.now[sd]=conf.sound.conf[sd]}}};soundManager.onerror=function(){conf.sounds=false}}}function playsound(d,c){function b(){if(conf.sounds){soundManager.play(d)}}if(c){b.delay(c)}else{b()}}function setVolumes(d){function b(m,f,h){var g=0;var l=(h>f)?5:-5;var n=f;function k(){n+=l;if((h>f&&n<h)||(h<f&&n>h)){soundManager.setVolume(m,n);k.delay(50)}else{soundManager.setVolume(m,h)}}k()}var c;for(sd in conf.sound.conf){c=(conf.sound.conf[sd].vol*(d/100)).round();if(sd!="mute"&&sd!="global"){b(sd,conf.sound.now[sd],c);conf.sound.now[sd]=c}}}function togglesound(){if(!conf.sound.now.mute&&conf.sound.now.global!==0){conf.sound.now.mute=true;slidemute=true;slidevol.set(0)}else{conf.sound.now.mute=false;slidevol.set(parseInt(conf.sound.now.global,10))}}var MenuFx,nosel,messbox;function InitPage(){function c(){$("boxTL").setOpacity(0);$("boxBL").setOpacity(0);$("boxTR").setOpacity(0);$("boxBR").setOpacity(0);$("logo").setOpacity(0);var h=new Element("div",{id:"start"}).injectInside($("bodypage"));new Element("div",{id:"sound"}).injectTop($("boxBL")).adopt(new Element("div",{id:"volume"}),new Element("div",{id:"volumecontent"}).adopt(new Element("div",{id:"volbtn"})));$("volume").addEvent("click",function(k){togglesound()});$("volbtn").addEvents({mouseenter:function(k){this.setStyle("background-image","url(img/btnvolSel.gif)")},mouseleave:function(k){this.setStyle("background-image","url(img/btnvol.gif)")}});new Element("div",{id:"InfoPopupX"}).adopt(new Element("div",{id:"imgInfoPopupX"}),new Element("div",{id:"txtInfoPopupX"})).injectInside(document.body);new Element("div",{id:"InfoPopupV"}).adopt(new Element("div",{id:"imgInfoPopupV"}),new Element("div",{id:"txtInfoPopupV"})).injectInside(document.body);$("InfoPopupX").addEvent("click",function(k){hidemessbox("X")});$("InfoPopupV").addEvent("click",function(k){hidemessbox("V")});messbox={fx:{V:$("InfoPopupV").effect("top",{duration:400}),X:$("InfoPopupX").effect("top",{duration:400})},timeout:{V:"",X:""}};document.body.addEvent("mouseup",function(k){nosel=false});document.body.onselectstart=new Function("return(nosel);");$("content").getFirst().addEvent("mousedown",function(k){nosel=true});$("scontentL").getFirst().addEvent("mousedown",function(k){nosel=true});$("pagecontent").getElements("img").each(function(k){k.addEvent("contextmenu",function(l){if(l!==undefined){new Event(l).stop()}})});b()}function b(){InitSounds();InitFourmieFx();MenuFx=new MenuFx();MenuFx.linktomenu();Slimbox.load();g.delay(conf.delayload)}var d=0;function g(){var h=false;if(conf.sounds){for(sd in conf.sound.toload){if(!conf.sound.load[sd]){h=true}}}if(h){if(d<6){d++;g.delay(500)}else{conf.sounds=false;f()}}else{playsound("fxstart",100);f.delay(500)}}function f(){var l=window.getWidth();var k=window.getHeight();function h(){$("start").effect("top",{duration:650,onComplete:p}).start(0,(k+100));q.delay(10)}function p(){$("start").remove()}function q(){var u=$("boxTL").effects({duration:2000,transition:Fx.Transitions.Bounce.easeOut});var t=$("boxBL").effects({duration:2000,transition:Fx.Transitions.Bounce.easeOut});var s=$("boxTR").effects({duration:2000,transition:Fx.Transitions.Bounce.easeOut});var r=$("boxBR").effects({duration:2000,transition:Fx.Transitions.Bounce.easeOut,onComplete:n});u.set({"margin-top":($("boxTL").getSize().size.y*-1)-100,"margin-left":($("boxTL").getSize().size.x*-1)-100});t.set({"margin-top":(k+100),"margin-left":($("boxBL").getSize().size.x*-1)-100});s.set({"margin-top":(($("boxTR").getSize().size.y*-1)+100),"margin-left":l+100});r.set({"margin-top":(k+100),"margin-left":l+100});$("boxTL").setOpacity(1);$("boxBL").setOpacity(1);$("boxTR").setOpacity(1);$("boxBR").setOpacity(1);u.start({"margin-top":0,"margin-left":0});t.start({"margin-top":38,"margin-left":0});s.start({"margin-top":0,"margin-left":252});r.start({"margin-top":38,"margin-left":252})}function n(){$("bodypage").setStyle("overflow-x","auto");o.delay(750);playsound("zicloop",800);if(conf.sounds){function r(){$("sound").effect("opacity",{duration:3000}).start(0,1);$("volbtn").setStyle("display","block")}r.delay(1500)}}function o(){var r=$("logo").effect("margin-top",{duration:500,onComplete:m});r.set(($("logo").getSize().size.y*-1)-100);$("logo").setOpacity(1);if(logofx.conf[logofx.now].sound.start){playsound(logofx.conf[logofx.now].sound.start)}r.start(logofx.conf[logofx.now].divlogo_marginTop.org)}function m(){logofx.fx=$("logo").getFirst().effects({duration:700});$("logo").getFirst().setStyle("position","absolute");$("logo").addEvent("click",function(r){if(!logofx.click&&logofx.conf[logofx.now].click){animlogo()}});logofx.timeout=cachelogo.delay(logofx.conf[logofx.now].time)}h()}c()}var logofx;function InitFourmieFx(){logofx={fx:"",fx2:"",click:false,timeout:"",now:0,old:0,old2:0,nbr:0,conf:{0:{logo_height:{org:65,gros:130,petit:32},logo_width:{org:29,gros:58,petit:14},logo_marginLeft:{org:0,gros:-30},divlogo_marginLeft:{org:-40,petit:10},divlogo_marginTop:{org:-20,petit:0},time:9000,sound:{start:"fourmie",end:false},click:true},1:{logo_height:{org:80,gros:200,petit:32},logo_width:{org:38,gros:95,petit:14},logo_marginLeft:{org:0,gros:-55},divlogo_marginLeft:{org:-47,petit:18},divlogo_marginTop:{org:-25,petit:0},time:11000,sound:{start:false,end:false},click:true},2:{logo_height:{org:70,gros:35,petit:32},logo_width:{org:37,gros:18,petit:25},logo_marginLeft:{org:0,gros:10},divlogo_marginLeft:{org:-43,petit:10},divlogo_marginTop:{org:-22,petit:0},time:9000,sound:{start:false,end:false},click:true},3:{logo_height:{org:80,gros:160,petit:32},logo_width:{org:48,gros:96,petit:14},logo_marginLeft:{org:0,gros:-55},divlogo_marginLeft:{org:-50,petit:10},divlogo_marginTop:{org:-25,petit:0},time:10000,sound:{start:false,end:false},click:true},4:{logo_height:{org:75,gros:40,petit:27},logo_width:{org:52,gros:28,petit:16},logo_marginLeft:{org:-8,gros:0},divlogo_marginLeft:{org:-50,petit:20},divlogo_marginTop:{org:-25,petit:0},time:13000,sound:{start:false,end:false},click:true},5:{logo_height:{org:70,gros:140,petit:27},logo_width:{org:51,gros:102,petit:14},logo_marginLeft:{org:-4,gros:-70},divlogo_marginLeft:{org:-50,petit:20},divlogo_marginTop:{org:-25,petit:0},time:5000,sound:{start:false,end:false},click:true}}};for(logofx.nbr=1;logofx.conf[logofx.nbr];logofx.nbr++){}logofx.nbr--}function animlogo(){logofx.click=true;logofx.timeout=$clear(logofx.timeout);logofx.fx.stop();if(logofx.fx2){logofx.fx2.stop()}function b(){logofx.fx.options.transition=Fx.Transitions.Back.easeOut;logofx.fx.start({height:[logofx.conf[logofx.now].logo_height.gros,logofx.conf[logofx.now].logo_height.org],width:[logofx.conf[logofx.now].logo_width.gros,logofx.conf[logofx.now].logo_width.org],"margin-left":[logofx.conf[logofx.now].logo_marginLeft.gros,logofx.conf[logofx.now].logo_marginLeft.org]}).chain(cachelogo)}logofx.fx.options.transition=Fx.Transitions.Bounce.easeIn;logofx.fx.start({height:[logofx.conf[logofx.now].logo_height.org,logofx.conf[logofx.now].logo_height.gros],width:[logofx.conf[logofx.now].logo_width.org,logofx.conf[logofx.now].logo_width.gros],"margin-left":[logofx.conf[logofx.now].logo_marginLeft.org,logofx.conf[logofx.now].logo_marginLeft.gros]}).chain(b)}function cachelogo(){logofx.click=true;(function(){if(logofx.conf[logofx.now].sound.end){playsound(logofx.conf[logofx.now].sound.end)}logofx.fx.options.transition=Fx.Transitions.Cubic.easeIn;logofx.fx2=$("logo").effects({duration:700,transition:Fx.Transitions.Cubic.easeIn});logofx.fx2.start({"margin-left":[logofx.conf[logofx.now].divlogo_marginLeft.org,logofx.conf[logofx.now].divlogo_marginLeft.petit],"margin-top":[logofx.conf[logofx.now].divlogo_marginTop.org,logofx.conf[logofx.now].divlogo_marginTop.petit]}).chain(showlogo);logofx.fx.start({height:[logofx.conf[logofx.now].logo_height.org,logofx.conf[logofx.now].logo_height.petit],width:[logofx.conf[logofx.now].logo_width.org,logofx.conf[logofx.now].logo_width.petit]})}).delay(200)}function showlogo(){$("logo").setOpacity(0);function d(){var g;do{g=Math.round(Math.random()*logofx.nbr)}while(g==logofx.now||g==logofx.old||g==logofx.old2);return(g)}var c=d();logofx.old2=logofx.old;logofx.old=logofx.now;logofx.now=c;$("logo").getFirst().src="img/logo"+logofx.now+".gif";$("logo").setStyle("margin-left",logofx.conf[logofx.now].divlogo_marginLeft.org+"px");$("logo").getFirst().setStyles({height:logofx.conf[logofx.now].logo_height.org+"px",width:logofx.conf[logofx.now].logo_width.org+"px","margin-left":logofx.conf[logofx.now].logo_marginLeft.org+"px"});function b(){function g(){logofx.click=false;logofx.timeout=cachelogo.delay(logofx.conf[logofx.now].time);$("logo").getFirst().setStyles({height:logofx.conf[logofx.now].logo_height.org+"px",width:logofx.conf[logofx.now].logo_width.org+"px"})}logofx.fx2=$("logo").effect("margin-top",{duration:500,onComplete:g});logofx.fx2.set(($("logo").getSize().size.y*-1)-100);$("logo").setOpacity(1);if(logofx.conf[logofx.now].sound.start){playsound(logofx.conf[logofx.now].sound.start)}logofx.fx2.start(logofx.conf[logofx.now].divlogo_marginTop.org)}function f(){if($("logo").getFirst().complete){b()}else{f.delay(50)}}f.delay(500)}function messagebox(c,b){b=(b)?"X":"V";if(messbox.timeout[b]){messbox.timeout[b]=$clear(messbox.timeout[b])}$("txtInfoPopup"+b).setText(c);messbox.fx[b].stop();messbox.fx[b].start(0);messbox.timeout[b]=(function(){hidemessbox(b)}).delay(4000)}function hidemessbox(b){if(messbox.timeout[b]){messbox.timeout[b]=$clear(messbox.timeout[b])}messbox.fx[b].stop();messbox.fx[b].start(-50)}var MenuFx=new Class({color:function(c){var b=[];b.backmenu={"background-color":"#000000","border-left-color":"#000000","border-right-color":"#000000"};b.backmenusel={"background-color":"#696969","border-left-color":"#808080","border-right-color":"#808080"};b.menu={"background-color":"#454545",color:"#FFFFFF"};b.menuhover={"background-color":"#EEEEEE",color:"#000000"};b.menusel={"background-color":"#272727",color:"#78D861"};b.titreL={color:"#7CBFD8"};b.titreLhover={color:"#ADD6E5"};b.titreLtsel={color:"#7CBFD8"};b.menuL={color:"#FFFFFF"};b.menuLhover={color:"#F3E782"};b.menuLsel={color:"#78D861"};return(b[c])},initleftmenu:function(b){b.getElement(".vSLide").getElements("a").each(function(g,c,f,h,d){c=g.id.substring(6);h=(g.rel)?true:false;d=(h)?"titreL":"menuL";g.className="new"+g.className;this.fxL[c]=g.effects({duration:800});f=this.fxL[c];f.set(this.color((g.className.contains("Sel"))?d+"sel":d));g.addEvents({focus:function(k){this.blur()},click:function(k){if(k!==undefined){new Event(k).stop()}if(!g.className.contains("Sel")){amenu=(!h)?$(c).getFirst():$(c).getParent().getParent().getFirst();this.click(amenu,h,true)}}.bind(this),mouseenter:function(k){if(!g.className.contains("Sel")){f.stop();f.options.transition=Fx.Transitions.Back.easeOut;f.start(this.color(d+"hover"))}}.bind(this),mouseleave:function(k){if(!g.className.contains("Sel")||g.rel){f.stop();f.options.transition=Fx.Transitions.Cubic.easeOut;f.start(this.color(d))}}.bind(this)})}.bind(this))},setaRclass:function(b,c){var d=b.getParent().getProperty("id");this.fx[d].stop();this.fx[d].start((c.contains("Sel"))?this.color("menusel"):this.color("menu"));b.className=c},setaLclass:function(d,b){var f=d.id.substring(6);var c=(d.rel)?"titreL":"menuL";this.fxL[f].stop();this.fxL[f].start((b.contains("Sel"))?this.color(c+"sel"):this.color(c));d.className=b},hidemenu:function(b,c){b.removeClass("amenuover");this.menufx[c].stop();this.fx[c].stop();this.menufx[c].options.transition=Fx.Transitions.linear;this.menufx[c].start(this.color("backmenu"));this.fx[c].slideOut()},initialize:function(){this.allmenu=[];this.menufx=[];this.fx=[];this.fxL=[];this.menusel=$("menu").getParent().id.substring(4);$("menu").getParent().removeProperty("id");$("menu").getElements("li").each(function(c,g,d,b,f,h){g=c.getLast();d=c.getFirst();b=(g.getTag()=="ul")?true:false;if(b){d.className="new"+d.className;if(d.className.contains("Sel")){this.amenusel=d;this.mmenusel=g.id}this.allmenu[g.id]=false;this.tmp=g.id;this.menufx[g.id]=d.effects({duration:1000});f=this.menufx[g.id];f.set(this.color("backmenu"));this.fx[g.id]=this.newslide(g.id);h=this.fx[g.id];c.getLast().addClass("divmenu");h.hide();g.setStyles({visibility:"visible",position:"relative",height:g.getSize().size.y+"px"});c.addEvents({mouseenter:function(k){playsound("menu");d.addClass("amenuover");f.stop();h.stop();f.options.transition=Fx.Transitions.Expo.easeOut;f.start(this.color("backmenusel"));h.slideIn()}.bind(this),mouseleave:function(k){this.hidemenu(d,g.id)}.bind(this)})}else{if(d.className.contains("Sel")){this.aSmenusel=d}d.className="new"+d.className;this.fx[c.id]=d.effects({duration:500});h=this.fx[c.id];h.set(this.color((d==this.aSmenusel)?"menusel":"menu"));c.addEvents({mouseenter:function(k){if(d!=this.aSmenusel){h.stop();h.options.transition=Fx.Transitions.Back.easeOut;h.start(this.color("menuhover"))}}.bind(this),mouseleave:function(k){if(d!=this.aSmenusel){h.stop();h.options.transition=Fx.Transitions.Expo.easeOut;h.start(this.color("menu"))}}.bind(this)});this.allmenu[c.id]=this.tmp}d.addEvents({focus:function(k){this.blur()},click:function(k){if(k!==undefined){new Event(k).stop()}if(this.aSmenusel!=d){this.click(d,b)}}.bind(this)})}.bind(this));this.initleftmenu($("contentL"));this.HistoInit()},newslide:function(b){return(new Fx.Slide(b,{duration:700,transition:Fx.Transitions.Expo.easeOut}))},click:function(c,b,d){this.menuclick=c.href.substring((c.href.lastIndexOf("=")+1));if(this.menuclick!=this.menusel){this.samemenu=false;this.oldmenu=this.menusel;if(this.aSmenusel){this.setaRclass(this.aSmenusel,"newloadS")}if(this.menuclick!=this.mmenusel&&this.allmenu[this.menuclick]!=this.mmenusel){this.amenusel.className="newload"}if(b){if(!d){c.className="newloadSelmenu amenuover"}else{if(d=="histo"){c.className="newloadSelmenu"}}this.aSmenusel=false;this.amenusel=c;if(this.mmenusel==this.menuclick){this.samemenu=true}else{this.mmenusel=this.menuclick}}else{this.setaRclass(c,"newloadSSel");this.aSmenusel=c;am=c.getParent().getParent().getParent().getParent().getFirst();if(!d){am.className="newloadSel amenuover"}else{if(d=="histo"){am.className="newloadSel"}}if(this.mmenusel==this.allmenu[this.menuclick]){this.samemenu=true}else{this.amenusel=am;this.mmenusel=this.allmenu[this.menuclick]}}this.menusel=this.menuclick;this.ajaxload(c);(function(){this.hidemenu(this.amenusel,this.mmenusel)}.bind(this)).delay(150)}},linktomenu:function(b){if(!b){b=$("pagecontent")}b.getElements("a").each(function(c){if(/\/\?m=[a-z][a-z]+/.test(c.href)&&/ccr/i.test(c.href)){c.addEvents({focus:function(d){this.blur()},click:function(d){if(d!==undefined){new Event(d).stop()}this.linkclickmenu(c.href.substring((c.href.lastIndexOf("=")+1)))}.bind(this)})}else{c.target="_blank"}}.bind(this))},linkclickmenu:function(b){$("menu").getElements("a").each(function(c){if(c.href.substring((c.href.lastIndexOf("=")+1))==b){this.click(c,(c.getNext())?true:false,"histo")}}.bind(this))},HistoInit:function(){HistoryManager.initialize();this.history=HistoryManager.register("page",[this.menusel],function(b){if(b[0]!=this.menusel){this.linkclickmenu(b[0])}}.bind(this));HistoryManager.start()},ajaxload:function(b){this.content=new Ajax(b.href,{method:"get",onComplete:this.ajaxok.bind(this),autoCancel:true}).request();this.history.setValue(0,b.href.substring((b.href.lastIndexOf("=")+1)))},ajaxok:function(){var g=$("contentL");var b=$("content");var h=new Element("div");try{h.setHTML(this.content.response.text)}catch(k){return}var l=h.getElement(".contentL");var d=h.getElement(".content");if(!this.aSmenusel){var f=h.getElement(".loadSSel");if(f){f=f.getParent().getProperty("id");var n=$(f).getFirst();this.setaRclass(n,"newloadSSel");this.aSmenusel=n}try{this.setaLclass(g.getElement(".newloadLSel"),"newloadL")}catch(k){}try{this.setaLclass($("aleft-"+this.mmenusel),"newaleftSel")}catch(k){}try{this.setaLclass(g.getElement("#aleft-"+f),"newloadLSel")}catch(k){}}else{if(this.samemenu){g.getElements("a[class$=Sel]").each(function(o){this.setaLclass(o,(o.rel)?"newaleft":"newloadL")}.bind(this));try{n=$("aleft-"+this.menusel);this.setaLclass(n,(n.rel)?"newaleftSel":"newloadLSel")}catch(k){}}}if(this.samemenu){var c=g.getLast().getElement(".scontentL");var m=h.getElement(".scontentL");this.slidefx("top",700,Fx.Transitions.linear,c,m,"fx1","fx2","fx3","tmpdiv1",g,l,"contentLTMP");(function(){this.slidefx("top",1000,Fx.Transitions.Expo.easeOut,b,d,"f4","fx5","fx6","tmpdiv2",b,d,"contentTMP",true)}.bind(this)).delay(50)}else{this.slidefx("left",700,Fx.Transitions.linear,g,l,"fx7","fx8","fx3","tmpdiv3",g,l,"contentLTMP",false,true);(function(){this.slidefx("left",1000,Fx.Transitions.Expo.easeOut,b,d,"fx4","fx5","fx6","tmpdiv2",b,d,"contentTMP",true)}.bind(this)).delay(50)}document.title=h.getElements("title").getText()},endanim:function(){if($("contactform")){new Validate($("contactform"))}gallery.load()},menuposition:function(){for(var b in this.allmenu){if(b==this.menusel){return(false);break}if(b==this.oldmenu){return(true);break}}return("error")},slidefx:function(d,p,g,s,b,k,h,f,n,t,v,m,o,c){try{this[k].stop();this[h].stop();this[f].stop();$(n).remove()}catch(w){}s.setStyle("height",s.offsetHeight+"px");s.getFirst().setStyle("position","absolute");t=(t)?t:s;v=(v)?v:b;this[k]=s.getFirst().effect(d,{duration:p,onComplete:(function(){try{$(n).remove()}catch(x){}while(s.getFirst().getNext()){s.getFirst().remove()}if(s.className!="contentL"){s.getFirst().setStyle("position","Static");s.setStyle("height","100%")}if(o){this.endanim()}}.bind(this)),transition:g});var l=this.menuposition();this[h]=b.getFirst().effect(d,{duration:p,transition:g});this[f]=t.effect("height",{duration:p,transition:g});v.className=m;v.injectInside(document.body);var u=0;this.count=0;this.check=0;this.allimg=[];var q=b.getElements("div[id=myGallerySet]");if(q.length==0){v.getElements("img").each(function(x){this.allimg[u]=x;u++}.bind(this))}var r=this.allimg.length;clearTimeout(this.timeout);this.checkimg=(function(){for(u=this.count;u<r;u++){if(this.allimg[u].complete){this.check=0;this.count++;this.allimg[u].addEvent("contextmenu",function(x){if(x!==undefined){new Event(x).stop()}});if(this.count>=r){this.startfx();break}}else{if(this.check>20){this.startfx();break}else{this.timeout=setTimeout(this.checkimg,50);this.check++;break}}}}.bind(this));this.startfx=(function(){var x=v.offsetHeight;var C=b.getFirst();v.remove();this.linktomenu(C);if(q.length==0){c=(c)?C.getLast():C;c.addEvent("mousedown",function(D){nosel=true});b.getElements("a").each(function(D){if(D.rel.test(/^lightbox/i)){D.slimbox({},null,function(E){return(this==E)||((this.rel.length>8)&&(this.rel==E.rel))})}})}if(d=="left"){try{this.initleftmenu(b)}catch(B){}C.setStyle("position","absolute")}C.injectInside(s);s.getFirst().setProperty("id",n);var A=s.getFirst().offsetHeight;var z=s.getLast().offsetHeight;var y=(d=="left")?s.offsetWidth:((l)?A:z);this[h].set(y*((l)?1:-1));if(s.className=="scontentL"){s.setStyle("height",(z>A)?z:A)}this[k].start(y*((l)?-1:1));this[h].start(0);this[f].start(x);if(o){playsound("trans",50)}});if(r){this.checkimg()}else{this.startfx()}}});var HistoryManager={options:{observeDelay:100,stateSeparator:";",iframeSrc:"javascript&#058;false;",onStart:Class.empty,onRegister:Class.empty,onUnregister:Class.empty,onStart:Class.empty,onUpdate:Class.empty,onStateChange:Class.empty,onObserverChange:Class.empty},dataOptions:{skipDefaultMatch:true,defaults:[],regexpParams:""},initialize:function(b){if(this.modules){return this}this.setOptions(b);this.modules=$H({});this.count=history.length;this.states=[];this.states[this.count]=this.getHash();this.state=null;return this},start:function(){this.observe.periodical(this.options.observeDelay,this);this.started=true;this.observe();this.update();this.fireEvent("onStart",[this.state]);return this},register:function(k,c,h,d,f,b){if(!this.modules){this.initialize()}var g=$merge(this.dataOptions,b||{},{defaults:c,onMatch:h,onGenerate:d,regexp:f});g.regexp=g.regexp||k+"-([\\w_-]*)";if(typeof g.regexp=="string"){g.regexp=new RegExp(g.regexp,g.regexpParams)}g.onGenerate=g.onGenerate||function(l){return k+"-"+l[0]};g.values=g.defaults.copy();this.modules.set(k,g);this.fireEvent("onUnregister",[k,g]);return{setValues:function(l){return this.setValues(k,l)}.bind(this),setValue:function(m,l){return this.setValue(k,m,l)}.bind(this),generate:function(l){return this.generate(k,l)}.bind(this),unregister:function(){return this.unregister(k)}.bind(this)}},unregister:function(b){this.fireEvent("onRegister",[b]);this.modules.remove(b)},setValues:function(d,b){var c=this.modules.get(d);if(!c||c.values.isSimilar(b)){return this}c.values=b;this.update();return this},setValue:function(f,b,c){var d=this.modules.get(f);if(!d||d.values[b]==c){return this}d.values[b]=c;this.update();return this},generate:function(g,b){var d=this.modules.get(g);var c=d.values.copy();d.values=b;var f=this.generateState();d.values=c;return"#"+f},observe:function(){if(this.timeout){return}var b=this.getState();if(this.state==b){return}if((window.ie||window.webkit419)&&(this.state!==null)){this.setState(b,true)}else{this.state=b}this.modules.each(function(c,f){var d=b.match(c.regexp);if(d){d.splice(0,1);d.complement(c.defaults);if(!d.isSimilar(c.defaults)){c.values=d}}else{c.values=c.defaults.copy()}c.onMatch(c.values,c.defaults)});this.fireEvent("onStateChange",[b]).fireEvent("onObserverChange",[b])},generateState:function(){var b=[];this.modules.each(function(c,d){if(c.skipDefaultMatch&&c.values.isSimilar(c.defaults)){return}b.push(c.onGenerate(c.values))});return b.join(this.options.stateSeparator)},update:function(){if(!this.started){return this}var b=this.generateState();if((!this.state&&!b)||(this.state==b)){return this}this.setState(b);this.fireEvent("onStateChange",[b]).fireEvent("onUpdate",[b]);return this},observeTimeout:function(){if(this.timeout){this.timeout=$clear(this.timeout)}else{this.timeout=this.observeTimeout.delay(200,this)}},getHash:function(){var b=top.location.href;var c=b.indexOf("#")+1;return(c)?b.substr(c):""},getState:function(){var d=this.getHash();if(this.iframe){var c=this.iframe.contentWindow.document;if(c&&c.body.id=="state"){var b=c.body.innerText;if(this.state==d){return b}this.istateOld=true}else{return this.istate}}if(window.webkit419&&history.length!=this.count){this.count=history.length;return $pick(this.states[this.count-1],d)}return d},setState:function(f,b){f=$pick(f,"");if(window.webkit419){if(!this.form){this.form=new Element("form",{method:"get"}).injectInside(document.body)}this.count=history.length;this.states[this.count]=f;this.observeTimeout();this.form.setProperty("action","#"+f).submit()}else{top.location.hash=f||"#"}if(window.ie&&(!b||this.istateOld)){if(!this.iframe){this.iframe=new Element("iframe",{src:this.options.iframeSrc,styles:"visibility: hidden;"}).injectInside(document.body);this.istate=this.state}try{var c=this.iframe.contentWindow.document;c.open();c.write('<html><body id="state">'+f+"</body></html>");c.close();this.istateOld=false}catch(d){}}this.state=f},extend:$extend};HistoryManager.extend(Events.prototype);HistoryManager.extend(Options.prototype);Array.extend({isSimilar:function(b){return(this.toString()==b.toString())},complement:function(c){for(var d=0,b=this.length;d<b;d++){this[d]=$pick(this[d],c[d]||null)}return this}});function SendMail(b){if(confirm("Etes-vous certain de vouloir envoyer ce message ?")){b.methode.value="AJAX";b.send({onComplete:mailok});b.reset();b.getElements(".required").each(function(d,c){d.removeClass("valid");if(d.error!==undefined){d.error.remove();d.error=undefined}});return(true)}else{return(false)}}function mailok(b){if(b=="MAILOK"){messagebox("Votre mesage a bien \351t\351 envoy\351")}else{messagebox("Erreur lors de l'envoi du message !",true)}}var Validate=new Class({getOptions:function(){return{validateOnBlur:true,validateOnKeyUp:false,errorClass:"error",errorMsgClass:"errorMessage",okMsgClass:"validMessage",okClass:"valid",dateFormat:"dd/MM/yy",onFail:Class.empty,onSuccess:SendMail,showErrorsInline:true,showValidInline:true,label:"Merci de patienter..."}},initialize:function(c,b){this.setOptions(this.getOptions(),b);try{this.form=c;this.elements=this.form.getElements(".required");this.imgvalide=new Element("img",{src:"img/valide.gif",alt:""});this.imgvalide.setStyle("border",0);this.list=[];this.elements.each(function(g,f){if(this.options.validateOnBlur){g.addEvent("blur",function(h){this.validate(g)}.bind(this))}if(this.options.validateOnKeyUp){g.addEvent("keyup",function(h){this.validate(g,true)}.bind(this))}}.bind(this));this.form.addEvent("submit",function(h){var f=new Event(h);var g=true;this.elements.each(function(l,k){if(!this.validate(l)){f.stop();g=false;this.list.include(l)}else{this.list.remove(l)}}.bind(this));if(g){if(this.options.onSuccess){f.stop();this.options.onSuccess(this.form)}else{this.form.getElement("input[type=submit]").setProperty("value",this.options.label)}}else{this.options.onFail(this.getList())}}.bind(this))}catch(d){}},getList:function(){var b=new Element("ul");this.list.each(function(f,d){if(f.title!==""){var c=new Element("li").injectInside(b);new Element("label").setProperty("for",f.id).setText(f.title).injectInside(c)}});return b},validate:function(c,h){var b=true;this.clearMsg(c);switch(c.type){case"text":case"textarea":case"select-one":if(c.value!==""){if(c.hasClass("email")){var f=/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/;if(c.value.toUpperCase().match(f)){b=true}else{b=false}this.setMsg(c,"Cet email n'est pas valide",b,h)}else{if(c.hasClass("number")){var n=/[-+]?[0-9]*\.?[0-9]+/;if(c.value.match(n)){b=true}else{b=false}this.setMsg(c,"Ce nombre n'est pas valide",b,h)}else{if(c.hasClass("postcode")){var g=/^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) [0-9][A-Za-z]{2})$/;if(c.value.match(g)){b=true}else{b=false}this.setMsg(c,"Please enter a valid postcode",b,h)}else{if(c.hasClass("date")){var k=Date.parseExact(c.value,this.options.dateFormat);if(k!==null){b=true}else{b=false}this.setMsg(c,"Date invalide, le format doit être: "+this.options.dateFormat.toLowerCase(),b,h)}else{b=true;this.setMsg(c,undefined,b,h)}}}}}else{b=false;this.setMsg(c,undefined,b,h)}break;case"checkbox":if(!c.checked){b=false}else{b=true}this.setMsg(c,undefined,b,h);break;case"radio":var l=$A(this.form[c.name]);var m=false;l.each(function(o,d){if(o.checked){m=true}});if(!m){b=false}else{b=true;this.clearMsg(l.getLast())}this.setMsg(l.getLast(),"Choisissez une option",b,h);break}return b},setMsg:function(c,f,d,b){if(f===undefined){f=c.title}if(this.options.showErrorsInline||this.options.showValidInline){if(c.error===undefined){c.error=new Element("span").addClass(this.options.errorMsgClass).injectAfter(c)}if(this.options.showValidInline&&d===true){this.imgvalide.clone().injectInside(c.error)}else{if(this.options.showErrorsInline&&!b){c.error.setText(f)}}if(d===true||!b){c.addClass((d===true)?this.options.okClass:this.options.errorClass);c.error.className=(d===true)?this.options.okMsgClass:this.options.errorMsgClass}}},clearMsg:function(b){b.removeClass(this.options.errorClass);b.removeClass(this.options.okClass);if(b.error!==undefined){b.error.remove();b.error=undefined}}});Validate.implement(new Options);Validate.implement(new Events);var Slimbox=(function(){var V=window,ag,aw,U=-1,al,ae,W,af,ac,O,ai,ar=ak.bindWithEvent(),ay=window.opera&&(navigator.appVersion>="9.3"),an=document.documentElement,ao={},ah=new Image(),Q=new Image(),S,aC,av,R,az,T,aB,aa,P,ad,au,aA,Y;V.addEvent("domready",function(){$(document.body).adopt($$(S=new Element("div",{id:"lbOverlay"}),aC=new Element("div",{id:"lbCenter"}),T=new Element("div",{id:"lbBottomContainer"})).setStyle("display","none"));av=new Element("div",{id:"lbImage"}).injectInside(aC).adopt(R=new Element("a",{id:"lbPrevLink",href:"#"}),az=new Element("a",{id:"lbNextLink",href:"#"}));av.addEvent("contextmenu",function(c){if(c!==undefined){new Event(c).stop()}});R.onclick=Z;az.onclick=ax;var b;aB=new Element("div",{id:"lbBottom"}).injectInside(T).adopt(b=new Element("a",{id:"lbCloseLink",href:"#"}),aa=new Element("div",{id:"lbCaption"}),P=new Element("div",{id:"lbNumber"}),new Element("div",{styles:{clear:"both"}}));b.onclick=S.onclick=X});function ab(){var b=V.getScrollLeft(),c=ay?an.clientWidth:V.getWidth();$$(aC,T).setStyle("left",b+(c/2));if(af){S.setStyles({left:b,top:V.getScrollTop(),width:c,height:V.getHeight()})}}function ap(c){["object",V.ie6?"select":"embed"].forEach(function(d){$each(document.getElementsByTagName(d),function(f){if(c){f._slimbox=f.style.visibility}f.style.visibility=c?"hidden":f._slimbox})});S.style.display=c?"":"none";var b=c?"addEvent":"removeEvent";V[b]("scroll",ab)[b]("resize",ab);document[b]("keydown",ar)}function ak(b){var c=b.code;if(ag.closeKeys.contains(c)){X()}else{if(ag.nextKeys.contains(c)){ax()}else{if(ag.previousKeys.contains(c)){Z()}}}b.stop()}function Z(){return aD(ae)}function ax(){return aD(W)}function aD(b){if(b>=0){U=b;al=aw[b][0];ae=(U||(ag.loop?aw.length:0))-1;W=((U+1)%aw.length)||(ag.loop?0:-1);aj();aC.className="lbLoading";ao=new Image();ao.onload=aq;ao.src=al}return false}function aq(){aC.className="";aA.set(0);av.setStyles({width:ao.width,backgroundImage:"url("+al+")",display:""});$$(av,R,az).setStyle("height",ao.height);aa.setHTML(aw[U][1]||"");P.setHTML((((aw.length>1)&&ag.counterText)||"").replace(/{x}/,U+1).replace(/{y}/,aw.length));if(ae>=0){ah.src=aw[ae][0]}if(W>=0){Q.src=aw[W][0]}O=av.offsetWidth;ai=av.offsetHeight;var b=Math.max(0,ac-(ai/2));if(aC.offsetHeight!=ai){au.chain(au.start.pass({height:ai,top:b},au))}if(aC.offsetWidth!=O){au.chain(au.start.pass({width:O,marginLeft:-O/2},au))}au.chain(function(){T.setStyles({width:O,top:b+ai,marginLeft:-O/2,visibility:"hidden",display:""});aA.start(1)});au.callChain()}function at(){if(ae>=0){R.style.display=""}if(W>=0){az.style.display=""}Y.set(-aB.offsetHeight).start(0);T.style.visibility=""}function aj(){ao.onload=Class.empty;ao.src=ah.src=Q.src=al;au.clearChain();au.stop();aA.stop();Y.stop();$$(R,az,av,T).setStyle("display","none")}function X(){if(U>=0){aj();U=ae=W=-1;aC.style.display="none";ad.stop().chain(ap).start(0)}return false}Element.extend({slimbox:function(c,b){$$(this).slimbox(c,b);return this}});Elements.extend({slimbox:function(f,b,c){b=b||function(g){return[g.href,g.title]};c=c||function(){return true};var d=this;d.forEach(function(g){g.removeEvents("click").addEvent("click",function(k){var h=d.filter(c,this);Slimbox.open(h.map(b),h.indexOf(this),f);k.stop()}.bindWithEvent(g))});return d}});return{open:function(b,c,d){ag=$extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},d||{});ad=S.effect("opacity",{duration:ag.overlayFadeDuration});au=aC.effects($extend({duration:ag.resizeDuration},ag.resizeTransition?{transition:ag.resizeTransition}:{}));aA=av.effect("opacity",{duration:ag.imageFadeDuration,onComplete:at});Y=aB.effect("margin-top",{duration:ag.captionAnimationDuration});if(typeof b=="string"){b=[[b,c]];c=0}ac=V.getScrollTop()+((ay?an.clientHeight:V.getHeight())/2);O=ag.initialWidth;ai=ag.initialHeight;aC.setStyles({top:Math.max(0,ac-(ai/2)),width:O,height:ai,marginLeft:-O/2,display:""});af=V.ie6||(S.currentStyle&&(S.currentStyle.position!="fixed"));if(af){S.style.position="absolute"}ad.set(0).start(ag.overlayOpacity);ab();ap(1);aw=b;ag.loop=ag.loop&&(aw.length>1);return aD(c)}}})();Slimbox.load=function(){$$($$(document.links).filter(function(b){return b.rel&&b.rel.test(/^lightbox/i)})).slimbox({},null,function(b){return(this==b)||((this.rel.length>8)&&(this.rel==b.rel))})};window.addEvent("domready",InitPage);