APP.standardEvents={e:function(a){if(!this.focused){this.addClass(a+"hover")}},l:function(a){var b=[a+"hover",a+"click"];if(!this.focused){b.include(a+"focus")}this.removeClasses(b)},f:function(a){this.focused=true;this.addClass(a+"focus")},b:function(a){this.focused=false;this.removeClasses([a+"hover",a+"focus",a+"click"])},c:function(a){this.addClass(a+"click")}};APP.Form={};APP.Form.toggleDefaultValue=function(a){if(!$defined(a)){return}$splat(a).each(function(b){var d=b.get("title");if(d&&d.clean()!=""){b.set("title","");var c=b.get("value");if(c.clean()==""){b.set("value",d)}b.addEvents({focus:function(f){if(this.value==d){this.value=""}},blur:function(f){if(this.value.clean()==""){this.value=d}}})}})};APP.Accordions=[];APP.Accordion=function(a){if(!$defined(a)){return}$splat(a).each(function(h,g){var e=g;var b=$(h).get("id");if(!b){var b="acc_"+Math.round(Math.random()*999);$(h).set("id",b)}var c=$(h).getElements(".acc-toggler").filter(function(i){return(!i.hasClass("acc-toggler_inactive"))});var d=$(h).getElements(".acc-element").filter(function(i){return(!i.hasClass("acc-element_inactive"))});if(c.length==d.length){var j={display:-1,alwaysHide:true,opacity:false,duration:200,show:-1,onActive:function(l,i){l.addClass("acc-toggler_current")},onBackground:function(l,i){l.removeClass("acc-toggler_current")}};var f=($defined(APP.documentUri.get("fragment")))?APP.documentUri.get("fragment"):null;var k=-1;c.each(function(n,m){if($chk(f)){var l=n.get("id");if(l&&$defined($(l))&&l==f){j.show=m}else{if(f==m){j.show=m}}}else{if(n.hasClass("acc-toggler_current")){j.show=m}}n.addEvents({mouseenter:APP.standardEvents.e.bind(n,"acc-toggler_"),mouseleave:APP.standardEvents.l.bind(n,"acc-toggler_")})});APP.Accordions[b]=new Fx.Accordion(c,d,j)}})};APP.Gallery=function(){if($defined($("gallery_of_references"))){var c=$("gallery_of_references");var a=c.getElements(".gofr-item");var d=c.getElement(".gofr-buttons").getElements("span");a.each(function(h,e){var f=h.getElement(".text");var g=f.getElement("div");if($defined(g)){g.setStyles({opacity:0.9,"margin-top":(e>0)?f.getSize().y:0});h.caption=g;h.caption_margin=f.getSize().y}else{h.caption=null}});var b=new SimpleCarousel(c,a,d,{slideInterval:8000,rotateAction:"click",buttonOnClass:"current",buttonOffClass:"",onShowSlide:function(f){var e=(f==0)?a.length-1:(f-1);a[e].caption.morph({"margin-top":a[e].caption_margin});c.morph({height:a[f].getSize().y});(function(){a[f].caption.morph({"margin-top":0})}).delay(2000)}});new Element("div",{"class":"gofr-overlay",html:"&nbsp;",events:{click:function(){this.pause=!this.pause;if(this.pause){this.addClass("gofr-overlay_pause");b.stop()}else{this.removeClass("gofr-overlay_pause");b.rotate();b.autoplay()}},mouseenter:function(){this.morph({opacity:0.9})},mouseleave:function(){if(!this.pause){this.morph({opacity:0.6})}}}}).inject(c).setOpacity(0.6)}};APP.Tips=[];APP.Tip={add:function(b){var a=b.filter(function(c){return($defined(c.selector)&&c.selector!="")?true:false});a.each(function(d,c){APP.Tips["ttips"+c.capitalize()]=new Tips([],$merge({className:"ttips-"+c.toLowerCase(),offsets:{x:20,y:10},onShow:function(e){e.setStyle("opacity",0.8)},onHide:function(e){e.setStyle("opacity",0)}},d.options||{}));$$(d.selector).each(function(g){var f="";var e="";var i=($chk(g.get("title")))?g.get("title").clean():null;if(i){if(i.contains("::")){var h=$A(i.split("::"));if(h.length>1){f=h[0].clean();e=h[1].clean()}else{e=h[0].clean()}}else{e=i.clean()}if(f!=""||e!=""){g.store("tip:title",f);g.store("tip:text",e);APP.Tips["ttips"+c.capitalize()].attach(g)}g.set("title","")}})});this.cleanupInlineEl(a)},cleanupInlineEl:function(b){var a=b.getKeys();b.each(function(d,c){$$(d.selector).each(function(e){a.each(function(f){if(f!=c){e.getElements(b.get(f).selector).each(function(g){APP.Tips["ttips"+f.capitalize()].detach(g)})}})})})}};APP.Calendar={single:function(c,a){if(!$defined(c)){return}if(!$defined(a)){a={}}var b=$merge({days:APP.options.translation.shortDayField,months:APP.options.translation.shortMonthField,navigation:2,direction:0,tweak:{x:3,y:3},fadeDuration:150},a);$splat(c).each(function(d){var f=d.getProperty("id").clean();var e=new Array();e[f]="d.m.Y";new Calendar(e,b)})},multi:function(h,c){if(!$defined(h)){return}if(!$defined(c)){c={}}h=$splat(h);if(h.length==1){APP.Calendar.single(h,c)}var e=h.length;var d=$merge({days:APP.options.translation.shortDayField,months:APP.options.translation.shortMonthField,navigation:2,blocked:[],pad:0,tweak:{x:3,y:3},fadeDuration:150},c);for(var b=0;b<e;(b+=2)){if($defined(h[(b+1)])){var a=h[b].getProperty("id");var g=h[(b+1)].getProperty("id");var f=new Array();f[a]="d.m.Y";f[g]="d.m.Y";new Calendar(f,d)}}}};APP.ParseOpacity=function(d){for(var b=0;b<=10;b++){if($defined(d)){var a=$(d).getElements(".set-opacity_"+b).setOpacity(b/10)}else{var a=$$(".set-opacity_"+b)}a.setOpacity(b/10)}};APP.WinScrollTo=function(a){if($defined(APP.CurrentWin)&&$defined($(a))){APP.CurrentWin.toElement($(a))}};APP.Init=function(){APP.documentUri=new URI(document.location);$$("#MainMenu>li").each(function(b,a){b.addEvents({mouseover:function(c){this.addClass("hover")},mouseout:function(c){this.removeClass("hover")},focus:function(c){this.fireEvent("mouseover")},blur:function(c){this.fireEvent("mouseout")}})});APP.CurrentWin=new Fx.Scroll(window,{wait:false,duration:700,transition:Fx.Transitions.Quad.easeInOut});APP.Gallery();APP.Form.toggleDefaultValue($$("input.add-default"));APP.Accordion($$(".type-accordion, .add-accordion"));APP.ParseOpacity();APP.Tip.add(new Hash({light:{selector:".tooltip",options:{className:"tooltipsEnabled",offsets:{x:14,y:6}}},dark:{selector:".tooltip2",options:{className:"tooltipsEnabled2",offsets:{x:14,y:6}}}}))};window.addEvent("domready",APP.Init);
