MooTools.More={version:"1.2.4.2dev",build:"%build%"};Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c;},set:function(b){for(var c in b){var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;},start:function(c){if(!this.check(c)){return this;}var h={},j={};for(var d in c){var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from;g[b]=e.to;}}return this.parent(h,j);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Object.type,element:$defined});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=$type(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this;},start:function(c){if(c.rightClick){return;}if(this.options.preventDefault){c.preventDefault();}this.mouse.start=c.page;this.fireEvent("beforeStart",this.element);var a=this.options.limit;this.limit={x:[],y:[]};for(var d in this.options.modifiers){if(!this.options.modifiers[d]){continue;}if(this.options.style){this.value.now[d]=this.element.getStyle(this.options.modifiers[d]).toInt();}else{this.value.now[d]=this.element[this.options.modifiers[d]];}if(this.options.invert){this.value.now[d]*=-1;}this.mouse.pos[d]=c.page[d]-this.value.now[d];if(a&&a[d]){for(var b=2;b--;b){if($chk(a[d][b])){this.limit[d][b]=$lambda(a[d][b])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(a){if(this.options.preventDefault){a.preventDefault();}var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element);}},drag:function(a){if(this.options.preventDefault){a.preventDefault();}this.mouse.now=a.page;for(var b in this.options.modifiers){if(!this.options.modifiers[b]){continue;}this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.options.invert){this.value.now[b]*=-1;}if(this.options.limit&&this.limit[b]){if($chk(this.limit[b][1])&&(this.value.now[b]>this.limit[b][1])){this.value.now[b]=this.limit[b][1];}else{if($chk(this.limit[b][0])&&(this.value.now[b]<this.limit[b][0])){this.value.now[b]=this.limit[b][0];}}}if(this.options.grid[b]){this.value.now[b]-=((this.value.now[b]-(this.limit[b][0]||0))%this.options.grid[b]);}if(this.options.style){this.element.setStyle(this.options.modifiers[b],this.value.now[b]+this.options.unit);}else{this.element[this.options.modifiers[b]]=this.value.now[b];}}this.fireEvent("drag",[this.element,a]);},cancel:function(a){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(a){this.fireEvent("complete",[this.element,a]);}}});Element.implement({makeResizable:function(a){var b=new Drag(this,$merge({modifiers:{x:"width",y:"height"}},a));this.store("resizer",b);return b.addEvent("drag",function(){this.fireEvent("resize",b);}.bind(this));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(b,a){this.parent(b,a);b=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=document.id(this.container.getDocument().body);}var c=b.getStyles("left","right","position");if(c.left=="auto"||c.top=="auto"){b.setPosition(b.getPosition(b.getOffsetParent()));}if(c.position=="static"){b.setStyle("position","absolute");}this.addEvent("start",this.checkDroppables,true);this.overed=null;},start:function(a){if(this.container){this.options.limit=this.calculateLimit();}if(this.options.precalculate){this.positions=this.droppables.map(function(b){return b.getCoordinates();});}this.parent(a);},calculateLimit:function(){var d=this.element.getOffsetParent(),g=this.container.getCoordinates(d),f={},c={},b={},i={},k={};["top","right","bottom","left"].each(function(o){f[o]=this.container.getStyle("border-"+o).toInt();b[o]=this.element.getStyle("border-"+o).toInt();c[o]=this.element.getStyle("margin-"+o).toInt();i[o]=this.container.getStyle("margin-"+o).toInt();k[o]=d.getStyle("padding-"+o).toInt();},this);var e=this.element.offsetWidth+c.left+c.right,n=this.element.offsetHeight+c.top+c.bottom,h=0,j=0,m=g.right-f.right-e,a=g.bottom-f.bottom-n;if(this.options.includeMargins){h+=c.left;j+=c.top;}else{m+=c.right;a+=c.bottom;}if(this.element.getStyle("position")=="relative"){var l=this.element.getCoordinates(d);l.left-=this.element.getStyle("left").toInt();l.top-=this.element.getStyle("top").toInt();h+=f.left-l.left;j+=f.top-l.top;m+=c.left-l.left;a+=c.top-l.top;if(this.container!=d){h+=i.left+k.left;j+=(Browser.Engine.trident4?0:i.top)+k.top;}}else{h-=c.left;j-=c.top;if(this.container==d){m-=f.left;a-=f.top;}else{h+=g.left+f.left;j+=g.top+f.top;}}return{x:[h,m],y:[j,a]};},checkAgainst:function(c,b){c=(this.positions)?this.positions[b]:c.getCoordinates();var a=this.mouse.now;return(a.x>c.left&&a.x<c.right&&a.y<c.bottom&&a.y>c.top);},checkDroppables:function(){var a=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(a){this.fireEvent("enter",[this.element,a]);}this.overed=a;}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables();}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a);}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a);this.store("dragger",b);return b;}});var Asset={javascript:function(f,d){d=$extend({onload:$empty,document:document,check:$lambda(true)},d);var b=new Element("script",{src:f,type:"text/javascript"});var e=d.onload.bind(b),a=d.check,g=d.document;delete d.onload;delete d.check;delete d.document;b.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e();}}}).set(d);if(Browser.Engine.webkit419){var c=(function(){if(!$try(a)){return;}$clear(c);e();}).periodical(50);}return b.inject(g.head);},css:function(b,a){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:b},a)).inject(document.head);},image:function(c,b){b=$merge({onload:$empty,onabort:$empty,onerror:$empty},b);var d=new Image();var a=document.id(d)||new Element("img");["load","abort","error"].each(function(e){var f="on"+e;var g=b[f];delete b[f];d[f]=function(){if(!d){return;}if(!a.parentNode){a.width=d.width;a.height=d.height;}d=d.onload=d.onabort=d.onerror=null;g.delay(1,a,a);a.fireEvent(e,a,1);};});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1);}return a.set(b);},images:function(d,c){c=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},c);d=$splat(d);var a=[];var b=0;return new Elements(d.map(function(e){return Asset.image(e,$extend(c.properties,{onload:function(){c.onProgress.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete();}},onerror:function(){c.onError.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete();}}}));}));}};;function linkFade(lfDiv){$$(lfDiv).each(function(div){var mouseFxs=new Fx.Tween(div,{duration:300,wait:false});div.set('opacity',1);div.addEvents({'mouseover':function(){mouseFxs.start('opacity',[1,0.6]);},'mouseout':function(){mouseFxs.start('opacity',[0.6,1]);}});});}
function linkFadeMenu(lfDiv,color_start,color_end){$$(lfDiv).each(function(div){var mouseFxs=new Fx.Tween(div,{duration:300,wait:false});div.addEvents({'mouseover':function(){mouseFxs.start('color',[color_start,color_end]);},'mouseout':function(){mouseFxs.start('color',[color_end,color_start]);}});});}
function linkFadeSubMenu(lfDiv,color_start,color_end){$$(lfDiv).each(function(div){var mouseFxs=new Fx.Tween(div,{duration:300,wait:false});div.addEvents({'mouseover':function(){mouseFxs.start('color',[color_start,color_end]);mouseFxs.start('background-color',['#EEE','#DDD']);},'mouseout':function(){mouseFxs.start('color',[color_end,color_start]);mouseFxs.start('background-color',['#DDD','#EEE']);}});});}
function customCheck(el){if(!el.value.test(/^[A-Za-z0-9.?!,;:()]+$/)){el.errors.push("Il y a un problème dans votre message (n\'utilisez pas de tags html).");return false;}else{return true;}}
var Agent=navigator.userAgent.toLowerCase();var Opera=(Agent.indexOf("opera")!=-1);var Msie=(Agent.indexOf("msie")!=-1)&&document.all&&!Opera;var Safari=(Agent.indexOf("safari")!=-1);function addEventListenerBk(el,ev,fn){try{el.addEventListener(ev,fn,false);}catch(e){try{el.detachEvent('on'+ev,fn);el.attachEvent('on'+ev,fn);}catch(e){el['on'+ev]=fn;}}}
function removeEventListenerBk(el,ev,fn){try{el.removeEventListener(ev,fn,false);}catch(e){try{el.detachEvent('on'+ev,fn);}catch(e){el['on'+ev]=null;}}}
var ShortKeys=function(e){if(!e)e=window.event;if(!e.target)e.target=e.srcElement;if(e.target.form)return true;url='';switch(e.keyCode){case 39:case 13:url=SKUrl[0];break;case 37:url=SKUrl[1];break;case 40:url=SKUrl[2];break;case 38:url=SKUrl[3];break;}
if(url){removeEventListenerBk(document,Opera?'keypress':'keydown',ShortKeys);if(url.substring(0,1)=='/')window.location.pathname=url;else window.location.href=url;if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false;}}
window.addEvent('domready',function(){linkFadeMenu('#menu .inactive a','#666','#000');linkFade('.thumbs a img');});;var Milkbox=new Class({Implements:[Options,Events],options:{overlayOpacity:0.8,topPosition:20,initialWidth:250,initialHeight:250,canvasBorderWidth:"0px",canvasBorderColor:"#000000",canvasPadding:"0px",resizeDuration:0,resizeTransition:"linear",autoPlay:false,autoPlayDelay:5,removeTitle:true,autoSize:true,maxHeight:0,imageOfText:"of",onXmlGalleries:$empty,onClosed:$empty,onFileReady:$empty},initialize:function(a){this.setOptions(a);this.autoPlayBkup={autoPlayDelay:this.options.autoPlayDelay,autoPlay:this.options.autoPlay};this.fullOptionsBkup={};this.galleries=[];this.families=[];this.xmlFiles=[];this.loadedImages=[];this.currentFile=null;this.currentIndex=null;this.currentGallery=null;this.currentRequest=null;this.currentResponse=null;this.mode=null;this.closed=true;this.busy=true;this.paused=true;this.fileReady=false;this.eventsok=false;this.first=true;this.activated=false;this.intObj=null;this.formtags=null;this.prepareGalleries();if(this.options.overlayOpacity==0){this.options.overlayOpacity=0.0001}this.saveOptions();if(this.galleries.length==0){return}this.initMilkbox(true)},initMilkbox:function(a){if(a){this.formtags=$$("select","textarea")}this.prepareHTML();this.prepareEffects();this.prepareEvents();this.activated=true},openMilkbox:function(b,d){this.closed=false;if(this.formtags&&this.formtags.length!=0){this.formtags.setStyle("display","none")}this.overlay.setStyles({top:-$(window).getScroll().y,height:$(window).getScrollSize().y+$(window).getScroll().y});this.center.setStyle("top",$(window).getScroll().y+this.options.topPosition);this.currentGallery=b;this.currentIndex=d;this.overlay.tween("opacity",this.options.overlayOpacity);if(b.length==1){this.mode="singleFile";this.loadFile(b[d],d)}else{this.mode="fileGallery";var a=0;$$(this.prev,this.next,this.count).setStyle("display","block");if(this.options.autoPlay){this.playpause.setStyle("display","block");a=this.playpause.getSize().x}var c=this.center.getStyle("border-right-width").toInt();var h=this.prev.getSize().x+this.next.getSize().x+this.close.getSize().x+a+c;this.navigation.setStyle("width",h);this.description.setStyle("margin-right",h);var f=(d!=b.length-1)?b[d+1]:b[0];var g=(d!=0)?b[d-1]:b[b.length-1];var e=(g==f)?[g]:[g,f];this.loadFile(b[d],e)}},loadFile:function(c,b){this.fileReady=false;var a=this.checkFileType(c,"swf");if(!a){if(!this.loadedImages.contains(c.retrieve("href"))){this.center.addClass("mbLoading")}this.loadImage(c.retrieve("href"))}else{this.loadSwf(c)}if(b){this.preloadFiles(b)}},preloadFiles:function(a){a.each(function(d,b){var c=this.checkFileType(d.retrieve("href"),"swf");if(!c){this.preloadImage(d.retrieve("href"))}},this)},loadImage:function(b){var a=new Asset.image(b,{onload:function(c){if(!this.loadedImages.contains(b)){this.loadedImages.push(b)}this.currentFile=c;this.loadAux(this.currentFile)}.bindWithEvent(this)})},preloadImage:function(b){if(!this.loadedImages.contains(b)){var a=new Asset.image(b,{onload:function(c){this.loadedImages.push(b)}.bindWithEvent(this)})}},loadSwf:function(b){var a=new Swiff(b.retrieve("href"),{width:b.retrieve("width").toInt(),height:b.retrieve("height").toInt(),params:{wMode:"opaque",swLiveConnect:"false"}});this.currentFile=a;this.loadAux(b)},loadAux:function(a){this.fileReady=true;this.fireEvent("fileReady");$$(this.description,this.navigation).setStyle("visibility","hidden");this.navigation.setStyle("height","");$$(this.next,this.prev,this.close).setStyle("backgroundPosition","0 0");this.showFile(a)},showFile:function(c){if(this.closed){return}var f=new Hash();var k=new Hash();var g,l;var e,j,i,a,h;g=l={};e=j=i=a=h=0;if(this.options.canvasBorderWidth.toInt()!=0&&this.canvas.getStyle("borderWidth").toInt()==0){i=this.options.canvasBorderWidth+" solid "+this.options.canvasBorderColor;this.canvas.setStyle("border",i)}if(this.options.canvasPadding.toInt()!=0&&this.canvas.getStyle("padding").toInt()==0){a=this.options.canvasPadding;this.canvas.setStyle("padding",a)}l=this.canvas.getSize();e=this.canvas.getStyle("borderWidth").toInt()*2+this.canvas.getStyle("padding").toInt()*2;this.canvas.setStyles({opacity:0,width:"",height:""});if(!c.retrieve("width")){f=f.extend(c.getProperties("width","height")).map(function(b){return b.toInt()});if(this.options.autoSize){f=this.computeSize(f);c.setProperties({width:f.width,height:f.height})}}else{f.extend({height:c.retrieve("height").toInt(),width:c.retrieve("width").toInt()})}k=k.extend(this.center.getStyles("width","height")).map(function(b){return b.toInt()});if(f.width!=k.width){g.width=f.width+e;g.marginLeft=-(g.width/2).round()}j=(l.y-e>0)?k.height-l.y:0;g.height=f.height+e+j;this.canvas.setStyles({width:f.width,height:f.height});this.center.removeClass("mbLoading");if(this.first){h=500;this.first=false}(function(){this.center.morph(g)}).delay(h,this)},computeSize:function(g){var d=g;var b=window.getSize();var f={width:b.x-60,height:b.y-68-this.options.topPosition*2};var e;var c;var a=Math.max(f.height,f.width);if(a==f.width){e=a/d.width;c="height"}else{e=a/d.height;c="width"}e=(e<=1)?e:1;d=d.map(function(h){return Math.floor(h*e)});e=(f[c]/d[c]<=1)?f[c]/d[c]:1;d=d.map(function(h){return Math.floor(h*e)});if(this.options.maxHeight>0){e=(this.options.maxHeight/d.height<1)?this.options.maxHeight/d.height:1;d=d.map(function(h){return Math.floor(h*e)})}return d},showGallery:function(a){if(!a||!a.gallery){return}var c=($chk(a.index))?a.index:0;var b=this.getGallery(a.gallery);var f=false;var e;if(a.autoplay||(b.options&&b.options.autoplay)){f=true}if(b!=-1&&!this.opened){if(f){e=(a&&a.delay)?a.delay:(b.options&&b.options.delay)?b.options.delay:this.autoPlayDelay;this.startAutoPlay({gallery:b,index:c,delay:e})}else{this.openMilkbox(b,c)}}},addGalleries:function(a){this.currentRequest=new Request({method:"get",autoCancel:true,url:a,onRequest:function(){}.bindWithEvent(this),onSuccess:function(d,b){var c=d.replace(/(<a.+)\/>/gi,"$1></a>");this.setGalleries(new Element("div",{html:c}),a)}.bindWithEvent(this),onFailure:function(b){alert("Milkbox :: addGalleries: XML file path error or local Ajax test: please test addGalleries() on-line")}});this.currentRequest.send()},setGalleries:function(d,f){if(!this.xmlFiles.contains(f)){this.xmlFiles.push(f)}var g=d;var b=g.getElements(".gallery");var e=[];var a=[];b.each(function(h,j){var m={gallery:h.getProperty("name"),autoplay:Boolean(h.getProperty("autoplay")),delay:Number(h.getProperty("delay"))};var c=h.getChildren("a");var k=c.map(function(i){return i.setProperty("rel","milkbox["+m.gallery+"]")});e.push(k);if(m.autoplay){a.push(m)}});this.prepareGalleries(e.flatten());this.setAutoPlay(a);if(!this.activated){this.initMilkbox()}this.fireEvent("xmlGalleries")},checkFileType:function(b,c){var a=null;if($type(b)!="string"){a=b.retrieve("href")}else{a=b}var d=new RegExp(".("+c+")$","i");return a.split("?")[0].test(d)},getGallery:function(a){var d=null;if(a.test(/^milkbox/i)){d=this.families}else{d=this.families.map(function(g){var h=g.trim();var e=h.slice(0,h.length).substr(8);var f=e.replace(/(.+)]$/,"$1");return f})}var b=d.indexOf(a);var c=(b!=-1)?this.galleries[b]:b;return c},setFileProps:function(c,a){var b=a.split(",");b.each(function(f,e){var d=f.trim().split(":");c.store(d[0].trim(),d[1].trim())},this)},changeOptions:function(a){if(!a){return}this.setOptions(a);this.center.get("morph").setOptions({transition:this.options.resizeTransition,duration:this.options.resizeDuration})},saveOptions:function(a){if($chk(a)){this.fullOptionsBkup=a}else{this.fullOptionsBkup=this.options}},restoreOptions:function(){this.setOptions(this.fullOptionsBkup);var a=this.options.canvasBorderWidth+" solid "+this.options.canvasBorderColor;this.canvas.setStyles({border:a,padding:this.options.canvasPadding});this.center.get("morph").setOptions({transition:this.options.resizeTransition,duration:this.options.resizeDuration})},reloadGalleries:function(){this.galleries=[];this.families=[];this.formtags=$$("select","textarea");if(!this.activated){this.initMilkbox(false)}this.prepareGalleries();this.removeGalleriesEvents();this.setGalleriesEvents();if(this.xmlFiles.length==0){return}this.xmlFiles.each(function(b,a){this.addGalleries(b)}.bind(this))},setAutoPlay:function(b){var a=($type(b)=="object")?[b]:b;a.each(function(f){var e=this.getGallery(f.gallery);if(e==-1){return}var c=(f.autoplay==true)?f.autoplay:false;var h=($chk(f.delay)&&c)?f.delay:this.options.autoPlayDelay;e.options={autoplay:c,delay:h}},this)},startAutoPlay:function(b){var c=-1;var a,e;if(b&&b.gallery){if($type(b.gallery)=="array"){c=b.gallery}else{if($type(b.gallery)=="string"){c=this.getGallery(b.gallery)}}}if(c==-1){c=this.galleries[0]}e=(b&&b.delay&&($type(b.delay)=="number"))?b.delay*1000:(c.options&&c.options.delay)?c.options.delay*1000:this.options.autoPlayDelay*1000;a=(b&&b.index&&($type(b.index)=="number"))?b.index:0;if(e<this.options.resizeDuration*2){e=this.options.resizeDuration*2}this.options.autoPlayDelay=e/1000;if(!this.options.autoPlay){this.setOptions({autoPlay:true,autoPlayDelay:this.options.autoPlayDelay})}if(this.closed){this.openMilkbox(c,a);if(this.mode!="fileGallery"){return}this.addEvent("fileReady",function(){this.intObj=this.next_prev_aux.periodical(e,this,[null,"next"]);this.removeEvents("fileReady")}.bindWithEvent(this))}else{if(!this.closed){this.next_prev_aux(null,"next")}this.intObj=this.next_prev_aux.periodical(e,this,[null,"next"])}this.paused=false},stopAutoPlay:function(){if(this.intObj){$clear(this.intObj);this.intObj=null}this.playpause.setStyle("backgroundPosition","0 -44px");this.paused=true},removeGalleriesEvents:function(){this.galleries.each(function(a){$$(a).removeEvents("click")},this)},setGalleriesEvents:function(){this.galleries.each(function(a){$$(a).addEvent("click",function(d){var b=($(d.target).match("a"))?$(d.target):$(d.target).getParent("a");d.preventDefault();var c=this.getGallery(b.rel);if(c.options&&c.options.autoplay){this.setOptions({autoPlay:c.options.autoplay,autoPlayDelay:c.options.delay})}if(this.options.autoPlay){this.startAutoPlay({gallery:a,index:a.indexOf(b)})}else{this.openMilkbox(a,a.indexOf(b))}}.bindWithEvent(this))},this)},prepareEvents:function(a){this.setGalleriesEvents();this.next.addEvent("click",this.next_prev_aux.bindWithEvent(this,"next"));this.prev.addEvent("click",this.next_prev_aux.bindWithEvent(this,"prev"));$$(this.next,this.prev,this.close).addEvents({mouseover:function(){this.setStyle("backgroundPosition","0 -22px")},mouseout:function(){this.setStyle("backgroundPosition","0 0")}});$(window.document).addEvent("keydown",function(b){if(this.mode!="fileGallery"||this.busy==true){return}if(b.key=="right"||b.key=="space"){this.next_prev_aux(b,"next")}else{if(b.key=="left"){this.next_prev_aux(b,"prev")}else{if(b.key=="esc"){this.closeMilkbox()}}}}.bindWithEvent(this));this.playpause.addEvents({mouseover:function(b){if(this.paused==false){this.playpause.setStyle("backgroundPosition","0 -22px")}else{this.playpause.setStyle("backgroundPosition","0 -66px")}}.bindWithEvent(this),mouseout:function(){if(this.paused==false){this.playpause.setStyle("backgroundPosition","0 0")}else{this.playpause.setStyle("backgroundPosition","0 -44px")}}.bindWithEvent(this),click:function(){if(this.paused==false){this.stopAutoPlay();this.paused=true;this.playpause.setStyle("backgroundPosition","0 -66px")}else{var b=(this.currentGallery.options&&this.currentGallery.options.delay)?this.currentGallery.options.delay:this.options.autoPlayDelay;this.startAutoPlay({gallery:this.currentGallery,index:this.currentIndex+1,delay:b});this.paused=false;this.playpause.setStyle("backgroundPosition","0 0")}}.bindWithEvent(this)});this.overlay.get("tween").addEvent("onComplete",function(){if(this.overlay.getStyle("opacity")==this.options.overlayOpacity){this.center.tween("opacity",1)}else{if(this.overlay.getStyle("opacity")==0){this.overlay.setStyles({height:0,top:""})}}}.bindWithEvent(this));this.center.get("morph").addEvent("onComplete",function(){if($type(this.currentFile)=="element"){this.canvas.grab(this.currentFile)}else{(function(){this.canvas.grab(this.currentFile)}).delay(500,this)}this.canvas.tween("opacity",1);var e=(!(this.mode=="showThisImage"))?this.currentGallery[this.currentIndex].retrieve("title"):this.specialDescription;if($chk(e)){this.description.innerHTML=e}if(this.mode=="fileGallery"){this.count.appendText((this.currentIndex+1)+" "+this.options.imageOfText+" "+this.currentGallery.length)}var b=this.center.getStyle("height").toInt();this.navigation.setStyle("height",this.bottom.getStyle("height").toInt());var f=this.bottom.getSize().y;var c=(b>this.canvas.getSize().y)?(this.bottom.getSize().y+this.canvas.getSize().y)-b:f;this.bottom.setStyle("display","none");this.center.retrieve("setFinalHeight").start(b,b+c)}.bindWithEvent(this));this.center.retrieve("setFinalHeight").addEvent("onComplete",function(){this.bottom.setStyles({visibility:"visible",display:"block"});$$(this.description,this.navigation).setStyle("visibility","visible");var b=$(window).getScrollSize().y;var c=$(window).getScroll().y;this.overlay.setStyles({height:b+c,top:-c});this.busy=false}.bindWithEvent(this));window.addEvent("resize",function(){if(this.overlay.getStyle("opacity")==0){return}var b=$(window).getScrollSize().y;var c=$(window).getScroll().y;this.overlay.setStyles({height:b+c,top:-c})}.bindWithEvent(this));$$(this.overlay,this.close).addEvent("click",this.closeMilkbox.bindWithEvent(this));this.eventsok=true},next_prev_aux:function(d,c){if(d){d.preventDefault();this.stopAutoPlay()}else{if(this.busy||!this.fileReady){return}}this.busy=true;var a,b;if(c=="next"){a=(this.currentIndex!=this.currentGallery.length-1)?this.currentIndex+=1:this.currentIndex=0;b=(this.currentIndex!=this.currentGallery.length-1)?this.currentIndex+1:0}else{a=(this.currentIndex!=0)?this.currentIndex-=1:this.currentIndex=this.currentGallery.length-1;b=(this.currentIndex!=0)?this.currentIndex-1:this.currentGallery.length-1}this.canvas.empty();this.description.empty();this.count.empty();this.loadFile(this.currentGallery[a],[this.currentGallery[b]])},prepareEffects:function(){this.overlay.set("tween",{duration:"short",link:"cancel"});this.center.set("tween",{duration:"short",link:"chain"});this.center.set("morph",{duration:this.options.resizeDuration,link:"chain",transition:this.options.resizeTransition});this.center.store("setFinalHeight",new Fx.Tween(this.center,{property:"height",duration:"short"}));this.canvas.set("tween",{link:"chain"})},prepareGalleries:function(a){var c=[];var b=(a)?a:$$("a");b.each(function(d){if(d.rel&&d.rel.test(/^milkbox/i)&&d.href.split("?")[0].test(/\.(gif|jpg|jpeg|png|swf)$/i)){if(d.rel.length>7&&!this.families.contains(d.rel)){this.families.push(d.rel)}c.push(d)}},this);c.each(function(d){$(d).store("href",d.href);$(d).store("rel",d.rel);$(d).store("title",d.title);if(this.checkFileType(d.href,"swf")){this.setFileProps($(d),d.rev)}if(this.options.removeTitle){$(d).removeProperty("title")}if(d.rel.length>7){this.families.each(function(j,h){if(d.rel==j){var e=false;var g;this.galleries.each(function(i,f){if(i[0].rel==j){e=true;g=f;return}});if(e==true){this.galleries[g].push($(d))}else{this.galleries.push([$(d)])}}},this)}else{this.galleries.push([$(d)])}},this)},prepareHTML:function(){this.overlay=new Element("div",{id:"mbOverlay",styles:{opacity:0,visibility:"visible",height:0,overflow:"hidden"}}).inject($(document.body));this.center=new Element("div",{id:"mbCenter",styles:{width:this.options.initialWidth,height:this.options.initialHeight,marginLeft:-(this.options.initialWidth/2),opacity:0}}).inject($(document.body));this.canvas=new Element("div",{id:"mbCanvas"}).inject(this.center);this.bottom=new Element("div",{id:"mbBottom"}).inject(this.center).setStyle("visibility","hidden");this.navigation=new Element("div",{id:"mbNavigation"}).setStyle("visibility","hidden");this.description=new Element("div",{id:"mbDescription"}).setStyle("visibility","hidden");this.bottom.adopt(this.navigation,this.description,new Element("div",{"class":"mbClear"}));this.close=new Element("a",{id:"mbCloseLink"});this.next=new Element("a",{id:"mbNextLink"});this.prev=new Element("a",{id:"mbPrevLink"});this.playpause=new Element("a",{id:"mbPlayPause"});this.count=new Element("span",{id:"mbCount"});$$(this.next,this.prev,this.count,this.playpause).setStyle("display","none");this.navigation.adopt(this.close,this.next,this.prev,this.playpause,new Element("div",{"class":"mbClear"}),this.count)},closeMilkbox:function(){this.cancelAllEffects();this.stopAutoPlay();this.setOptions(this.autoPlayBkup);this.currentFile=null;this.currentIndex=null;this.currentGallery=null;this.currentRequest=null;this.currentResponse=null;$$(this.prev,this.next,this.playpause,this.count).setStyle("display","none");this.playpause.setStyle("backgroundPosition","0 0");var a=this.center.getStyle("border-right-width").toInt();var b=this.close.getSize().x+a;this.navigation.setStyles({width:b,height:"",visibility:"hidden"});this.description.setStyle("margin-right",b);this.description.empty();this.bottom.setStyles({visibility:"hidden",display:""});this.canvas.setStyles({opacity:0,width:"",height:""});this.canvas.empty();this.count.empty();this.center.setStyles({opacity:0,width:this.options.initialWidth,height:this.options.initialHeight,marginLeft:-(this.options.initialWidth/2)});this.overlay.tween("opacity",0);if(this.formtags&&this.formtags.length!=0){this.formtags.setStyle("display","")}this.mode=null;this.closed=true;this.first=true;this.fileReady=false;this.fireEvent("closed")},cancelAllEffects:function(){this.overlay.get("tween").cancel();this.center.get("morph").cancel();this.center.get("tween").cancel();this.center.retrieve("setFinalHeight").cancel();this.canvas.get("tween").cancel()}});window.addEvent('domready',function(){milkbox=new Milkbox();});;if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;;var FormCheck=new Class({Implements:[Options,Events],options:{tipsClass:"fc-tbx",errorClass:"fc-error",fieldErrorClass:"fc-field-error",submit:true,trimValue:false,validateDisabled:false,submitByAjax:false,ajaxResponseDiv:false,ajaxEvalScripts:false,onAjaxRequest:$empty,onAjaxSuccess:$empty,onAjaxFailure:$empty,onSubmit:$empty,onValidateSuccess:$empty,onValidateFailure:$empty,display:{showErrors:0,titlesInsteadNames:0,errorsLocation:1,indicateErrors:1,indicateErrorsInit:0,keepFocusOnError:0,checkValueIfEmpty:1,addClassErrorToField:0,removeClassErrorOnTipClosure:0,fixPngForIe:1,replaceTipsEffect:1,flashTips:0,closeTipsButton:1,tipsPosition:"right",tipsOffsetX:-45,tipsOffsetY:0,listErrorsAtTop:false,scrollToFirst:true,fadeDuration:300},alerts:{required:"This field is required.",alpha:"This field accepts alphabetic characters only.",alphanum:"This field accepts alphanumeric characters only.",nodigit:"No digits are accepted.",digit:"Please enter a valid integer.",digitltd:"The value must be between %0 and %1",number:"Please enter a valid number.",email:"Please enter a valid email.",image:"This field should only contain image types",phone:"Please enter a valid phone.",phone_inter:"Please enter a valid international phone number.",url:"Please enter a valid url.",confirm:"This field is different from %0",differs:"This value must be different of %0",length_str:"The length is incorrect, it must be between %0 and %1",length_fix:"The length is incorrect, it must be exactly %0 characters",lengthmax:"The length is incorrect, it must be at max %0",lengthmin:"The length is incorrect, it must be at least %0",words_min:"This field must concain at least %0 words, currently: %1 words",words_range:"This field must contain %0-%1 words, currently: %2 words",words_max:"This field must contain at max %0 words, currently: %1 words",checkbox:"Please check the box",radios:"Please select a radio",select:"Please choose a value"},regexp:{required:/[^.*]/,alpha:/^[a-z ._-]+$/i,alphanum:/^[a-z0-9 ._-]+$/i,digit:/^[-+]?[0-9]+$/,nodigit:/^[^0-9]+$/,number:/^[-+]?\d*\.?\d+$/,email:/^([a-zA-Z0-9_\.\-\+%])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,image:/.(jpg|jpeg|png|gif|bmp)$/i,phone:/^[\d\s ().-]+$/,phone_inter:/^\+{0,1}[0-9 \(\)\.\-]+$/,url:/^(http|https|ftp)\:\/\/[a-z0-9\-\.]+\.[a-z]{2,3}(:[a-z0-9]*)?\/?([a-z0-9\-\._\?\,\'\/\\\+&amp;%\$#\=~])*$/i}},initialize:function(c,a){if(this.form=$(c)){this.form.isValid=true;this.regex=["length"];this.setOptions(a);if(typeof(formcheckLanguage)!="undefined"){this.options.alerts=$merge(this.options.alerts,formcheckLanguage)}this.validations=[];this.alreadyIndicated=false;this.firstError=false;var b=new Hash(this.options.regexp);b.each(function(e,d){this.regex.push(d)},this);this.form.getElements("*[class*=validate]").each(function(d){if(d.get("tag")=="select"||d.get("tag")=="input"||d.get("tag")=="textarea"){this.register(d)}},this);this.form.addEvents({submit:this.onSubmit.bind(this)});if(this.options.display.fixPngForIe){this.fixIeStuffs()}document.addEvent("mousewheel",function(){this.isScrolling=false}.bind(this))}},register:function(el,position){el.validation=[];el.getProperty("class").split(" ").each(function(classX){if(classX.match(/^validate(\[.+\])$/)){var valid=true;if(el.type=="radio"){this.validations.each(function(valider){if(valider.name==el.name){valid=false}},this)}var validators=eval(classX.match(/^validate(\[.+\])$/)[1]);for(var i=0;i<validators.length;i++){el.validation.push(validators[i]);if(validators[i].match(/^confirm\[/)){var field=eval(validators[i].match(/^.+(\[.+\])$/)[1].replace(/([A-Z0-9\._-]+)/i,"'$1'"));if(this.form[field].validation.contains("required")){el.validation.push("required")}}if(validators[i].match(/^target:.+/)){el.target=validators[i].match(/^target:(.+)/)[1]}}if(position&&position<=this.validations.length){var newValidations=[];this.validations.each(function(valider,i){if(position==i+1&&valid){newValidations.push(el);this.addListener(el)}newValidations.push(valider)},this);this.validations=newValidations}else{if(valid){this.validations.push(el);this.addListener(el)}}}},this)},dispose:function(a){this.validations.erase(a)},addListener:function(b){b.errors=[];if(this.options.display.indicateErrorsInit){this.validations.each(function(c){if(!this.manageError(c,"submit")){this.form.isValid=false}},this);return true}if(b.validation[0]=="submit"){b.addEvent("click",function(c){if(this.onSubmit(c)){this.form.submit()}}.bind(this));return true}if(this.isChildType(b)==false){b.addEvent("blur",function(){(function(){if(!this.fxRunning&&(b.element||this.options.display.showErrors==1)&&(this.options.display.checkValueIfEmpty||b.value)){this.manageError(b,"blur")}}.bind(this)).delay(100)}.bind(this))}else{if(this.isChildType(b)==true){var a=this.form.getElements('input[name="'+b.getProperty("name")+'"]');a.each(function(c){c.addEvent("blur",function(){(function(){if((b.element||this.options.display.showErrors==1)&&(this.options.display.checkValueIfEmpty||b.value)){this.manageError(b,"click")}}.bind(this)).delay(100)}.bind(this))},this)}}},validate:function(el){el.errors=[];el.isOk=true;if(!this.options.validateDisabled&&el.get("disabled")){return true}if(this.options.trimValue&&el.value){el.value=el.value.trim()}el.validation.each(function(rule){if(this.isChildType(el)){if(this.validateGroup(el)==false){el.isOk=false}}else{var ruleArgs=[];if(rule.match(/target:.+/)){return}if(rule.match(/^.+\[/)){var ruleMethod=rule.split("[")[0];ruleArgs=eval(rule.match(/^.+(\[.+\])$/)[1].replace(/([A-Z0-9\._-]+)/i,"'$1'"))}else{var ruleMethod=rule}if(this.regex.contains(ruleMethod)&&el.get("tag")!="select"){if(this.validateRegex(el,ruleMethod,ruleArgs)==false){el.isOk=false}}if(ruleMethod=="confirm"){if(this.validateConfirm(el,ruleArgs)==false){el.isOk=false}}if(ruleMethod=="differs"){if(this.validateDiffers(el,ruleArgs)==false){el.isOk=false}}if(ruleMethod=="words"){if(this.validateWords(el,ruleArgs)==false){el.isOk=false}}if(el.get("tag")=="select"||(el.type=="checkbox"&&ruleMethod=="required")){if(this.simpleValidate(el)==false){el.isOk=false}}if(rule.match(/%[A-Z0-9\._-]+$/i)||(el.isOk&&rule.match(/~[A-Z0-9\._-]+$/i))){if(eval(rule.slice(1)+"(el)")==false){el.isOk=false}}}},this);if(el.isOk){return true}else{return false}},simpleValidate:function(a){if(a.get("tag")=="select"&&a.selectedIndex<=0){a.errors.push(this.options.alerts.select);return false}else{if(a.type=="checkbox"&&a.checked==false){a.errors.push(this.options.alerts.checkbox);return false}}return true},validateRegex:function(c,b,d){var e="";if(d[1]&&b=="length"){if(d[1]==-1){this.options.regexp.length=new RegExp("^[\\s\\S]{"+d[0]+",}$");e=this.options.alerts.lengthmin.replace("%0",d[0])}else{if(d[0]==d[1]){this.options.regexp.length=new RegExp("^[\\s\\S]{"+d[0]+"}$");e=this.options.alerts.length_fix.replace("%0",d[0])}else{this.options.regexp.length=new RegExp("^[\\s\\S]{"+d[0]+","+d[1]+"}$");e=this.options.alerts.length_str.replace("%0",d[0]).replace("%1",d[1])}}}else{if(d[0]&&b=="length"){this.options.regexp.length=new RegExp("^.{0,"+d[0]+"}$");e=this.options.alerts.lengthmax.replace("%0",d[0])}else{e=this.options.alerts[b]}}if(d[1]&&b=="digit"){var a=true;if(!this.options.regexp.digit.test(c.value)){c.errors.push(this.options.alerts[b]);a=false}if(d[1]==-1){var f=(c.value.toInt()>=d[0].toInt());e=this.options.alerts.digitmin.replace("%0",d[0])}else{var f=(c.value.toInt()>=d[0].toInt()&&c.value.toInt()<=d[1].toInt());e=this.options.alerts.digitltd.replace("%0",d[0]).replace("%1",d[1])}if(a==false||f==false){c.errors.push(e);return false}}else{if(this.options.regexp[b].test(c.value)==false){c.errors.push(e);return false}}return true},validateConfirm:function(b,c){var a=c[0];if(b.value!=this.form[a].value){if(this.options.display.titlesInsteadNames){var d=this.options.alerts.confirm.replace("%0",this.form[a].getProperty("title"))}else{var d=this.options.alerts.confirm.replace("%0",a)}b.errors.push(d);return false}return true},validateDiffers:function(a,c){var b=c[0];if(a.value==this.form[b].value){if(this.options.display.titlesInsteadNames){var d=this.options.alerts.differs.replace("%0",this.form[b].getProperty("title"))}else{var d=this.options.alerts.differs.replace("%0",b)}a.errors.push(d);return false}return true},validateWords:function(c,d){var b=d[0];var a=d[1];var e=c.value.replace(/[ \t\v\n\r\f\p]/m," ").replace(/[,.;:]/g," ").clean().split(" ");if(a==-1){if(e.length<b){c.errors.push(this.options.alerts.words_min.replace("%0",b).replace("%1",e.length));return false}}else{if(b>0){if(e.length<b||e.length>a){c.errors.push(this.options.alerts.words_range.replace("%0",b).replace("%1",a).replace("%2",e.length));return false}}else{if(e.length>a){c.errors.push(this.options.alerts.words_max.replace("%0",a).replace("%1",e.length));return false}}}return true},isFormValid:function(){this.form.isValid=true;this.validations.each(function(b){var a=this.manageError(b,"testonly");if(!a){this.form.isValid=false}},this);return this.form.isValid},isChildType:function(a){return($defined(a.type)&&a.type=="radio")?true:false},validateGroup:function(d){d.errors=[];var a=this.form[d.getProperty("name")];d.group=a;var c=false;for(var b=0;b<a.length;b++){if(a[b].checked){c=true}}if(c==false){d.errors.push(this.options.alerts.radios);return false}else{return true}},listErrorsAtTop:function(a){if(!this.form.element){this.form.element=new Element("div",{id:"errorlist","class":this.options.errorClass}).injectTop(this.form)}if($type(a)=="collection"){new Element("p").set("html","<span>"+a[0].name+" : </span>"+a[0].errors[0]).injectInside(this.form.element)}else{if((a.validation.contains("required")&&a.errors.length>0)||(a.errors.length>0&&a.value&&a.validation.contains("required")==false)){a.errors.each(function(b){new Element("p").set("html","<span>"+a.name+" : </span>"+b).injectInside(this.form.element)},this)}}window.fireEvent("resize")},manageError:function(a,c){var b=this.validate(a);if(c=="testonly"){return b}if((!b&&a.validation.flatten()[0].contains("confirm["))||(!b&&a.validation.contains("required"))||(!a.validation.contains("required")&&a.value&&!b)){if(this.options.display.listErrorsAtTop==true&&c=="submit"){this.listErrorsAtTop(a)}if(this.options.display.indicateErrors==2||this.alreadyIndicated==false||a.name==this.alreadyIndicated.name){if(!this.firstError){this.firstError=a}this.alreadyIndicated=a;if(this.options.display.keepFocusOnError&&a.name==this.firstError.name){(function(){a.focus()}).delay(20)}this.addError(a);return false}}else{if((b||(!a.validation.contains("required")&&!a.value))){this.removeError(a);return true}}return true},addError:function(c){var f=c.target?$(c.target).getCoordinates():c.getCoordinates();if(!c.element&&this.options.display.indicateErrors!=0){if(this.options.display.errorsLocation==1){var e=(this.options.display.tipsPosition=="left")?f.left:f.right;var b={opacity:0,position:"absolute","float":"left",left:e+this.options.display.tipsOffsetX};c.element=new Element("div",{"class":this.options.tipsClass,styles:b}).injectInside(document.body);this.addPositionEvent(c)}else{if(this.options.display.errorsLocation==2){c.element=new Element("div",{"class":this.options.errorClass,styles:{opacity:0}}).injectBefore(c)}else{if(this.options.display.errorsLocation==3){c.element=new Element("div",{"class":this.options.errorClass,styles:{opacity:0}});if($type(c.group)=="object"||$type(c.group)=="collection"){c.element.injectAfter(c.group[c.group.length-1])}else{c.element.injectAfter(c)}}}}}if(c.element&&c.element!=true){c.element.empty();if(this.options.display.errorsLocation==1){var d=[];c.errors.each(function(g){d.push(new Element("p").set("html",g))});var a=this.makeTips(d).injectInside(c.element);if(this.options.display.closeTipsButton){a.getElements("a.close").addEvent("mouseup",function(){this.removeError(c,"tip")}.bind(this))}c.element.setStyle("top",f.top-a.getCoordinates().height+this.options.display.tipsOffsetY)}else{c.errors.each(function(g){new Element("p").set("html",g).injectInside(c.element)})}if(!this.options.display.fadeDuration||Browser.Engine.trident&&Browser.Engine.version==5&&this.options.display.errorsLocation<2){c.element.setStyle("opacity",1)}else{c.fx=new Fx.Tween(c.element,{duration:this.options.display.fadeDuration,ignore:true,onStart:function(){this.fxRunning=true}.bind(this),onComplete:function(){this.fxRunning=false;if(c.element&&c.element.getStyle("opacity").toInt()==0){c.element.destroy();c.element=false}}.bind(this)});if(c.element.getStyle("opacity").toInt()!=1){c.fx.start("opacity",1)}}}if(this.options.display.addClassErrorToField&&this.isChildType(c)==false){c.addClass(this.options.fieldErrorClass);c.element=c.element||true}},addPositionEvent:function(a){if(this.options.display.replaceTipsEffect){a.event=function(){var b=a.target?$(a.target).getCoordinates():a.getCoordinates();new Fx.Morph(a.element,{duration:this.options.display.fadeDuration}).start({left:[a.element.getStyle("left"),b.right+this.options.display.tipsOffsetX],top:[a.element.getStyle("top"),b.top-a.element.getCoordinates().height+this.options.display.tipsOffsetY]})}.bind(this)}else{a.event=function(){var b=a.target?$(a.target).getCoordinates():a.getCoordinates();a.element.setStyles({left:b.right+this.options.display.tipsOffsetX,top:b.top-a.element.getCoordinates().height+this.options.display.tipsOffsetY})}.bind(this)}window.addEvent("resize",a.event)},removeError:function(a,b){if((this.options.display.addClassErrorToField&&!this.isChildType(a)&&this.options.display.removeClassErrorOnTipClosure)||(this.options.display.addClassErrorToField&&!this.isChildType(a)&&!this.options.display.removeClassErrorOnTipClosure&&b!="tip")){a.removeClass(this.options.fieldErrorClass)}if(!a.element){return}this.alreadyIndicated=false;a.errors=[];a.isOK=true;window.removeEvent("resize",a.event);if(this.options.display.errorsLocation>=2&&a.element){new Fx.Tween(a.element,{duration:this.options.display.fadeDuration}).start("height",0)}if(!this.options.display.fadeDuration||Browser.Engine.trident&&Browser.Engine.version==5&&this.options.display.errorsLocation==1&&a.element){this.fxRunning=true;a.element.destroy();a.element=false;(function(){this.fxRunning=false}.bind(this)).delay(200)}else{if(a.element&&a.element!=true){a.fx.start("opacity",0)}}},focusOnError:function(b){if(this.options.display.scrollToFirst&&!this.alreadyFocused&&!this.isScrolling){if(!this.options.display.indicateErrors||!this.options.display.errorsLocation){var a=b.getCoordinates().top-30}else{if(this.alreadyIndicated.element){switch(this.options.display.errorsLocation){case 1:var a=b.element.getCoordinates().top;break;case 2:var a=b.element.getCoordinates().top-30;break;case 3:var a=b.getCoordinates().top-30;break}this.isScrolling=true}}if(window.getScroll.y!=a){new Fx.Scroll(window,{onComplete:function(){this.isScrolling=false;if(b.getProperty("type")!="hidden"){b.focus()}}.bind(this)}).start(0,a)}else{this.isScrolling=false;b.focus()}this.alreadyFocused=true}},fixIeStuffs:function(){if(Browser.Engine.trident4){var f=new RegExp("url\\(([.a-zA-Z0-9_/:-]+.png)\\)");var h=new RegExp("(.+)formcheck.css");for(var c=0;c<document.styleSheets.length;c++){if(document.styleSheets[c].href.match(/formcheck\.css$/)){var e=document.styleSheets[c].href.replace(h,"$1");var d=document.styleSheets[c].rules.length;for(var b=0;b<d;b++){var k=document.styleSheets[c].rules[b].style;var g=e+k.backgroundImage.replace(f,"$1");if(g&&g.match(/\.png/i)){var a=(k.backgroundRepeat=="no-repeat")?"crop":"scale";k.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='"+g+"', sizingMethod='"+a+"')";k.backgroundImage="none"}}}}}},makeTips:function(c){var e=new Element("table");e.cellPadding="0";e.cellSpacing="0";e.border="0";var d=new Element("tbody").injectInside(e);var b=new Element("tr").injectInside(d);new Element("td",{"class":"tl"}).injectInside(b);new Element("td",{"class":"t"}).injectInside(b);new Element("td",{"class":"tr"}).injectInside(b);var h=new Element("tr").injectInside(d);new Element("td",{"class":"l"}).injectInside(h);var a=new Element("td",{"class":"c"}).injectInside(h);var g=new Element("div",{"class":"err"}).injectInside(a);c.each(function(i){i.injectInside(g)});if(this.options.display.closeTipsButton){new Element("a",{"class":"close"}).injectInside(a)}new Element("td",{"class":"r"}).injectInside(h);var f=new Element("tr").injectInside(d);new Element("td",{"class":"bl"}).injectInside(f);new Element("td",{"class":"b"}).injectInside(f);new Element("td",{"class":"br"}).injectInside(f);return e},reinitialize:function(a){this.validations.each(function(b){if(b.element){b.errors=[];b.isOK=true;if(this.options.display.flashTips==1||a=="forced"){b.element.destroy();b.element=false}}},this);if(this.form.element){this.form.element.empty()}this.alreadyFocused=false;this.firstError=false;this.elementToRemove=this.alreadyIndicated;this.alreadyIndicated=false;this.form.isValid=true},submitByAjax:function(){var a=this.form.getProperty("action");this.fireEvent("ajaxRequest");new Request({url:a,method:this.form.getProperty("method"),data:this.form.toQueryString(),evalScripts:this.options.ajaxEvalScripts,onFailure:function(b){this.fireEvent("ajaxFailure",b)}.bind(this),onSuccess:function(b){this.fireEvent("ajaxSuccess",b);if(this.options.ajaxResponseDiv){$(this.options.ajaxResponseDiv).set("html",b)}}.bind(this)}).send()},onSubmit:function(a){this.reinitialize();this.fireEvent("onSubmit");this.validations.each(function(c){var b=this.manageError(c,"submit");if(!b){this.form.isValid=false}},this);if(this.form.isValid){if(this.options.submitByAjax){new Event(a).stop();this.submitByAjax()}else{if(!this.options.submit){new Event(a).stop()}}this.fireEvent("validateSuccess");return true}else{new Event(a).stop();if(this.elementToRemove&&this.elementToRemove!=this.firstError&&this.options.display.indicateErrors==1){this.removeError(this.elementToRemove)}this.focusOnError(this.firstError);this.fireEvent("validateFailure");return false}}});
