(function(){if(window.jspackager&&jspackager.jsPath!==undefined&&jspackager.devmode){var curScript=jspackager.jsList["_extra-behaviour"];if(curScript&&curScript.length){for(var j=0,leng=curScript.length;j<leng;j++){if(jspackager.querys['mgnl']){curScript[j]=curScript[j].replace(/\./g,'-');}document.write('<script src="'+jspackager.jsPath+curScript[j]+'.js"><\/script>');}}}})();;if(!window.jspackager || !jspackager.devmode) {(function(b){b.imgPreLoad=function(){function f(a,d){var e=window.Image?new Image:document.createElement("img"),h=function(e){var h=arguments;clearTimeout(i);b(this).unbind("load error");a[1].apply(this,h);d.apply(this,h)};e.src=a[0];e.complete?h.call(e,{type:"cacheLoad"}):(clearTimeout(i),i=setTimeout(function(){h.call(e,{type:"timeouterror"})},l),b(e).bind("load error",h))}function c(){if(a.length&&d){e=!0;var b=a.shift();f(b,c)}else e=!1}function g(){h&&(d=!0,c())}var a=[],d=!1,e=!1,h=!1,l=5E3,
i;return{add:function(b,h,g){b=[b,h||function(){}];g?a.unshift(b):a.push(b);d&&!e&&c()},loadNow:function(a,b){d=e=!1;f([a,b||function(){}],g)},ready:function(){d=h=!0;c()}}}();b.windowLoaded?b.imgPreLoad.ready():b(window).bind("load",b.imgPreLoad.ready)})(jQuery);(function(b){var f={};b.each({disable:["-1","true","addClass"],enable:["0","false","removeClass"]},function(c,a){f[c]=function(){var d=b(this);d.is("span, div")||d.attr({tabindex:a[0],"aria-disabled":a[1]});d[a[2]]("ui-disabled")}});b.createUrlIndex=function(c,a){function d(b,d){clearTimeout(a.slideshowTimer);a.slideshowTimer=setTimeout(function(){a.loadNext({type:"slideshow"})||(e.carousel||d?a.loadIndex(0,{type:"slideshow"}):a.pause())},b||0)}var e=a.options;e.srcAttribute=e.srcAttribute||"href";
a.uniqueUrls=[];a.uniqueOpeners=[];c.each(function(){var d=b(this).attr(e.srcAttribute);b.inArray(d,a.uniqueUrls)===-1&&(a.uniqueUrls.push(d),a.uniqueOpeners.push(this))});a.nextBtn=b(".next",a.element);a.prevBtn=b(".prev",a.element);a.playPauseBtn=b(".play-pause",a.element);b.support.waiAria&&a.nextBtn.add(a.prevBtn).add(a.playPauseBtn).each(function(){b.nodeName(this,"a")&&b(this).removeAttr("href").attr({tabindex:"0"})});a.currentIndexDisplay=b(".current-index",a.element).html("1");a.lengthDisplay=
b(".item-length",a.element).html(a.uniqueUrls.length);a.play=function(b,c){if(!a.isPlaying)a.isPlaying=!0,a.playPauseBtn.addClass("ui-isplaying").html(e.pauseText),e.pauseTitle&&a.playPauseBtn.attr({title:e.pauseTitle}),d(b?e.slideshowDelay:0,c!==void 0?c:!0)};a.pause=function(){if(a.isPlaying)a.isPlaying=!1,a.playPauseBtn.addClass("ui-isplaying").html(e.playText),e.playTitle&&a.playPauseBtn.attr({title:e.playTitle}),clearTimeout(a.slideshowTimer)};a.playPauseToggle=function(b,d){a[a.isPlaying?"pause":
"play"](b,d);return!1};a.isPlaying=!1;a.uniqueUrls.length>1?(a.nextBtn.bind("ariaclick",function(b){a.loadNext(b);return!1}),a.prevBtn.bind("ariaclick",function(b){a.loadPrev(b);return!1}),a.playPauseBtn.bind("ariaclick",function(){a.playPauseToggle(void 0,!0);return!1}),e.addKeyNav&&a.element.bind("keydown",function(d){var e;switch(d.keyCode){case b.ui.keyCode.LEFT:e=a.loadPrev(d);break;case b.ui.keyCode.RIGHT:e=a.loadNext(d);break;case b.ui.keyCode.SPACE:a.playPauseToggle()}return e})):(e.controlsWrapper&&
b(e.controlsWrapper,a.element).hide(),a.prevBtn.hide(),a.nextBtn.hide(),a.playPauseBtn.hide());a.uniqueOpeners=b(a.uniqueOpeners);a.updateIndex=function(d){var c={disable:b([]),enabled:b([])};a.currentUrl=d;a.currentIndex=b.inArray(d,a.uniqueUrls);a.currentAnchor=a.uniqueOpeners.filter(":eq("+a.currentIndex+")");a.currentIndexDisplay.html(String(a.currentIndex+1));if(a.currentIndex===0){if(!e.carousel)c.disable=a.prevBtn.each(f.disable);a._trigger("indexStartEndReachedChange",{type:"indexStartReached"},
a.ui(c))}else if(a.prevBtn.hasClass("ui-disabled"))c.enable=a.prevBtn.each(f.enable),a._trigger("indexStartEndReachedChange",{type:"indexStartReachedChanged"},a.ui(c));if(a.uniqueUrls.length<=a.currentIndex+1){if(!e.carousel)a.pause(),c.disable=a.nextBtn.each(f.disable);a._trigger("indexStartEndReachedChange",{type:"indexEndReached"},a.ui(c))}else if(a.nextBtn.hasClass("ui-disabled"))c.enable=a.nextBtn.each(f.enable),a._trigger("indexStartEndReachedChange",{type:"indexEndReachedChanged"},a.ui(c))};
a.loadIndex=function(c,g){typeof c==="string"&&c*1!==c&&(c=b.inArray(c,a.uniqueUrls));if(c===a.currentIndex||c===-1)return!1;var f=a.uniqueOpeners.filter(":eq("+c+")"),k=a.currentAnchor,j,n,m;return f[0]?(j=f.attr(e.srcAttribute),n=j.split("?")[0],m=f.attr("type"),m=[m,(m||"").split("/")],g=g||{type:"loadIndex"},a.updateIndex(j),a.element.addClass("loading"),a.mask&&a.mask.addClass("loading-mask"),e.hideContentAnim(a,g,{oldAnchor:k,index:c,opener:f,content:a.content}),e.addLiveRegion&&b("div.content-box",
a.element).attr({"aria-busy":"true"}),b.each(b.createUrlIndex.mmContent.types,function(p,o){if(o.filter(j,f,n,m))return o.load(j,f,a,function(){var j={oldAnchor:k,index:c,opener:f};j.content=a.content;a.options.getTextContent(f,a.content,a);e.showContentAnim(a,a.content["multimedia-box"],g,j);a._trigger("indexChange",g,j);a.element.queue(function(){a.element.removeClass("loading");a.mask&&a.mask.removeClass("loading-mask");a.element.dequeue()});a.isPlaying&&d(e.slideshowDelay);e.addLiveRegion&&b("div.content-box",
a.element).attr({"aria-live":"polite","aria-busy":"false"});b.ui.SR.update()}),!1}),!0):!1};a.loadNext=function(b){var d=a.loadIndex(a.currentIndex+1,b);d===!1&&e.carousel&&(d=a.loadIndex(0,b));return d};a.loadPrev=function(b){var d=a.loadIndex(a.currentIndex-1,b);d===!1&&e.carousel&&(d=a.loadIndex(a.uniqueOpeners.length-1,b));return d}};b.createUrlIndex.mmContent={types:{},add:function(b,a){this.types[b]=a}};var c=/\.jpg$|\.jpeg$|\.gif$|\.png$/i;b.createUrlIndex.mmContent.add("img",{filter:function(b,
a,d,e){return e[1][0]==="image"||a.is(".img, .image, .picture")?!0:c.test(d)},load:function(c,a,d,e){var h=d.instance||d;b.imgPreLoad.loadNow(c,function(){var a=this.width,f=b(this);if(d.extras)d.extras.mm=f;h.content={"multimedia-box":f};e(c,a)})}})})(jQuery);(function(b){b.widget("ui.gallery",{options:{srcAttribute:"href",openerSel:"dl.photo a",bindStyle:"bind",getTextContent:function(f,c){c["text-content"]=b("dd",b(f).closest("dl")).html()},selectedIndex:0,withStageNav:!0,showContentAnim:function(f,c){var g=b('<div class="gallery-stage-box"><div class="multimedia-box"></div><div class="multimedia-description">'+f.content["text-content"]+"</div></div>").find("div.multimedia-box").html(c).end(),c=g.find("img");b("div.gallery-stage",f.element).append(g.css({opacity:0}));
c.css(b.objScale.constrainObjTo(c,g.find("div.multimedia-box")));g.fadeTo(300,1)},hideContentAnim:function(f,c,g){g.oldAnchor&&b("div.gallery-stage-box",f.element).fadeOut(300,function(){b(this).remove()})}},_create:function(){var f=this.options,c=this;this.openers=b(f.openerSel,this.element);b.createUrlIndex(this.openers,this);this.openers.bind("click",function(b){c._loadOpener(b);return!1});this._trigger("init",{},{instance:this});this._loadOpener({currentTarget:this.openers.eq(b.isFunction(f.selectedIndex)?
f.selectedIndex.call(this):f.selectedIndex)[0]})},_loadOpener:function(f){if(f&&f.currentTarget)return this.openers.removeClass("js-active"),this.loadIndex(b(f.currentTarget).addClass("js-active").attr(this.options.srcAttribute)),!1},ui:function(f){return b.extend({},{instance:this},f)}})})(jQuery);(function(b){function f(c,g){var a=g.options,d=b(document),e;a.followScroll&&b(window).bind("scroll."+this.id+" resize."+this.id,function(){b(window).height()>c.height()&&(clearTimeout(e),e=setTimeout(function(){c.animate({top:d.scrollTop()})},400))})}b.addOuterDimensions=function(c,g,a){var d=a==="height"?["Top","Bottom"]:["Left","Right"];b.each(["padding","border","margin"],function(a,b){b!=="border"?(g+=parseInt(c.css(b+d[0]),10)||0,g+=parseInt(c.css(b+d[1]),10)||0):(g+=parseInt(c.css(b+d[0]+"Width"),
10)||0,g+=parseInt(c.css(b+d[1]+"Width"),10)||0)});return g};b.ui.cOverlay.posMethods.centerHorizontalView=function(c,g,a,d){var g=d.options,a=b(document),e;if(!b.objScale)return setTimeout(function(){throw"please install the objScale plugin";},0),{};e=b.objScale.centerObjTo(c,b(window),g.positionOpts);e.top=a.scrollTop();isFinite(g.marginTop)&&(e.top+=g.marginTop);e.left+=a.scrollLeft();f(c,d);return e};b.ui.cOverlay.posMethods.constrainInsideView=function(c,g,a,d){var e=d.options,g=b(document),
h={},l={};if(!b.objScale)return setTimeout(function(){throw"please install the objScale plugin";},0),{};e=b.objScale.constrainObjTo(c,b(window),e.positionOpts);b.swap(c[0],{position:"absolute",visibility:"hidden",display:"block"},function(){h=b.objScale.getDim(a.mm)});e.top+=g.scrollTop();e.left+=g.scrollLeft();l.width=h.width+e.widthSubtraction;l.height=h.height+e.heightSubtraction;a.mm.css&&a.mm.attr&&a.mm[0]&&!b.nodeName(a.mm[0],"object")&&a.mm.css(l).attr(l);delete e.widthSubtraction;delete e.heightSubtraction;
f(c,d);return e};b.ui.cOverlay.posMethods.constrainHorizontalView=function(c,g,a,d){c=b.ui.cOverlay.posMethods.constrainInsideView(c,g,a,d);c.top=b(document).scrollTop();return c};b.fn.showbox=function(c){c=b.extend({},b.fn.showbox.defaults,c);c.openerSel=this;b(c.structure).appendTo("body").bind("coverlayinit",function(c,a){var d=a.instance,e=d.options;b.createUrlIndex(d.openers,d);d.widthElement=d.element.is(e.widthElementSel)?d.element:b(d.options.widthElementSel,d.element);d.calcWidth=function(a,
d){for(var c=d||a[0].width,g=a;!g.is(e.widthElementSel)&&g[0];)c=b.addOuterDimensions(g,c,"width"),g=g.parent();return c}}).bind("coverlaybeforeshow",function(c,a){if(!a.extras.mm){var d=a.instance,e=a.extras.opener.attr("href"),f=e.split("?")[0];d.mask.addClass("loading-mask").mask("show");b.each(b.createUrlIndex.mmContent.types,function(b,i){if(i.filter(e,d.currentOpener,f))return i.load(e,d.currentOpener,a,function(b,e){d.options.getTextContent(d.currentOpener,d.content,d);d.fillContent();d.widthElement.css({width:d.calcWidth(a.extras.mm,
e)});d.stopShow=!1;d.updateIndex(b);d.show(c,a.extras);d._trigger("indexChange",c,{oldAnchor:null,index:d.currentIndex,opener:d.currentOpener,content:d.content});d.mask.removeClass("loading-mask")}),!1});d.stopShow=!0}}).bind("coverlayshow",function(b,a){var d=a.instance;d.options.slideShowAutostart&&d.play(!0)}).bind("coverlayhide",function(c,a){a.instance.pause();b("div.content-box",a.element).removeAttr("aria-live").removeAttr("aria-busy")}).cOverlay(c);return this};b.fn.showbox.defaults={mask:!0,
maskOpts:{fadeInTime:600},focusOnShow:"h1.showbox-title",addRole:"dialog",positionType:"centerHorizontalView",followScroll:!0,widthElementSel:".content-box",structure:'<div class="showbox"><div class="showbox-box"><div class="showbox-head"><h1 class="showbox-title"></h1><span class="showbox-toolbar"><a role="button" class="prev" href="#" /> <a role="button" class="next" href="#" /> <a class="play-pause" role="button" href="#" /> <span class="index-pagination"><span class="current-index" /> / <span class="item-length" /></span></span></div><div class="content-box"><div class="multimedia-box"></div><div class="text-content"></div></div> <a role="button" class="close-button" href="#">'+
b.i18n.getText("closeOverlay")+"</a></div></div>",getTextContent:function(b,g){g["text-content"]=b.attr("title")},addKeyNav:!0,addLiveRegion:!0,showContentAnim:function(c,g){var a=b("div.content-box",c.element);a.queue(function(){c.fillContent();c.widthElement.css({width:c.calcWidth(g)});a.fadeTo(300,1);a.dequeue()})},hideContentAnim:function(c){b("div.content-box",c.element).fadeTo(300,0)},controlsWrapper:".showbox-toolbar",slideShowAutostart:!1,slideshowDelay:4E3,playTitle:"",playText:"play",pauseText:"pause",
pauseTitle:""}})(jQuery);(function(b){b.widget("ui.galleryTeaser",{options:{},_create:function(){var f=this;this.element.bind("ariaclick",function(c){if(typeof b(this).attr("data-href")!=="undefined")return f.requestGallery(c),!1});b.manageAjax.create("Gallery",{queue:!0,cacheResponse:!0});b(window).bind("unload",function(){f.destroy()})},requestGallery:function(f){var c=this,f=b(f.target).closest("a").attr("data-href");b.manageAjax.add("Gallery",{dataType:"html",url:f,success:function(b){c.showGalleryOverlay(b)}});return!1},
showGalleryOverlay:function(f){var c;c=b("#pseudogalleryHolder")[0]?b("#pseudogalleryHolder"):b('<div id="pseudogalleryHolder"></div>').appendTo("body");c.html(f).css({position:"absolute",left:-999999,top:0});c.find("div.teaser-wrapper").scroller({moveStep:"atom4",addSubPixel:b.browser.lteIE6?4:0});b.createGallery(c);b("a.gallery-opener",c).trigger("click")},destroy:function(){b("#pseudogalleryHolder").remove();b.Widget.prototype.destroy.apply(this,arguments)}})})(jQuery);(function(b){function f(c,a){b('<div class="content-overlay tooltip"></div>').appendTo("body").cOverlay({openerSel:c,addRole:"tooltip",positionType:"around",positionOpts:{horizontal:"center",vertical:"bottom"},openEvent:"focusin mouseenter",closeEvent:"mouseleave focusout",hide:function(b,a){a.element.empty()},beforeShow:a})}function c(c,a,d){var c=b("div.teaser-wrapper",d.element[0]).data("scroller"),e=c.options.moveStep,e=e.substring(4,e.length)-0;b(a.target).is("span")&&(b("a.js-active",d.element).removeClass("js-active"),
d.currentAnchor.addClass("js-active"));d.currentIndex%e===0?c.moveTo("goTo"+d.currentIndex):d.currentIndex%e===e-1&&c.moveTo("goTo"+(d.currentIndex-(e-1)))}b.createGallery=function(g){var a={getTextContent:function(a,c){var f=a.closest("dl"),g=b("img",f),i=b("dd.source",f).html(),k=b("dd.download",f).html();c["multimedia-box"].attr("alt",g.attr("alt"));c["text-content"]='<p class="title">'+b("dd.title",f).html()+(i===null?"":"<span>"+i+"</span>")+(k===null?"":'<a href="'+a.attr("href")+'">'+k+"</a>")+
"</p>"},showContentAnim:function(a,c){var f=b('<div class="gallery-stage-box"><div class="multimedia-box"></div><div class="multimedia-description">'+a.content["text-content"]+"</div></div>").find("div.multimedia-box").html(c).end(),c=f.find("img");b("div.gallery-stage",a.element).append(f.css({opacity:0}));c.css(b.objScale.scaleObjTo(c,f.find("div.multimedia-box"),{scaleToFit:c[0].height<c[0].width}));b("div.multimedia-description",f).css({bottom:b("div.multimedia-description",f).outerHeight(!0)*
-1});f.fadeTo(300,1,function(){b("div.multimedia-description",f).delay(200).animate({bottom:0},{easing:"easeInQuint"})})},hideContentAnim:function(a,c,f){f.oldAnchor&&b("div.gallery-stage-box",a.element).fadeOut(300,function(){b(this).remove()})},selectedIndex:function(){for(var a=0;this.openers.filter(":eq("+a+")").attr("tabindex")!==0;)a++;return a},openerSel:"dl.photo dt a"};b("div.photo-index",g).bind("galleryinit",function(a,e){e.instance.uniqueOpeners.bind("ariaclick",function(b){c(a,b,e.instance)});
b(".paging span",this).css({display:"block"}).bind("click",function(b){c(a,b,e.instance)}).bind("mouseenter mouseleave",function(a){b(this)[a.type==="mouseenter"?"addClass":"removeClass"](b(this).hasClass("prev")?"ui-active-prev":"ui-active-next")})}).gallery(b.extend({},a,{srcAttribute:"data-src"})).each(function(){var d=b(this),e=b('<div class="content-overlay gallery-overlay"><a href="#" class="close-button">'+b.i18n.getText("closeOverlay")+"</a></div>").prepend(d.clone()).appendTo("body").cOverlay({addRole:"dialog",
focusOnShow:!0,positionType:"centerInsideView",mask:!0,beforeShow:function(){if(g===document){var a=d.data("gallery").currentIndex,c=d.find("div.teaser-wrapper").data("scroller").beforeTeasers?d.find("div.teaser-wrapper").data("scroller").beforeTeasers.length:0,i=b("div.teaser-wrapper",e).data("scroller").beforeTeasers?b("div.teaser-wrapper",e).data("scroller").beforeTeasers.length:0,a=a-c+i;b("div.photo-index",e).data("gallery")._loadOpener({currentTarget:b("div.photo-index",e).data("gallery").openers.eq(a)[0]});
d.find("div.teaser-wrapper").data("scroller").updatePosition_Controls();f(b("div.tw-images dl.photo",e),function(a,c){c.extras&&c.extras.opener&&b(this).text(c.instance.currentOpener.find("dd.title").text())})}},animHide:function(a){if(g===document){var c=b("div.photo-index",e).data("gallery").currentIndex,f=b("div.teaser-wrapper",e).data("scroller").beforeTeasers?b("div.teaser-wrapper",e).data("scroller").beforeTeasers.length:0,k=d.find("div.teaser-wrapper").data("scroller").beforeTeasers?d.find("div.teaser-wrapper").data("scroller").beforeTeasers.length:
0,c=c-f+k;d.data("gallery")._loadOpener({currentTarget:d.data("gallery").openers.eq(c)[0]})}a.css({visibility:"hidden"})}});b('<a href="#" class="gallery-opener">'+b.attr(this,"data-gallery-open")+"</a>").prependTo(this).click(function(a){e.cOverlay("show",a);return!1});f("a.gallery-opener",function(a,c){c.extras&&c.extras.opener&&b(this).text(c.instance.currentOpener.text())});b("div.teaser-wrapper",e).scroller(b.extend({},d.find("div.teaser-wrapper").data("scroller").options,{moveStep:"atom6"}));
b("div.photo-index",e).bind("galleryinit",function(a,d){d.instance.uniqueOpeners.bind("ariaclick",function(b){c(a,b,d.instance)});b(".paging span",this).css({display:"block"}).bind("click",function(b){c(a,b,d.instance)}).bind("mouseenter mouseleave",function(a){b(this)[a.type==="mouseenter"?"addClass":"removeClass"](b(this).hasClass("prev")?"ui-active-prev":"ui-active-next")})}).gallery(a)})};b(function(){f("div.tw-images dl.photo",function(c,a){a.extras&&a.extras.opener&&b(this).text(a.instance.currentOpener.find("dd.title").text())});
b.createGallery(document);b("a.gallery-link").galleryTeaser()})})(jQuery);
}
