var Carousel=new Class({initialize:function(b){this.items=b.items;this.mode=b.mode||"horizontal";this.modes={horizontal:["left","width"],vertical:["top","height"]};this.size=b.size||240;this.box=b.box.setStyle(this.modes[this.mode][1],(this.size*this.items.length)+"px");this.button_event=b.button_event||"click";this.handle_event=b.handle_event||"click";this.onWalk=b.onWalk||null;this.currentIndex=null;this.previousIndex=null;this.nextIndex=null;this.forward=true;this.handlesLength=this.items.length-1;this.interval=b.interval||5000;this.autoPlay=b.autoPlay||false;this._play=null;this.UserEvent=false;this.handles=b.handles||null;this.hideButtonsOnEnd=b.hideButtonsOnEnd||false;this.eventFire=b.eventFire||false;this.textIndexEl=b.textIndexEl||false;this.textLengthEl=b.textLengthEl||false;if(this.handles){this.addHandleButtons(this.handles)}this.buttons={previous:[],next:[],play:[],playback:[],stop:[]};if(b.addButtons){for(var a in b.addButtons){this.addActionButtons(a,$type(b.addButtons[a])=="array"?b.addButtons[a]:[b.addButtons[a]])}}this.fx=new Fx.Tween(this.box,$extend((b.fxOptions||{duration:500,wait:false}),{property:this.modes[this.mode][0]}));this.itemFx=b.itemFx||false;if(this.itemFx){for(i=0;i<this.items.length;i++){this.items[i].set("tween",$extend((b.itemFxOptions||{duration:300})))}}this.itemsIndex=new Array();for(i=0;i<this.items.length-1;i++){this.itemsIndex[i]=i+1}this.itemsIndex[this.items.length-1]=1;if(this.textLengthEl){this.textLengthEl.set("text",this.items.length-1)}this.walk((b.startItem||0),true,true)},addHandleButtons:function(b){for(var a=0;a<b.length;a++){b[a].addEvent(this.handle_event,this.walk.pass([a,true],this))}},addActionButtons:function(c,b){for(var a=0;a<b.length;a++){switch(c){case"previous":b[a].addEvent(this.button_event,this.previous.pass([true],this));break;case"next":b[a].addEvent(this.button_event,this.next.pass([true],this));break;case"play":b[a].addEvent(this.button_event,this.play.pass([this.interval,"next",false],this));break;case"playback":b[a].addEvent(this.button_event,this.play.pass([this.interval,"previous",false],this));break;case"stop":b[a].addEvent(this.button_event,this.stop.bind(this));break}this.buttons[c].push(b[a])}},previous:function(a){if(this.currentIndex==this.handlesLength||((this.currentIndex==0)&&(this.forward))){this.currentIndex=this.handlesLength;this.box.setStyle(this.modes[this.mode][0],(-this.currentIndex*this.size)+"px")}this.forward=false;if(this.currentIndex==0){this.walk(this.items.length-1,a,true)}this.walk((this.currentIndex>0?this.currentIndex-1:this.items.length-2),a);if(this.currentIndex==0){this.currentIndex=this.handlesLength}if(this.eventFire){window.fireEvent("slide",this.currentIndex)}if(!this.UserEvent){this.UserEvent=true}else{_gaq.push(["_trackEvent","NoBounce","previous Image"])}},next:function(a){if(this.currentIndex==0||((this.currentIndex==this.handlesLength)&&(!this.forward))){this.currentIndex=0;this.box.setStyle(this.modes[this.mode][0],("0px"))}this.forward=true;this.walk((this.currentIndex<this.items.length-1?this.currentIndex+1:0),a);if(this.currentIndex==this.handlesLength){this.currentIndex=0}if(this.eventFire){window.fireEvent("slide",this.currentIndex)}if(!this.UserEvent){this.UserEvent=true}else{_gaq.push(["_trackEvent","NoBounce","next Image"])}},play:function(a,c,b){this.stop();if(!b){this[c](false)}this._play=this[c].periodical(a,this,[false])},stop:function(){$clear(this._play)},walk:function(c,b,a){if(c!=this.currentIndex){var d=this.currentIndex;if(c==0&&d==this.handlesLength-1){if(this.items.length>3){this.next(true);return}}if(c==1&&d==0){this.fx.cancel().set(0+"px")}this.currentIndex=c;this.previousIndex=this.currentIndex+(this.currentIndex>0?-1:this.items.length-1);this.nextIndex=this.currentIndex+(this.currentIndex<this.items.length-1?1:1-this.items.length);if(b){this.stop()}if(this.currentIndex==this.handlesLength-1&&d==0){if(this.items.length>3){this.fx.cancel().set((this.size*-(this.currentIndex+1))+"px")}}if(a){this.box.setStyle(this.modes[this.mode][0],(this.size*-this.currentIndex)+"px")}else{if(this.hideButtonsOnEnd){if(this.items.length<4&&this.currentIndex==1){for(i=0;i<this.buttons.next.length;i++){this.buttons.next[i].setStyle("opacity",0);this.buttons.previous[i].setStyle("opacity",1)}}else{if(this.items.length<4&&this.currentIndex==0){for(i=0;i<this.buttons.next.length;i++){this.buttons.next[i].setStyle("opacity",1);this.buttons.previous[i].setStyle("opacity",0)}}else{if(this.currentIndex==this.items.length-2){for(i=0;i<this.buttons.next.length;i++){this.buttons.next[i].setStyle("opacity",0)}}if(this.currentIndex==0){for(i=0;i<this.buttons.next.length;i++){this.buttons.previous[i].setStyle("opacity",0)}}if(this.currentIndex!=0&&this.currentIndex<this.items.length-2){for(i=0;i<this.buttons.next.length;i++){this.buttons.next[i].setStyle("opacity",1);this.buttons.previous[i].setStyle("opacity",1)}}}}}if(this.itemFx){this.items[this.currentIndex].fade("hide").fade("in");this.items[d].fade("show").fade("out")}this.fx.start(this.size*-this.currentIndex)}if(b&&this.autoPlay){this.play(this.interval,"next",true)}if(this.onWalk){this.onWalk((this.items[this.currentIndex]||null),(this.handles?this.handles[this.currentIndex==this.handlesLength?0:this.currentIndex]:null))}}if(this.textIndexEl){this.textIndexEl.set("html",this.itemsIndex[this.currentIndex]<10&&this.items.length>10?'<span style="color:white">0</span>'+this.itemsIndex[this.currentIndex]:this.itemsIndex[this.currentIndex])}}});var FormCheck=new Class({Implements:[Options,Events],options:{tipsClass:"fc-tbx",errorClass:"fc-error",fieldErrorClass:"fc-field-error",trimValue:false,validateDisabled:false,submitByAjax:false,ajaxResponseDiv:false,ajaxEvalScripts:false,onAjaxRequest:$empty,onAjaxSuccess:$empty,onAjaxFailure:$empty,display:{showErrors:0,titlesInsteadNames:0,errorsLocation:1,indicateErrors:1,indicateErrorsInit:0,keepFocusOnError:0,checkValueIfEmpty:1,addClassErrorToField: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.",phone:"Please enter a valid phone.",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",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-z0-9._%-]+@[a-z0-9.-]+\.[a-z]{2,4}$/i,phone:/^[\(\)\#\d\/\\\s+-]+$/,url:/^(http|https|ftp)\:\/\/[a-z0-9\-\.]+\.[a-z]{2,3}(:[a-z0-9]*)?\/?([a-z0-9\-\._\?\,\'\/\\\+&amp;%\$#\=~])*$/i}},initialize:function(b,a){if(this.form=$(b)){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 c=new Hash(this.options.regexp);c.each(function(d,e){this.regex.push(e)},this);this.form.getElements("*[class*=validate]").each(function(d){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){el.validation=[];el.getProperty("class").split(" ").each(function(classX){if(classX.match(/^validate(\[.+\])$/)){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")}}}this.addListener(el)}},this)},dispose:function(a){this.validations.erase(a)},addListener:function(b){this.validations.push(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){this.onSubmit(c)}.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(/^.+\[/)){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(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(e,f,d){var c="";if(d[1]&&f=="length"){if(d[1]==-1){this.options.regexp.length=new RegExp("^[\\s\\S]{"+d[0]+",}$");c=this.options.alerts.lengthmin.replace("%0",d[0])}else{if(d[0]==d[1]){this.options.regexp.length=new RegExp("^[\\s\\S]{"+d[0]+"}$");c=this.options.alerts.length_fix.replace("%0",d[0])}else{this.options.regexp.length=new RegExp("^[\\s\\S]{"+d[0]+","+d[1]+"}$");c=this.options.alerts.length_str.replace("%0",d[0]).replace("%1",d[1])}}}else{if(d[0]&&f=="length"){this.options.regexp.length=new RegExp("^.{0,"+d[0]+"}$");c=this.options.alerts.lengthmax.replace("%0",d[0])}else{c=this.options.alerts[f]}}if(d[1]&&f=="digit"){var a=true;if(!this.options.regexp.digit.test(e.value)){e.errors.push(this.options.alerts[f]);a=false}if(d[1]==-1){if(e.value>=d[0]){var b=true}else{var b=false}c=this.options.alerts.digitmin.replace("%0",d[0])}else{if(e.value>=d[0]&&e.value<=d[1]){var b=true}else{var b=false}c=this.options.alerts.digitltd.replace("%0",d[0]).replace("%1",d[1])}if(a==false||b==false){e.errors.push(c);return false}}else{if(this.options.regexp[f].test(e.value)==false){e.errors.push(c);return false}}return true},validateConfirm:function(d,c){var a=c[0];if(d.value!=this.form[a].value){if(this.options.display.titlesInsteadNames){var b=this.options.alerts.confirm.replace("%0",this.form[a].getProperty("title"))}else{var b=this.options.alerts.confirm.replace("%0",a)}d.errors.push(b);return false}return true},validateDiffers:function(a,c){var d=c[0];if(a.value==this.form[d].value){if(this.options.display.titlesInsteadNames){var b=this.options.alerts.differs.replace("%0",this.form[d].getProperty("title"))}else{var b=this.options.alerts.differs.replace("%0",d)}a.errors.push(b);return false}return true},isChildType:function(a){return($defined(a.type)&&a.type=="radio")?true:false},validateGroup:function(b){b.errors=[];var a=this.form[b.getProperty("name")];b.group=a;var c=false;for(var d=0;d<a.length;d++){if(a[d].checked){c=true}}if(c==false){b.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)}}},manageError:function(a,b){var c=this.validate(a);if((!c&&a.validation.flatten()[0].contains("confirm["))||(!c&&a.validation.contains("required"))||(!a.validation.contains("required")&&a.value&&!c)){if(this.options.display.listErrorsAtTop==true&&b=="submit"){this.listErrorsAtTop(a,b)}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((c||(!a.validation.contains("required")&&!a.value))&&a.element){this.removeError(a);return true}}return true},addError:function(d){if(!d.element&&this.options.display.indicateErrors!=0){if(this.options.display.errorsLocation==1){var b=(this.options.display.tipsPosition=="left")?d.getCoordinates().left:d.getCoordinates().right;var e={opacity:0,position:"absolute","float":"left",left:b+this.options.display.tipsOffsetX};d.element=new Element("div",{"class":this.options.tipsClass,styles:e}).injectInside(document.body);this.addPositionEvent(d)}else{if(this.options.display.errorsLocation==2){d.element=new Element("div",{"class":this.options.errorClass,styles:{opacity:0}}).injectBefore(d)}else{if(this.options.display.errorsLocation==3){d.element=new Element("div",{"class":this.options.errorClass,styles:{opacity:0}});if($type(d.group)=="object"||$type(d.group)=="collection"){d.element.injectAfter(d.group[d.group.length-1])}else{d.element.injectAfter(d)}}}}}if(d.element&&d.element!=true){d.element.empty();if(this.options.display.errorsLocation==1){var c=[];d.errors.each(function(f){c.push(new Element("p").set("html",f))});var a=this.makeTips(c).injectInside(d.element);if(this.options.display.closeTipsButton){a.getElements("a.close").addEvent("mouseup",function(){this.removeError(d)}.bind(this))}d.element.setStyle("top",d.getCoordinates().top-a.getCoordinates().height+this.options.display.tipsOffsetY)}else{d.errors.each(function(f){new Element("p").set("html",f).injectInside(d.element)})}if(!this.options.display.fadeDuration||Browser.Engine.trident&&Browser.Engine.version==5&&this.options.display.errorsLocation<2){d.element.setStyle("opacity",1)}else{d.fx=new Fx.Tween(d.element,{duration:this.options.display.fadeDuration,ignore:true,onStart:function(){this.fxRunning=true}.bind(this),onComplete:function(){this.fxRunning=false;if(d.element&&d.element.getStyle("opacity").toInt()==0){d.element.destroy();d.element=false}}.bind(this)});if(d.element.getStyle("opacity").toInt()!=1){d.fx.start("opacity",1)}}}if(this.options.display.addClassErrorToField&&this.isChildType(d)==false){d.addClass(this.options.fieldErrorClass);d.element=d.element||true}},addPositionEvent:function(a){if(this.options.display.replaceTipsEffect){a.event=function(){new Fx.Morph(a.element,{duration:this.options.display.fadeDuration}).start({left:[a.element.getStyle("left"),a.getCoordinates().right+this.options.display.tipsOffsetX],top:[a.element.getStyle("top"),a.getCoordinates().top-a.element.getCoordinates().height+this.options.display.tipsOffsetY]})}.bind(this)}else{a.event=function(){a.element.setStyles({left:a.getCoordinates().right+this.options.display.tipsOffsetX,top:a.getCoordinates().top-a.element.getCoordinates().height+this.options.display.tipsOffsetY})}.bind(this)}window.addEvent("resize",a.event)},removeError:function(a){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)}}if(this.options.display.addClassErrorToField&&!this.isChildType(a)){a.removeClass(this.options.fieldErrorClass)}},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;b.focus()}.bind(this)}).start(0,a)}else{this.isScrolling=false;b.focus()}this.alreadyFocused=true}},fixIeStuffs:function(){if(Browser.Engine.trident4){var h=new RegExp("url\\(([.a-zA-Z0-9_/:-]+.png)\\)");var f=new RegExp("(.+)formcheck.css");for(var b=0;b<document.styleSheets.length;b++){if(document.styleSheets[b].href.match(/formcheck\.css$/)){var j=document.styleSheets[b].href.replace(f,"$1");var a=document.styleSheets[b].rules.length;for(var c=0;c<a;c++){var e=document.styleSheets[b].rules[c].style;var g=j+e.backgroundImage.replace(h,"$1");if(g&&g.match(/\.png/i)){var d=(e.backgroundRepeat=="no-repeat")?"crop":"scale";e.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='"+g+"', sizingMethod='"+d+"')";e.backgroundImage="none"}}}}}},makeTips:function(g){var e=new Element("table");e.cellPadding="0";e.cellSpacing="0";e.border="0";var f=new Element("tbody").injectInside(e);var h=new Element("tr").injectInside(f);new Element("td",{"class":"tl"}).injectInside(h);new Element("td",{"class":"t"}).injectInside(h);new Element("td",{"class":"tr"}).injectInside(h);var b=new Element("tr").injectInside(f);new Element("td",{"class":"l"}).injectInside(b);var a=new Element("td",{"class":"c"}).injectInside(b);var c=new Element("div",{"class":"err"}).injectInside(a);g.each(function(j){j.injectInside(c)});if(this.options.display.closeTipsButton){new Element("a",{"class":"close"}).injectInside(a)}new Element("td",{"class":"r"}).injectInside(b);var d=new Element("tr").injectInside(f);new Element("td",{"class":"bl"}).injectInside(d);new Element("td",{"class":"b"}).injectInside(d);new Element("td",{"class":"br"}).injectInside(d);return e},reinitialize:function(){this.validations.each(function(a){if(a.element){a.errors=[];a.isOK=true;if(this.options.display.flashTips==1){a.element.destroy();a.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.validations.each(function(b){var c=this.manageError(b,"submit");if(!c){this.form.isValid=false}},this);if(this.form.isValid){if(this.options.submitByAjax){new Event(a).stop();this.submitByAjax()}}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)}}});var SimpleSlideshow=new Class({options:{showControls:false,showDuration:3000,transitionDuration:2000,showTOC:false,tocWidth:20,tocClass:"toc",tocActiveClass:"toc-active"},Implements:[Options,Events],initialize:function(a,c,b){this.container=$(a);this.elements=$$(c);this.currentIndex=0;this.interval="";if(this.options.showTOC){this.toc=[]}this.elements.each(function(e,d){if(this.options.showTOC){this.toc.push(new Element("a",{text:d+1,href:"#","class":this.options.tocClass+""+(d==0?" "+this.options.tocActiveClass:""),events:{click:function(f){if(f){f.stop()}this.stop();this.show(d)}.bind(this)},styles:{left:((d+1)*(this.options.tocWidth+10))}}).inject(this.container))}if(d>0){e.set("opacity",0)}},this);if(this.options.showControls){this.createControls()}this.container.addEvents({mouseenter:function(){this.stop()}.bind(this),mouseleave:function(){this.start()}.bind(this)})},show:function(a){this.elements[this.currentIndex].set("tween",{duration:this.options.transitionDuration}).tween("opacity",0);if(this.options.showTOC){this.toc[this.currentIndex].removeClass(this.options.tocActiveClass)}this.elements[this.currentIndex=($defined(a)?a:(this.currentIndex<this.elements.length-1?this.currentIndex+1:0))].set("tween",{duration:this.options.transitionDuration}).tween("opacity",1);if(this.options.showTOC){this.toc[this.currentIndex].addClass(this.options.tocActiveClass)}},start:function(){this.interval=this.show.bind(this).periodical(this.options.showDuration)},stop:function(){$clear(this.interval)},createControls:function(){var a=new Element("a",{href:"#",id:"next",text:">>",events:{click:function(c){if(c){c.stop()}this.stop();this.show()}.bind(this)}}).inject(this.container);var b=new Element("a",{href:"#",id:"previous",text:"<<",events:{click:function(c){if(c){c.stop()}this.stop();this.show(this.currentIndex!=0?this.currentIndex-1:this.elements.length-1)}.bind(this)}}).inject(this.container)}});Element.implement({hasEvent:function(a,b){var c=this.retrieve("events");return c&&c[a]&&(b==undefined||c[a].keys.contains(b))}});var site={start:function(){try{var M=$("gallery");var k=$("imagebox").getElement("div");var G=$$("#imagebox div").length;window.galleryZoom=true}catch(J){dbug.log("PROJECT DETAILS: "+J.description)}try{var h=$("infobox");if(M){var g=h.getElement("dl");var e=h.getElements("dl").length}else{var g=h.getElement(".slidetab");var e=h.getElements(".slidetab").length}}catch(J){dbug.log("INFOBOX: "+J.description)}try{var d=$("references");var A=$("references_toc");var m=A.getElements("a");var l=A.getElements("h2");var x=$$(m,l);var b=d.getElements("img")}catch(J){dbug.log("REFERENCES: "+J.description)}try{var q=$("projects");var A=$("references_toc");var F=A.getElements("a");var E=A.getElements("h2");var t=$$(F,E);var u=q.getElements("h2")}catch(J){dbug.log("PROJECTS: "+J.description)}try{if(!Browser.Platform.win){$("logo").setStyle("font-size","10px");$("logo").setStyle("word-spacing","1px")}}catch(J){dbug.log("FONTSIZE: "+J.description)}try{$("subnav").getElement(".projekte").position({relativeTo:$("nav").getElement(".projekte"),position:"upperLeft",offset:{x:0,y:23}})}catch(J){dbug.log("POSITION: "+J.description)}var s=function(P,R,S,Q,N){if(N=="cTiles11"){var O=1}else{if(N=="cTiles22"){var O=2}else{if(N=="cTiles63"){var O=6}else{if(N=="cTiles83"||N=="cTiles81"){var O=8}else{var O=4}}}}var W=0*O;var V=1*O;var U=2*O;if(R=="rDiagonal"){var T=P.getElements("img")}if(R=="pDiagonal"){var T=P.getElements("li")}if(T){T.each(function(Y,X){if(N=="cTiles22"){if(X==W+0){Y.fireEvent("mouseenter",null,S+Q*1)}if(X==W+1){Y.fireEvent("mouseenter",null,S+Q*2)}if(X==V+0){Y.fireEvent("mouseenter",null,S+Q*3)}if(X==V+1){Y.fireEvent("mouseenter",null,S+Q*4)}}else{if(N=="cTiles41"){if(X==W+0){Y.fireEvent("mouseenter",null,S+Q*1)}if(X==W+1){Y.fireEvent("mouseenter",null,S+Q*2)}if(X==W+2){Y.fireEvent("mouseenter",null,S+Q*3)}if(X==W+3){Y.fireEvent("mouseenter",null,S+Q*4)}}}if(N=="cTiles43"){if(X==W+0){Y.fireEvent("mouseenter",null,S+Q*1)}if(X==W+1){Y.fireEvent("mouseenter",null,S+Q*2)}if(X==V+0){Y.fireEvent("mouseenter",null,S+Q*3)}if(X==W+2){Y.fireEvent("mouseenter",null,S+Q*4)}if(X==V+1){Y.fireEvent("mouseenter",null,S+Q*5)}if(X==U+0){Y.fireEvent("mouseenter",null,S+Q*6)}if(X==W+3){Y.fireEvent("mouseenter",null,S+Q*7)}if(X==V+2){Y.fireEvent("mouseenter",null,S+Q*8)}if(X==U+1){Y.fireEvent("mouseenter",null,S+Q*9)}if(X==V+3){Y.fireEvent("mouseenter",null,S+Q*10)}if(X==U+2){Y.fireEvent("mouseenter",null,S+Q*11)}if(X==U+3){Y.fireEvent("mouseenter",null,S+Q*12)}}else{if(N=="cTiles63"){if(X==W+0){Y.fireEvent("mouseenter",null,S+Q*1)}if(X==W+1){Y.fireEvent("mouseenter",null,S+Q*2)}if(X==V+0){Y.fireEvent("mouseenter",null,S+Q*3)}if(X==W+2){Y.fireEvent("mouseenter",null,S+Q*4)}if(X==V+1){Y.fireEvent("mouseenter",null,S+Q*5)}if(X==U+0){Y.fireEvent("mouseenter",null,S+Q*6)}if(X==W+3){Y.fireEvent("mouseenter",null,S+Q*7)}if(X==V+2){Y.fireEvent("mouseenter",null,S+Q*8)}if(X==U+1){Y.fireEvent("mouseenter",null,S+Q*9)}if(X==W+4){Y.fireEvent("mouseenter",null,S+Q*10)}if(X==V+3){Y.fireEvent("mouseenter",null,S+Q*11)}if(X==U+2){Y.fireEvent("mouseenter",null,S+Q*12)}if(X==W+5){Y.fireEvent("mouseenter",null,S+Q*13)}if(X==V+4){Y.fireEvent("mouseenter",null,S+Q*14)}if(X==U+3){Y.fireEvent("mouseenter",null,S+Q*15)}if(X==V+5){Y.fireEvent("mouseenter",null,S+Q*16)}if(X==U+4){Y.fireEvent("mouseenter",null,S+Q*17)}if(X==U+5){Y.fireEvent("mouseenter",null,S+Q*18)}}else{if(N=="cTiles81"){if(X==W+0){Y.fireEvent("mouseenter",null,S+Q*1)}if(X==W+1){Y.fireEvent("mouseenter",null,S+Q*2)}if(X==W+2){Y.fireEvent("mouseenter",null,S+Q*3)}if(X==W+3){Y.fireEvent("mouseenter",null,S+Q*4)}if(X==W+4){Y.fireEvent("mouseenter",null,S+Q*5)}if(X==W+5){Y.fireEvent("mouseenter",null,S+Q*6)}if(X==W+6){Y.fireEvent("mouseenter",null,S+Q*7)}if(X==W+7){Y.fireEvent("mouseenter",null,S+Q*8)}}else{if(N=="cTiles83"){if(X==W+0){Y.fireEvent("mouseenter",null,S+Q*1)}if(X==W+1){Y.fireEvent("mouseenter",null,S+Q*2)}if(X==V+0){Y.fireEvent("mouseenter",null,S+Q*3)}if(X==W+2){Y.fireEvent("mouseenter",null,S+Q*4)}if(X==V+1){Y.fireEvent("mouseenter",null,S+Q*5)}if(X==U+0){Y.fireEvent("mouseenter",null,S+Q*6)}if(X==W+3){Y.fireEvent("mouseenter",null,S+Q*7)}if(X==V+2){Y.fireEvent("mouseenter",null,S+Q*8)}if(X==U+1){Y.fireEvent("mouseenter",null,S+Q*9)}if(X==W+4){Y.fireEvent("mouseenter",null,S+Q*10)}if(X==V+3){Y.fireEvent("mouseenter",null,S+Q*11)}if(X==U+2){Y.fireEvent("mouseenter",null,S+Q*12)}if(X==W+5){Y.fireEvent("mouseenter",null,S+Q*13)}if(X==V+4){Y.fireEvent("mouseenter",null,S+Q*14)}if(X==U+3){Y.fireEvent("mouseenter",null,S+Q*15)}if(X==W+6){Y.fireEvent("mouseenter",null,S+Q*16)}if(X==V+5){Y.fireEvent("mouseenter",null,S+Q*17)}if(X==U+4){Y.fireEvent("mouseenter",null,S+Q*18)}if(X==W+7){Y.fireEvent("mouseenter",null,S+Q*19)}if(X==V+6){Y.fireEvent("mouseenter",null,S+Q*20)}if(X==U+5){Y.fireEvent("mouseenter",null,S+Q*21)}if(X==V+7){Y.fireEvent("mouseenter",null,S+Q*22)}if(X==U+6){Y.fireEvent("mouseenter",null,S+Q*23)}if(X==U+7){Y.fireEvent("mouseenter",null,S+Q*24)}}}}}})}if(R=="diagonalStepwise"){P.getElements("li").each(function(Y,X){if(X==0){Y.fireEvent("mouseenter",null,S)}if(X==1||X==6){Y.fireEvent("mouseenter",null,S+300)}if(X==2||X==7||X==12){Y.fireEvent("mouseenter",null,S+600)}if(X==3||X==8||X==13){Y.fireEvent("mouseenter",null,S+800)}if(X==4||X==9||X==14){Y.fireEvent("mouseenter",null,S+1000)}if(X==5||X==10||X==15){Y.fireEvent("mouseenter",null,S+1100)}if(X==11||X==16){Y.fireEvent("mouseenter",null,S+1200)}if(X==17){Y.fireEvent("mouseenter",null,S+1300)}})}if(R=="onebyone"){P.getElements("li").each(function(Y,X){Y.fireEvent("mouseenter",null,S+Q*X)})}};var y=function(P){var R=$$(x);var O=$$(b);var Q=P.get("class");var S=new Array();S=Q.split(" ");Q=S[0];var N=d.getElements("."+Q);var T=A.getElements("."+Q);N.each(function(U){O.erase(U)});T.each(function(U){R.erase(U)});P.addEvents({mouseenter:function(){T.set("morph",{duration:500,wait:false,transition:"expo:out"}).morph(".references_ahover");R.set("morph",{duration:500,wait:false,transition:"expo:out"}).morph(".references_a");N.fade(1);O.fade(0.3)},mouseleave:function(){}})};var C=function(Q){var P=$$(t);var N=$$(u);var R=Q.get("class");var S=new Array();S=R.split(" ");R=S[0];var O=q.getElements("."+R);var T=A.getElements("."+R);O.each(function(U){N.erase(U)});T.each(function(U){P.erase(U)});dbug.log(Q);Q.addEvents({mouseenter:function(){T.set("morph",{duration:500,wait:false,transition:"expo:out"}).morph(".references_ahover");P.set("morph",{duration:500,wait:false,transition:"expo:out"}).morph(".references_a");O.set("morph",{duration:500,wait:false,transition:"expo:out"}).morph(".projects_mouseenter");N.morph(".projects_mouseleave")},mouseleave:function(){T.morph(".references_a");O.morph(".projects_mouseleave")}})};try{if(d){x.each(function(N){y(N)});b.set("morph",{duration:500,wait:false,transition:"quart:out"}).addEvent("mouseenter",function(N){el=this;el.morph(".references_intro");el.removeEvents("mouseenter");y(el)});var r=function(){if(window.projectsStartType=="auto"){s(d,"rDiagonal",1000,32,d.get("class"))}if(window.projectsStartType=="userAuto"){d.getElement("ul").addEvent("mouseenter",function(O){this.removeEvents("mouseenter");s(d,"rDiagonal",0,32,d.get("class"))})}var N=$("references_caption");if(N){(function(){N.fade("hide").setStyle("display","block").fade("in")}).delay(1000)}};r();var z=A.getElement("a.haus-ungar-wiggensbach");var n=A.getElement("a.kita-graslilienanger-muenchen");if(z){(function(){z.fireEvent("mouseenter")}).delay(0)}else{if(n){n.fireEvent("mouseenter")}}}}catch(J){dbug.log("REFERENCES OVERVIEW EXEC: "+J.description)}try{if(q){t.each(function(N){C(N)});q.getElements("h2").set("morph",{duration:500,wait:false,transition:"quart:out"});q.getElements("li").addEvent("mouseenter",function(O){var N=this.getElement("h2");N.morph(".projects_mouseleave");this.removeEvents("mouseenter");C(N)});var f=function(){if(window.projectsStartType=="auto"){s(q,"pDiagonal",1000,32,q.get("class"))}if(window.projectsStartType=="userAuto"){q.getElement("ul").addEvent("mouseenter",function(N){this.removeEvents("mouseenter");s(q,"pDiagonal",0,32,q.get("class"))})}};if(window.ie===undefined){window.addEvent("load",function(){f()})}else{f()}}}catch(J){dbug.log("PROJECT OVERVIEW EXEC: "+J.description)}try{var B=$("team");if(B){B.getElements("h2").set("morph",{duration:500,wait:false,transition:"quart:out"});B.getElements("li").addEvent("mouseenter",function(O){var N=this.getElement("h2");N.morph(".team_mouseleave");this.removeEvents("mouseenter");this.addEvents({mouseenter:function(){N.set("morph",{duration:500,wait:false,transition:"expo:out"}).morph(".team_mouseenter")},mouseleave:function(){N.morph(".team_mouseleave")}})});var c=function(){if(window.teamStartType=="auto"){s(B,"onebyone",1000,150)}if(window.teamStartType=="userAuto"){B.getElement("ul").addEvent("mouseenter",function(N){this.removeEvents("mouseenter");s(B,"diagonal",0,75)})}};if(window.ie===undefined){window.addEvent("load",function(){c()})}else{c()}}}catch(J){dbug.log("TEAM OVERVIEW EXEC: "+J.description)}try{if(M){if(G>1){k.clone().injectInside($("imagebox"));window.addEvent("keydown",function(N){if(N.key=="left"){$("gallery_prev").fireEvent("click")}if(N.key=="right"){$("gallery_next").fireEvent("click")}});var K=new Carousel({box:$("imagebox"),items:$$("#imagebox .carouselItem"),size:960,addButtons:{previous:$("gallery_prev"),next:$("gallery_next")},button_event:"click",interval:7000,itemFx:true,eventFire:true,textIndexEl:$("gallery_index"),textLengthEl:$("gallery_length"),fxOptions:{duration:800,transition:Fx.Transitions.Cubic.easeOut,wait:false,onStart:function(){window.galleryZoom=false},onComplete:function(){window.galleryZoom=true}},itemFxOptions:{duration:1000}});K.next();K.walk(0);$("gallery").addEvent("mouseenter",function(N){K.stop()});$("gallery").addEvent("mouseover",function(N){K.stop()});$("gallery").addEvent("mouseleave",function(N){})}else{if(G==1){$$("#gallery_prev","#gallery_next").setStyle("visibility","hidden");k.addClass("b70")}}}}catch(J){dbug.log("GALLERY: "+J.description)}try{if(M&&!window.lte_ie7){var I=function(N){var O=N.getProperty("longdesc");if(O){new Zoomer(N,{smooth:10,big:O,externalVar:"window.galleryZoom"})}};var a=function(N){var P=$("imagebox").getElements(".zoomArea");var O=P.length;P.each(function(R,Q){R.store("zoomed",false);var S=[Q];if(Q<O-1){S.push(Q+1)}else{S.push(0)}R.store("zoomElements",S);window.addEvent("slide",function(T){if(T==Q){P[T].retrieve("zoomElements").each(function(U){if(!P[U].retrieve("zoomed")){P[U].store("zoomed",true);dbug.log("prepare zoom element: "+U);I(P[U])}})}})});window.fireEvent("slide",0)};if(window.ie===undefined){window.addEvent("load",function(){a()})}else{a()}}}catch(J){dbug.log("ZOOM: "+J.description)}try{if(h){if(e>1){g.clone().injectInside($("infobox"));if(M){var o=h.getElements("dl")}else{var o=h.getElements(".slidetab")}var w=new Carousel({box:h,items:o,size:710,addButtons:{previous:$("info_prev"),next:$("info_next")},button_event:"click",interval:7000,itemFx:true,hideButtonsOnEnd:true,textIndexEl:$("info_index"),textLengthEl:$("info_length"),fxOptions:{duration:800,transition:Fx.Transitions.Cubic.easeOut,wait:false},itemFxOptions:{duration:1000}});w.next();w.walk(0);$("infobox").addEvent("mouseenter",function(N){w.stop()});$("infobox").addEvent("mouseover",function(N){w.stop()});$("infobox").addEvent("mouseleave",function(N){})}else{if(e==1){$$("#info_prev","#info_next").setStyle("visibility","hidden");g.addClass("b70")}}}}catch(J){dbug.log("INFO: "+J.description)}try{if($("project-tabtitles")){window.TabSwapperUserEvent=false;$("status_info").fade("hide");if($("info_length").get("text")){var v=true}else{var v=false}var H=new TabSwapper({smooth:true,selectedClass:"selected",tabs:$$("#project-tabtitles a.tabtitle"),onActive:function(N){if(N==1){$("status_gallery").fade("out");(function(){$("status_gallery").setStyle("display","none")}).delay(500);if(v){$("status_info").setStyle("display","block");$("status_info").fade("in")}}else{$("status_gallery").setStyle("display","block");$("status_gallery").fade("in");$("status_info").fade("out");(function(){$("status_info").setStyle("display","none")}).delay(500)}if(!window.TabSwapperUserEvent){window.TabSwapperUserEvent=true}else{_gaq.push(["_trackEvent","NoBounce","Tab"])}},sections:$$("#project-tabcontents .tab")})}}catch(J){dbug.log("TABSWAPPER: "+J.description)}try{if($("slideshow")){var p=new SimpleSlideshow("slideshow","#slideshow img");p.start()}}catch(J){dbug.log("TABSWAPPER: "+J.description)}try{function D(N){if(typeof N.onselectstart!="undefined"){N.onselectstart=function(){return false}}else{if(typeof N.style.MozUserSelect!="undefined"){N.style.MozUserSelect="none"}else{N.onmousedown=function(){return false}}}}$$("#gallery_next","#gallery_prev","#info_next","#info_prev").each(function(N){D(N)})}catch(J){dbug.log("DISABLE SELECTION: "+J.description)}try{$$(".noClick").addEvent("click",function(N){N.stop()})}catch(J){dbug.log("DISABLE LINKS: "+J.description)}try{if($("form_contact")){new FormCheck("form_contact",{display:{showErrors:1,errorsLocation:1,indicateErrors:2,keepFocusOnError:0,closeTipsButton:1,checkValueIfEmpty:0,tipsOffsetX:-45}})}}catch(J){dbug.log("CONTACT FORM: "+J.description)}try{if($("directions")){function j(){var P=new google.maps.LatLng(48.150626,11.530921);var S={zoom:14,center:P,mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},navigationControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},mapTypeId:google.maps.MapTypeId.ROADMAP};var O=new google.maps.Map($("map_canvas"),S);var U="Anfahrtsbeschreibung:";var T=new google.maps.InfoWindow({content:U});var R=new google.maps.MarkerImage("img/logo.png",new google.maps.Size(191,68),new google.maps.Point(0,0),new google.maps.Point(85,48));var V=new google.maps.MarkerImage("img/logo_shadow.png",new google.maps.Size(201,48),new google.maps.Point(0,0),new google.maps.Point(85,48));var Q=new google.maps.LatLng(48.150626,11.530921);var N=new google.maps.Marker({position:Q,map:O,icon:R,shadow:V,title:"HOFFMANNARCHITEKT",zIndex:3})}window.addEvent("load",j)}}catch(J){dbug.log("DIRECTIONS: "+J.description)}try{var L=$$("a.external");L.each(function(N){N.addEvent("click",function(O){O=new Event(O).stop();window.open(N.getProperty("href"),"_blank")})})}catch(J){dbug.log("Error in external link: "+J.description)}}};window.addEvent("domready",function(){site.start()});
