
Ext.ns('Ext.ux');Ext.ux.Carousel=Ext.extend(Ext.util.Observable,{interval:3,transitionDuration:1,transitionType:'carousel',transitionEasing:'easeOut',itemSelector:'img',activeSlide:0,autoPlay:false,showPlayButton:false,pauseOnNavigate:false,fadeInOnStartUp:true,wrap:false,loadedItems:[],freezeOnHover:true,navigationOnHover:false,hideNavigation:false,zIndex:500,width:null,height:null,constructor:function(elId,config){config=config||{};Ext.apply(this,config);Ext.ux.Carousel.superclass.constructor.call(this,config);this.addEvents('beforeprev','prev','beforenext','next','change','play','pause','freeze','unfreeze');this.el=Ext.get(elId);this.slides=this.els=[];if(this.autoPlay||this.showPlayButton){this.wrap=true;};if(this.autoPlay&&config.showPlayButton===undefined){this.showPlayButton=true;}
this.initMarkup();if(this.slides.length<=1){this.autoPlay=false;}
this.initEvents();if(this.carouselSize>0){this.refresh();}},initMarkup:function(){var dh=Ext.DomHelper;this.carouselSize=0;this.els.container=dh.append(this.el,{cls:'ux-carousel-container'},true);this.els.slidesWrap=dh.append(this.els.container,{cls:'ux-carousel-slides-wrap'},true);this.els.navigation=dh.append(this.els.container,{cls:'ux-carousel-nav'},true).hide();this.els.caption=dh.append(this.els.navigation,{tag:'h2',cls:'ux-carousel-caption'},true);this.els.navNext=dh.append(this.els.navigation,{tag:'a',href:'#',cls:'ux-carousel-nav-next'},true);if(this.showPlayButton){this.els.navPlay=dh.append(this.els.navigation,{tag:'a',href:'#',cls:'ux-carousel-nav-play'},true)}
this.els.navPrev=dh.append(this.els.navigation,{tag:'a',href:'#',cls:'ux-carousel-nav-prev'},true);this.slideWidth=(this.width==null)?this.el.getWidth(true)
-1:this.width;this.slideHeight=(this.height==null)?this.el.getHeight(true)
-1:this.height;this.els.container.setStyle({width:(this.slideWidth)+'px',height:(this.slideHeight)+'px'});if(!this.hideNavigation){this.els.container.setStyle({height:(this.slideHeight+this.els.navigation.getHeight(true))
+'px'});this.els.navigation.setStyle({top:this.slideHeight+'px'});this.el.setStyle({height:(this.slideHeight+this.els.navigation.getHeight(true))
+'px',width:this.els.container.getWidth()+'px'});}
this.els.caption.setWidth((this.slideWidth
-(this.els.navNext.getWidth()*2)
-(this.showPlayButton?this.els.navPlay.getWidth():0)-20)
+'px')
var j=0;this.loadedItems[0]=0;var img1=[];for(img in this.files){if(Ext.isPrimitive(this.files[img])){this.loadedItems[j]=0;timeout=(Ext.isIE)?250:100;img1[j]=new Image();img1[j].onload=(function(e){(function(f){if(f==0){if(this.fadeInOnStartUp){this.slides[0].fadeIn({duration:1.5});}else{this.slides[0].setStyle({'visibility':'visible'});}}
this.loadedItems[e]=1;}).createDelegate(this,[e]).defer(timeout);}).createDelegate(this,[j]);img1[j].src=this.files[img];j++;dh.append(this.els.slidesWrap,{tag:'img',src:this.files[img]},true)}}
var c=0;this.el.select(this.itemSelector).appendTo(this.els.slidesWrap).each(function(item){item=item.wrap({cls:'ux-carousel-slide'});c++;this.slides.push(item);item.setWidth(this.slideWidth+'px').setHeight(this.slideHeight+'px');item.setStyle({'visibility':'hidden'});},this);this.carouselSize=this.slides.length;if(this.navigationOnHover){this.els.navigation.setStyle('top',(-1*this.els.navigation.getHeight())+'px');}
this.el.clip();},initEvents:function(){this.els.navPrev.on('click',function(ev){ev.preventDefault();var target=ev.getTarget();target.blur();if(Ext.fly(target).hasClass('ux-carousel-nav-disabled'))
return;this.prev();},this);this.els.navNext.on('click',function(ev){ev.preventDefault();var target=ev.getTarget();target.blur();if(Ext.fly(target).hasClass('ux-carousel-nav-disabled'))
return;this.next();},this);if(this.showPlayButton){this.els.navPlay.on('click',function(ev){ev.preventDefault();ev.getTarget().blur();if(this.playing){this.pause();}else{this.play();}},this);};if(this.freezeOnHover){this.els.container.on('mouseenter',function(){if(this.playing){this.fireEvent('freeze',this.slides[this.activeSlide]);Ext.TaskMgr.stop(this.playTask);}},this);this.els.container.on('mouseleave',function(){if(this.playing){this.fireEvent('unfreeze',this.slides[this.activeSlide]);Ext.TaskMgr.start(this.playTask);}},this,{buffer:(this.interval/2)*1000});};if(this.navigationOnHover){this.els.container.on('mouseenter',function(){if(!this.navigationShown){this.navigationShown=true;this.els.navigation.stopFx(false).shift({y:this.els.container.getY(),duration:this.transitionDuration})}},this);this.els.container.on('mouseleave',function(){if(this.navigationShown){this.navigationShown=false;this.els.navigation.stopFx(false).shift({y:this.els.navigation.getHeight()
-this.els.container.getY(),duration:this.transitionDuration})}},this);}
if(this.interval&&this.autoPlay){this.play();};},prev:function(){if(this.fireEvent('beforeprev')===false){return;}
if(this.pauseOnNavigate){this.pause();}
this.setSlide(this.activeSlide-1);this.fireEvent('prev',this.activeSlide);return this;},next:function(){if(this.fireEvent('beforenext')===false){return;}
if(this.pauseOnNavigate){this.pause();}
this.setSlide(this.activeSlide+1);this.fireEvent('next',this.activeSlide);return this;},play:function(){if(!this.playing){this.playTask=this.playTask||{run:function(){this.playing=true;this.setSlide(this.activeSlide+1);},interval:this.interval*1000,scope:this};this.playTaskBuffer=this.playTaskBuffer||new Ext.util.DelayedTask(function(){Ext.TaskMgr.start(this.playTask);},this);this.playTaskBuffer.delay(this.interval*1000);this.playing=true;if(this.showPlayButton)
this.els.navPlay.addClass('ux-carousel-playing');this.fireEvent('play');}
return this;},pause:function(){if(this.playing){Ext.TaskMgr.stop(this.playTask);this.playTaskBuffer.cancel();this.playing=false;this.els.navPlay.removeClass('ux-carousel-playing');this.fireEvent('pause');}
return this;},clear:function(){this.els.slidesWrap.update('');this.slides=[];this.carouselSize=0;this.pause();return this;},add:function(el,refresh){var item=Ext.fly(el).appendTo(this.els.slidesWrap).wrap({cls:'ux-carousel-slide'});item.setWidth(this.slideWidth+'px').setHeight(this.slideHeight+'px');this.slides.push(item);if(refresh){this.refresh();}
return this;},refresh:function(){this.carouselSize=this.slides.length;this.els.slidesWrap.setWidth((this.slideWidth*this.carouselSize)+'px');if(this.carouselSize>0){if(!this.hideNavigation)
this.els.navigation.show();this.activeSlide=0;this.setSlide(0,true);}
return this;},setSlide:function(index,initial){if(!this.wrap&&!this.slides[index]){return;}else if(this.wrap){if(index<0){index=this.carouselSize-1;}else if(index>this.carouselSize-1){index=0;}}
if(!this.slides[index]){return;}
if(!initial&&!this.loadedItems[index]){return;}
this.els.caption.update(this.slides[index].child(':first-child',true).title||'');var offset=index*this.slideWidth;if(!initial){switch(this.transitionType){case'fade':this.slides[index].setOpacity(0);this.slides[this.activeSlide].stopFx(false).fadeOut({duration:this.transitionDuration/2,callback:function(){this.els.slidesWrap.setStyle('left',(-1*offset)
+'px');this.slides[this.activeSlide].setOpacity(1);this.slides[index].fadeIn({duration:this.transitionDuration/2});},scope:this})
break;case'scroll':var xNew=(-1*offset)
+this.els.container.getX();this.els.slidesWrap.stopFx(false);this.els.slidesWrap.shift({duration:this.transitionDuration,x:xNew,easing:this.transitionEasing});this.slides[this.activeSlide].setOpacity(1);break;case'blend':this.slides[this.activeSlide].setOpacity(1);this.slides[index].setOpacity(0);this.slides[this.activeSlide].setStyle({zIndex:this.zIndex});this.zIndex=this.zIndex+1;this.slides[index].setStyle({zIndex:this.zIndex});this.slides[index].stopFx(false).fadeIn({duration:this.transitionDuration/2,callback:function(){},scope:this})
break;default:var xNew=(-1*offset)
+this.els.container.getX();this.els.slidesWrap.stopFx(false);this.els.slidesWrap.shift({duration:this.transitionDuration,x:xNew,easing:this.transitionEasing});break;}}else{this.els.slidesWrap.setStyle('left','0');switch(this.transitionType){case'blend':for(i=0;i<this.slides.length;i++){this.slides[i].setStyle({'position':'absolute'});this.zIndex=this.zIndex-1;this.slides[index].setStyle({zIndex:this.zIndex});}
break;default:break;}}
this.activeSlide=index;this.updateNav();this.fireEvent('change',this.slides[index],index);},updateNav:function(){this.els.navPrev.removeClass('ux-carousel-nav-disabled');this.els.navNext.removeClass('ux-carousel-nav-disabled');if(!this.wrap){if(this.activeSlide===0){this.els.navPrev.addClass('ux-carousel-nav-disabled');}
if(this.activeSlide===this.carouselSize-1){this.els.navNext.addClass('ux-carousel-nav-disabled');}}}});Ext.ns('Ext.ux');Ext.ux.CarouselExt=Ext.extend(Ext.util.Observable,{size:'m',autoplay:'false',lightview:true,loaded:false,data:{},constructor:function(elId,config){this.el=Ext.get(elId);config=config||{};Ext.apply(this,config);Ext.ux.CarouselExt.superclass.constructor.call(this,config);this.photoTemplate=new Ext.Template(['<a href="{href}" class="lightbox" title="{alternative}">','<img src="{src}" >','</a>']);var CarouselImages=[];Ext.each(this.data,function(item){CarouselImages.push(item.src)},this);this.carousel=new Ext.ux.Carousel(elId,{interval:5,itemSelector:'a.lightbox',showPlayButton:true,pauseOnNavigate:true,transitionType:'blend',autoPlay:true,fadeInOnStartUp:false,files:CarouselImages});this.carousel.on('click',this.loadPhotos,this);this.updatePhotos();},updatePhotos:function(){this.carousel.clear();Ext.each(this.data,function(item){if(item.alternative==null){delete(item.alternative);}
this.carousel.add(this.photoTemplate.append(this.el,item));},this);this.carousel.refresh();}});Ext.ns('Ext.ux');Ext.ux.Global=Ext.extend(Ext.util.Observable,{constructor:function(){if(Ext.get('img-subline')!=null){Ext.get('img-subline').setOpacity(0.7);}
Ext.select('a').each(function(el){el.on("focus",function(e){Ext.get(e.target).blur();});});Ext.select('a.videoclick').each(function(el){el.on("click",function(ev){Ext.select('div.video').each(function(el){Ext.get(el).setStyle({display:'none'});});Ext.get(ev.target.id+'_v').setStyle({display:'block'});});});var maxHi=0;Ext.select('div.indexitem').each(function(el){maxHi=el.getHeight()>maxHi?maxHi=el.getHeight():maxHi=maxHi;});Ext.select('div.indexitem').each(function(el){el.setStyle({height:(maxHi)+'px'})});}});Ext.ns('Ext.ux');Ext.ux.extbox=(function(){var els={},items=[],activeItem,extboxBorders=[],interfaceWidth,interfaceHeight,currentWidth=250,currentHeight=250,currentX,currentY,isImg=false,initialized=false,selectors=[],wrapper=false;return{version:'1.0',opts:{},defaults:{current:' {current} / {total} ',previous:'&#8592;',next:'&#8594;',close:'close',width:false,height:false,innerWidth:false,innerHeight:false,maxWidth:'90%',maxHeight:'90%',animate:true,scale:true,iframe:false,inline:false,resizeDuration:0.3,overlayOpacity:0.8,overlayDuration:0.2,hideInfo:false,easing:'easeOut',href:false,title:false},init:function(){if(!initialized){Ext.apply(this,Ext.util.Observable.prototype);Ext.util.Observable.constructor.call(this);this.addEvents('open','close');this.initMarkup();this.initEvents();initialized=true;}},initMarkup:function(){els.overlay=Ext.DomHelper.insertFirst(document.body,{id:'ux-extbox-overlay'},true);els.overlay.setVisibilityMode(Ext.Element.DISPLAY).hide();if(Ext.isIE6){els.shim=Ext.DomHelper.insertFirst(document.body,{tag:'iframe',id:'ux-extbox-shim',frameborder:0},true);els.shim.setVisibilityMode(Ext.Element.DISPLAY);els.shim.hide();}
var extboxTpl=new Ext.Template(this.getTemplate());els.extbox=extboxTpl.insertAfter(els.overlay,{},true);els.extbox.setVisibilityMode(Ext.Element.DISPLAY).hide();var ids=['container','content','loadingOverlay','loading','navPrev','navNext','navClose','info','title','current'];Ext.each(ids,function(id){els[id]=Ext.get('ux-extbox-'+id);});extboxBorders=[(els.extbox.getPadding('t')+els.extbox.getBorderWidth('t')),(els.extbox.getPadding('r')+els.extbox.getBorderWidth('r')),(els.extbox.getPadding('b')+els.extbox.getBorderWidth('b')),(els.extbox.getPadding('l')+els.extbox.getBorderWidth('l'))];interfaceWidth=els.container.getPadding('rl')
+els.container.getBorderWidth('rl')
+els.content.getPadding('rl')
+els.content.getBorderWidth('rl')
+parseInt(els.container.getStyle('margin-left'),10)
+parseInt(els.container.getStyle('margin-right'),10);interfaceHeight=els.container.getPadding('tb')
+els.container.getBorderWidth('tb')
+els.content.getPadding('tb')
+els.content.getBorderWidth('tb')
+parseInt(els.container.getStyle('margin-top'),10)
+parseInt(els.container.getStyle('margin-bottom'),10);els.extbox.setStyle({width:currentWidth+'px',height:currentHeight+'px'});if(wrapper){this.wrapBox();}},getTemplate:function(){return['<div id="ux-extbox">','<div id="ux-extbox-container">','<div id="ux-extbox-content">','</div>','<div id="ux-extbox-loadingOverlay">','<div id="ux-extbox-loading"></div>','</div>','<div id="ux-extbox-navPrev" class="ux-extbox-navPrev-out"></div>','<div id="ux-extbox-navNext" class="ux-extbox-navNext-out"></div>','<div id="ux-extbox-navClose" class="ux-extbox-navClose-out"></div>','<div id="ux-extbox-info">','<div id="ux-extbox-title"></div>','<div id="ux-extbox-current"></div>','</div>','</div>','</div>'];},initEvents:function(){var close=function(ev){ev.preventDefault();this.close();};els.overlay.on('click',close,this);els.navClose.on('click',close,this);els.extbox.on('click',function(ev){if(ev.getTarget().id=='ux-extbox'){this.close();}},this);els.navPrev.on('click',function(ev){ev.preventDefault();this.loadItem(activeItem-1);},this);els.navPrev.on('mouseover',function(ev){els.navPrev.addClass('ux-extbox-navPrev-in');els.navPrev.removeClass('ux-extbox-navPrev-out');},this);els.navPrev.on('mouseout',function(ev){els.navPrev.addClass('ux-extbox-navPrev-out');els.navPrev.removeClass('ux-extbox-navPrev-in');},this);els.navClose.on('mouseover',function(ev){els.navClose.addClass('ux-extbox-navClose-in');els.navClose.removeClass('ux-extbox-navClose-out');},this);els.navClose.on('mouseout',function(ev){els.navClose.addClass('ux-extbox-navClose-out');els.navClose.removeClass('ux-extbox-navClose-in');},this);els.navNext.on('mouseover',function(ev){els.navNext.addClass('ux-extbox-navNext-in');els.navNext.removeClass('ux-extbox-navNext-out');},this);els.navNext.on('mouseout',function(ev){els.navNext.addClass('ux-extbox-navNext-out');els.navNext.removeClass('ux-extbox-navNext-in');},this);els.navNext.on('click',function(ev){ev.preventDefault();this.loadItem(activeItem+1);},this);},register:function(sel,group,options){if(selectors.indexOf(sel)===-1){selectors.push(sel);Ext.fly(document).on('click',function(ev){var target=ev.getTarget(sel);if(target){ev.preventDefault();this.open(target,sel,group,options);}},this);}},open:function(item,sel,group,options){group=group||false;Ext.apply(this.opts,options,this.defaults);this.opts.resizeDuration=this.opts.animate?this.opts.resizeDuration:0;this.opts.overlayDuration=this.opts.animate?this.opts.overlayDuration:0;this.setViewSize();els.overlay.fadeIn({duration:this.opts.overlayDuration,endOpacity:this.opts.overlayOpacity,callback:function(){items=[];var index=0;if(!group){items.push([(this.opts.href||item.href),(this.opts.title||item.title)]);}else{var setItems=Ext.query(sel);Ext.each(setItems,function(item){if(item.href){items.push([item.href,item.title]);}});while(items[index][0]!=item.href){index++;}}
var pageScroll=Ext.fly(document).getScroll();var extboxTop=(Ext.lib.Dom.getViewportHeight()-currentHeight)/2+pageScroll.top;var extboxLeft=(Ext.lib.Dom.getViewportWidth()-currentWidth)/2+pageScroll.left;els.extbox.setStyle({top:extboxTop+'px',left:extboxLeft+'px'}).show();this.loadItem(index);this.updateControls();this.checkInfoVisibility();Ext.fly(window).on('resize',this.resizeWindow,this);this.fireEvent('open',items[index]);},scope:this});},setViewSize:function(){var viewSize=[Math.max(Ext.lib.Dom.getViewWidth(),Ext.lib.Dom.getDocumentWidth()),Math.max(Ext.lib.Dom.getViewHeight(),Ext.lib.Dom.getDocumentHeight())];if(Ext.isIE6){els.shim.setStyle({width:viewSize[0]+'px',height:viewSize[1]+'px'}).setOpacity(0).show();els.overlay.setStyle({width:viewSize[0]+'px',height:viewSize[1]+'px',position:'absolute'});}else{els.overlay.setStyle({width:viewSize[0]+'px',height:viewSize[1]+'px'});}},loadItem:function(index){var timeout,loadContent={};activeItem=index;this.disableKeyNav();if(this.opts.animate){els.loadingOverlay.show();els.loading.show();}
if(this.opts.inline){isImg=false;currentX=false;currentY=false;var cnt=Ext.query(this.opts.href);loadContent={tag:'div',id:'ux-extbox-loadedContent',html:cnt[0].innerHTML,style:{display:'none'}};Ext.DomHelper.overwrite(els.content,loadContent);this.resize();}else if(this.opts.iframe){isImg=false;currentX=false;currentY=false;loadContent={tag:'iframe',id:'ux-extbox-loadedContent',frameborder:0,src:items[activeItem][0],style:{display:'none'}};Ext.DomHelper.overwrite(els.content,loadContent);this.resize();}else if(this.isImage(items[activeItem][0])){var img=new Image();timeout=(Ext.isIE)?250:100;img.onload=(function(){currentX=img.width;currentY=img.height;(function(){this.resize(currentX,currentY)}).createDelegate(this).defer(timeout);if(Ext.isIE){img.style.msInterpolationMode='bicubic';}}).createDelegate(this);img.src=items[activeItem][0];loadContent={tag:'img',id:'ux-extbox-loadedContent',src:items[activeItem][0],style:{display:'none'}};Ext.DomHelper.overwrite(els.content,loadContent);}else{isImg=false;currentX=false;currentY=false;loadContent={tag:'div',id:'ux-extbox-loadedContent',style:{display:'none'}};Ext.Ajax.request({url:items[activeItem][0],method:'GET',success:function(response){loadContent.html=response.responseText;Ext.DomHelper.overwrite(els.content,loadContent);this.resize();},scope:this,failure:function(response){if(console)
console.dir(response);}});}
(function(){this.updateNav();if(this.opts.animate){els.loadingOverlay.hide();els.loading.hide();}
this.preloadImages();}).defer(this.opts.resizeDuration*1000,this);},resize:function(w,h){var c,x,y,cx,cy,cl,ct,loadedContent;var viewSize=this.getViewSize();var pageScroll=Ext.fly(document).getScroll();var maxW=this.setSize(this.opts.maxWidth,'x')-extboxBorders[3]
-extboxBorders[1]-interfaceWidth;var maxH=this.setSize(this.opts.maxWidth,'y')-extboxBorders[0]
-extboxBorders[2]-interfaceHeight;cx=w||this.opts.innerWidth;cy=h||this.opts.innerHeight;x=(cx)?cx:(this.opts.width)?this.opts.width
-extboxBorders[3]-extboxBorders[1]:maxW;y=(cy)?cy:(this.opts.height)?this.opts.height
-extboxBorders[0]-extboxBorders[2]:maxH;if(isImg&&this.opts.scale){if(x>maxW||y>maxH){c=maxH/y;if(c*x>maxW){c=maxW/x;x=maxW;y=c*y;}else{y=maxH;x=c*x;}}}else if(this.opts.scale){x=(x>maxW)?maxW:x;y=(y>maxH)?maxH:y;}
x=parseInt(x,10);y=parseInt(y,10);currentWidth=x+interfaceWidth+extboxBorders[1]
+extboxBorders[3];currentHeight=y+interfaceHeight+extboxBorders[0]
+extboxBorders[2];cl=((viewSize[0]-x-extboxBorders[1]-extboxBorders[3]-interfaceWidth)/2)
+pageScroll.left;ct=((viewSize[1]-y-extboxBorders[0]-extboxBorders[2]-interfaceHeight)/2)
+pageScroll.top;cl=(cl>0)?cl:0;ct=(ct>0)?ct:0;Ext.Fx.syncFx();els.extbox.shift({width:currentWidth,height:currentHeight,left:cl,top:ct,easing:this.opts.easing,duration:this.opts.resizeDuration,scope:this});els.content.shift({width:x,height:y,easing:this.opts.easing,duration:this.opts.resizeDuration,scope:this,callback:function(){this.updateDetails();}});loadedContent=Ext.get('ux-extbox-loadedContent');if(loadedContent!==null&&loadedContent.isVisible()){loadedContent.shift({width:x,height:y,easing:this.opts.easing,duration:this.opts.resizeDuration});}else{loadedContent.shift({width:x,height:y,easing:this.opts.easing,duration:this.opts.resizeDuration}).fadeIn({duration:this.opts.resizeDuration/2});}
Ext.Fx.sequenceFx();},resizeWindow:function(){this.setViewSize();this.resize(currentX,currentY);},updateDetails:function(){els.title.update(items[activeItem][1]);if(items[activeItem][1]==""){els.title.hide();}else{els.title.show();}
if(items.length>1){els.current.update(this.opts.current.replace(/\{current\}/,activeItem+1).replace(/\{total\}/,items.length));}else{els.current.update('');}},checkInfoVisibility:function(){if(this.opts.hideInfo=='auto'){els.extbox.on('mouseenter',this.showInfo,this);els.extbox.on('mouseleave',this.hideInfo,this);els.info.hide();}else if(this.opts.hideInfo===false){els.extbox.un('mouseenter',this.showInfo,this);els.extbox.un('mouseleave',this.hideInfo,this);els.info.show();}else if(this.opts.hideInfo===true){els.extbox.un('mouseenter',this.showInfo,this);els.extbox.un('mouseleave',this.hideInfo,this);els.info.hide();}},showInfo:function(){els.info.stopFx().fadeIn({duration:this.opts.resizeDuration});},hideInfo:function(){els.info.stopFx().fadeOut({duration:this.opts.resizeDuration});},updateControls:function(){els.navPrev.update(this.opts.previous);els.navNext.update(this.opts.next);els.navClose.update(this.opts.close);},updateNav:function(){this.enableKeyNav();if(activeItem<1){els.navPrev.hide();}else{els.navPrev.show();}
if(activeItem>=(items.length-1)){els.navNext.hide();}else{els.navNext.show();}},enableKeyNav:function(){Ext.fly(document).on('keydown',this.keyNavAction,this);},disableKeyNav:function(){Ext.fly(document).un('keydown',this.keyNavAction,this);},keyNavAction:function(ev){var keyCode=ev.getKey();if(keyCode==88||keyCode==67||keyCode==27){this.close();}else if(keyCode==80||keyCode==37){if(activeItem!=0){this.loadItem(activeItem-1);}}else if(keyCode==78||keyCode==39){if(activeItem!=(items.length-1)){this.loadItem(activeItem+1);}}},preloadImages:function(){var next,prev;if(items.length>activeItem+1){next=new Image();next.src=items[activeItem+1][0];}
if(activeItem>0){prev=new Image();prev.src=items[activeItem-1][0];}},close:function(){this.disableKeyNav();els.extbox.hide();els.overlay.fadeOut({duration:this.opts.overlayDuration});if(Ext.isIE6)
els.shim.hide();Ext.DomHelper.overwrite(els.content,'');Ext.DomHelper.overwrite(els.title,'');Ext.DomHelper.overwrite(els.current,'');Ext.fly(window).un('resize',this.resizeWindow,this);this.fireEvent('close',activeItem);},getViewSize:function(){return[Ext.lib.Dom.getViewWidth(),Ext.lib.Dom.getViewHeight()];},setSize:function(size,dimension){dimension=dimension==='x'?Ext.lib.Dom.getViewWidth():Ext.lib.Dom.getViewHeight();return(typeof size==='string')?Math.round((size.match(/%/)?(dimension/100)*parseInt(size,10):parseInt(size,10))):size;},isImage:function(url){isImg=url.match(/^.*\.(gif|png|jpg|jpeg|bmp)$/i)?true:false;return isImg;},wrapBox:function(){els.wrapper=els.container.wrap({tag:'div',id:'ux-extbox-trc'}).wrap({tag:'div',id:'ux-extbox-tlc'}).wrap({tag:'div',id:'ux-extbox-tb'}).wrap({tag:'div',id:'ux-extbox-brc'}).wrap({tag:'div',id:'ux-extbox-blc'}).wrap({tag:'div',id:'ux-extbox-bb'}).wrap({tag:'div',id:'ux-extbox-rb'}).wrap({tag:'div',id:'ux-extbox-lb'});}}})();Ext.onReady(Ext.ux.extbox.init,Ext.ux.extbox);Ext.ux.SimpleTip=Ext.extend(Ext.util.Observable,{el:null,constructor:function(element,config){Ext.apply(this,config||{});Ext.ux.SimpleTip.superclass.constructor.call(this);this.id=Ext.id();element.dom.id=Ext.id();this.el=Ext.get(element.dom.id);var domCfg={tag:"div",id:this.id,cls:"core-ux-quickTip",children:[{tag:"div",cls:"core-ux-quickTip-text",html:'<img src="'+this.el.getAttribute('over')+'" />'}]};Ext.DomHelper.append(Ext.getBody(),domCfg);this.el.on("mouseover",function(evt,target,opts){var target=Ext.get(target);var xy=target.getXY();var exy=evt.xy;Ext.get(this.id).show('backBoth');Ext.get(this.id).setXY([exy[0]+-5,exy[1]+-100]);},this);this.el.on("mouseout",function(evt,target,opts){Ext.get(this.id).hide();},this);this.task=new Ext.util.DelayedTask(function(){if(this.isVisible())
Ext.get(this.id).hide();},this);this.init();},init:function(){}});Ext.ns('Ext.ux');Ext.ux.Tabs=Ext.extend(Ext.util.Observable,{activeTab:0,constructor:function(navi,element,config){Ext.apply(this,config);Ext.ux.Tabs.superclass.constructor.call(this);this.addEvents('beforetabchange','tabchange');this.nav=Ext.get(navi);this.el=Ext.get(element);this.init();},init:function(){var me=this;this.el.addClass('ux-tabs-container');this.tabStrip=this.nav.child('ul');this.tabStrip.addClass('ux-tabs-strip');this.tabStrip.on('click',this.onStripClick,this,{delegate:'a'});this.tabs=this.tabStrip.select('> li');this.cards=this.el.select('> div');this.cardsContainer=this.el.createChild({cls:'ux-tabs-cards'});this.el.removeClass('tabs-content');this.cardsContainer.setWidth(this.el.getWidth());this.el.addClass('tabs-content');this.cards.addClass('ux-tabs-card');this.cards.appendTo(this.cardsContainer);this.el.createChild({cls:'ux-tabs-clearfix'});this.el.removeClass('tabs-content');this.setActiveTab(this.activeTab||0);},onStripClick:function(ev,t){if(t&&t.href&&t.href.indexOf('#')){ev.preventDefault();this.setActiveTab(t.href.split('#')[1]);}},setActiveTab:function(tab){var card;if(Ext.isString(tab)){card=Ext.get(tab);tab=this.tabStrip.child('a[href=#'+tab+']').parent();}else if(Ext.isNumber(tab)){tab=this.tabs.item(tab);card=Ext.get(tab.first().dom.href.split('#')[1]);}
if(tab&&card&&this.fireEvent('beforetabchange',tab,card)!==false){card.radioClass('ux-tabs-card-active');tab.radioClass('ux-tabs-tab-active active');this.fireEvent('tabchange',tab,card);}}});Ext.ns('Ext.ux.Form');Ext.ux.Form.inputText=Ext.extend(Ext.util.Observable,{el:{},msg:'',constructor:function(elId,msg){Ext.ux.Form.inputText.superclass.constructor.call(this,{});this.el=Ext.get(elId);this.msg=msg
this.initMarkup();this.initEvents();},initMarkup:function(){if(this.el.getValue()==''){this.el.dom.value=this.msg;}},initEvents:function(){this.el.on('focus',function(ev){if(this.el.getValue()==this.msg){this.el.dom.value='';}},this);this.el.on('blur',function(ev){if(this.el.getValue()==''){this.el.dom.value=this.msg;}},this);}});var datePickerController=(function datePickerController(){var debug=false,isOpera=Object.prototype.toString.call(window.opera)==="[object Opera]",isMoz=/mozilla/.test(navigator.userAgent.toLowerCase())&&!/(compatible|webkit)/.test(navigator.userAgent.toLowerCase()),languageInfo=parseUILanguage(),datePickers={},uniqueId=0,weeksInYearCache={},localeImport=false,nbsp=String.fromCharCode(160),describedBy="",nodrag=false,buttonTabIndex=true,returnLocaleDate=false,mouseWheel=true,cellFormat="d-sp-F-sp-Y",titleFormat="F-sp-d-cc-sp-Y",formatParts=isOpera?["placeholder"]:["placeholder","sp-F-sp-Y"],dividors=["dt","sl","ds","cc","sp"],dvParts="dt|sl|ds|cc|sp",dParts="d|j",mParts="m|n|M|F",yParts="Y|y",kbEvent=false,bespokeTitles={},finalOpacity=100,validFmtRegExp=/^((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|y]))(-((sp|dt|sl|ds|cc)|([d|D|l|j|N|w|S|W|M|F|m|n|t|Y|y])))*$/,rangeRegExp=/^((\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))$/,wcDateRegExp=/^(((\d\d\d\d)|(\*\*\*\*))((0[1-9]|1[012])|(\*\*))(0[1-9]|[12][0-9]|3[01]))$/;(function(){var scriptFiles=document.getElementsByTagName('script'),scriptInner=String(scriptFiles[scriptFiles.length
-1].innerHTML).replace(/[\n\r\s\t]+/g," ").replace(/^\s+/,"").replace(/\s+$/,""),json=parseJSON(scriptInner);if(typeof json==="object"&&!("err"in json)){affectJSON(json);};if(typeof(fdLocale)!="object"){script=null;}else{returnLocaleDate=true;};})();function parseUILanguage(){var languageTag=document.getElementsByTagName('html')[0].getAttribute('lang')||document.getElementsByTagName('html')[0].getAttribute('xml:lang');if(!languageTag){languageTag="en";}else{languageTag=languageTag.toLowerCase();};return languageTag.search(/^([a-z]{2,3})-([a-z]{2})$/)!=-1?[languageTag.match(/^([a-z]{2,3})-([a-z]{2})$/)[1],languageTag]:[languageTag];};function affectJSON(json){if(typeof json!=="object"){return;};for(key in json){value=json[key];switch(key.toLowerCase()){case"lang":if(value.search(/^[a-z]{2,3}(-([a-z]{2}))?$/i)!=-1){languageInfo=[value.toLowerCase()];returnLocaleDate=true;};break;case"nodrag":nodrag=!!value;break;case"buttontabindex":buttonTabIndex=!!value;break;case"mousewheel":mouseWheel=!!value;break;case"cellformat":if(typeof value=="string"&&value.match(validFmtRegExp)){parseCellFormat(value);};break;case"titleformat":if(typeof value=="string"&&value.match(validFmtRegExp)){titleFormat=value;};break;case"describedby":if(typeof value=="string"){describedBy=value;};break;case"finalopacity":if(typeof value=='number'&&(+value>20&&+value<=100)){finalOpacity=parseInt(value,10);};break;case"bespoketitles":bespokeTitles={};for(var dt in value){bespokeTitles[dt]=value[dt];};};};};function parseCellFormat(value){if(isOpera){formatParts=["placeholder"];cellFormat="j-sp-F-sp-Y";return;};var parts=value.split("-"),fullParts=[],tmpParts=[],part;for(var pt=0;pt<parts.length;pt++){part=parts[pt];if(part=="j"||part=="d"){if(tmpParts.length){fullParts.push(tmpParts.join("-"));tmpParts=[];};fullParts.push("placeholder");}else{tmpParts.push(part);};};if(tmpParts.length){fullParts.push(tmpParts.join("-"));};if(!fullParts.length||fullParts.length>3){formatParts=["placeholder","sp-F-sp-Y"];cellFormat="j-sp-F-sp-Y";return;};formatParts=fullParts;cellFormat=value;};function pad(value,length){length=length||2;return"0000".substr(0,length-Math.min(String(value).length,length))
+value;};function addEvent(obj,type,fn){try{if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event);};obj.attachEvent("on"+type,obj[type+fn]);}else{obj.addEventListener(type,fn,true);};}catch(err){}};function removeEvent(obj,type,fn){try{if(obj.detachEvent){obj.detachEvent("on"+type,obj[type+fn]);obj[type+fn]=null;}else{obj.removeEventListener(type,fn,true);};}catch(err){};};function stopEvent(e){e=e||document.parentWindow.event;if(e.stopPropagation){e.stopPropagation();e.preventDefault();};return false;};function parseJSON(str){if(typeof str!=='string'||str==""){return{};};try{if(typeof JSON==="object"&&JSON.parse){return window.JSON.parse(str);}else if(/lang|buttontabindex|mousewheel|cellformat|titleformat|nodrag|describedby/.test(str.toLowerCase())){var f=Function(['var document,top,self,window,parent,Number,Date,Object,Function,','Array,String,Math,RegExp,Image,ActiveXObject;','return (',str.replace(/<\!--.+-->/gim,'').replace(/\bfunction\b/g,'function'),');'].join(''));return f();};}catch(e){};if(debug){throw"Could not parse the JSON object";};return{"err":"Could not parse the JSON object"};};function setARIARole(element,role){if(element&&element.tagName){element.setAttribute("role",role);};};function setARIAProperty(element,property,value){if(element&&element.tagName){element.setAttribute("aria-"+property,value);};};function datePicker(options){this.dateSet=null;this.timerSet=false;this.visible=false;this.fadeTimer=null;this.timer=null;this.yearInc=0;this.monthInc=0;this.dayInc=0;this.mx=0;this.my=0;this.x=0;this.y=0;this.created=false;this.disabled=false;this.opacity=0;this.opacityTo=99;this.inUpdate=false;this.kbEventsAdded=false;this.fullCreate=false;this.selectedTD=null;this.cursorTD=null;this.cursorDate=options.cursorDate?options.cursorDate:"",this.date=options.cursorDate?new Date(+options.cursorDate.substr(0,4),+options.cursorDate.substr(4,2)-1,+options.cursorDate.substr(6,2)):new Date();this.defaults={};this.dynDisabledDates={};this.firstDayOfWeek=localeImport.firstDayOfWeek;this.interval=new Date();this.clickActivated=false;this.noFocus=true;this.kbEvent=false;this.disabledDates=false;this.enabledDates=false;this.delayedUpdate=false;this.bespokeTitles={};for(var thing in options){if(thing.search(/callbacks|formElements|formatMasks/)!=-1)
continue;this[thing]=options[thing];};for(var i=0,prop;prop=["callbacks","formElements","formatMasks"][i];i++){this[prop]={};for(var thing in options[prop]){this[prop][thing]=options[prop][thing];};};this.date.setHours(5);this.changeHandler=function(){o.setDateFromInput();o.callback("dateset",o.createCbArgObj());};this.createCbArgObj=function(){return this.dateSet?{"id":this.id,"date":this.dateSet,"dd":pad(this.date.getDate()),"mm":pad(this.date.getMonth()+1),"yyyy":this.date.getFullYear()}:{"id":this.id,"date":null,"dd":null,"mm":null,"yyyy":null};};this.getScrollOffsets=function(){if(typeof(window.pageYOffset)=='number'){return[window.pageXOffset,window.pageYOffset];}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){return[document.body.scrollLeft,document.body.scrollTop];}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){return[document.documentElement.scrollLeft,document.documentElement.scrollTop];};return[0,0];};this.reposition=function(){if(!o.created||o.staticPos){return;};o.div.style.visibility="hidden";o.div.style.left=o.div.style.top="0px";o.div.style.display="block";var osh=o.div.offsetHeight,osw=o.div.offsetWidth,elem=document.getElementById('fd-but-'+o.id),pos=o.truePosition(elem),trueBody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body,sOffsets=o.getScrollOffsets(),scrollTop=sOffsets[1],scrollLeft=sOffsets[0],fitsBottom=parseInt(trueBody.clientHeight
+scrollTop)>parseInt(osh+pos[1]+elem.offsetHeight
+2),fitsTop=parseInt(pos[1]
-(osh+elem.offsetHeight+2))>parseInt(scrollTop);o.div.style.visibility="visible";o.div.style.left=Number(parseInt(trueBody.clientWidth
+scrollLeft)<parseInt(osw+pos[0])?Math.abs(parseInt((trueBody.clientWidth+scrollLeft)
-osw)):pos[0])
+"px";o.div.style.top=(fitsBottom||!fitsTop)?Math.abs(parseInt(pos[1]+elem.offsetHeight+2))
+"px":Math.abs(parseInt(pos[1]-(osh+2)))+"px";};this.removeOldFocus=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td){try{td.setAttribute(!false?"tabIndex":"tabindex","-1");td.tabIndex=-1;td.className=td.className.replace(/date-picker-hover/,"");td.id="";td.onblur=null;td.onfocus=null;}catch(err){};};};this.addAccessibleDate=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td&&!(td.getElementsByTagName("span").length)){var ymd=td.className.match(/cd-([\d]{4})([\d]{2})([\d]{2})/),noS=(td.className.search(/date-picker-unused|out-of-range|day-disabled|no-selection|not-selectable/)!=-1),spn=document.createElement('span'),spnC;spn.className="fd-screen-reader";;while(td.firstChild)
td.removeChild(td.firstChild);if(noS){spnC=spn.cloneNode(false);spnC.appendChild(document.createTextNode(getTitleTranslation(13)));td.appendChild(spnC);};for(var pt=0,part;part=formatParts[pt];pt++){if(part=="placeholder"){td.appendChild(document.createTextNode(+ymd[3]));}else{spnC=spn.cloneNode(false);spnC.appendChild(document.createTextNode(printFormattedDate(new Date(ymd[1],+ymd[2]-1,ymd[3]),part,true)));td.appendChild(spnC);};};};};this.setNewFocus=function(){var td=document.getElementById(o.id+"-date-picker-hover");if(td){try{td.setAttribute(!false?"tabIndex":"tabindex","0");td.tabIndex=0;td.className=td.className.replace(/date-picker-hover/,"")
+" date-picker-hover";if(!this.clickActivated){td.onblur=o.onblur;td.onfocus=o.onfocus;};if(!isOpera&&!this.clickActivated)
o.addAccessibleDate();if(!this.noFocus&&!this.clickActivated){setTimeout(function(){try{td.focus();}catch(err){};},0);};}catch(err){};};};this.setCursorDate=function(yyyymmdd){if(String(yyyymmdd).search(/^([0-9]{8})$/)!=-1){this.date=new Date(+yyyymmdd.substr(0,4),+yyyymmdd.substr(4,2)
-1,+yyyymmdd.substr(6,2));this.cursorDate=yyyymmdd;if(this.staticPos){this.updateTable();};};};this.updateTable=function(noCallback){if(!o||o.inUpdate||!o.created)
return;o.inUpdate=true;o.removeOldFocus();if(o.timerSet&&!o.delayedUpdate){if(o.monthInc){var n=o.date.getDate(),d=new Date(o.date);d.setDate(2);d.setMonth(d.getMonth()+o.monthInc*1);d.setDate(Math.min(n,daysInMonth(d.getMonth(),d.getFullYear())));o.date=new Date(d);}else{o.date.setDate(Math.min(o.date.getDate()+o.dayInc,daysInMonth(o.date.getMonth()+o.monthInc,o.date.getFullYear()
+o.yearInc)));o.date.setMonth(o.date.getMonth()+o.monthInc);o.date.setFullYear(o.date.getFullYear()+o.yearInc);};};o.outOfRange();if(!o.noToday){o.disableTodayButton();};o.showHideButtons(o.date);var cd=o.date.getDate(),cm=o.date.getMonth(),cy=o.date.getFullYear(),cursorDate=(String(cy)+pad(cm+1)+pad(cd)),tmpDate=new Date(cy,cm,1);tmpDate.setHours(5);var dt,cName,td,i,currentDate,cellAdded,col,currentStub,abbr,bespokeRenderClass,spnC,dateSetD,weekDayC=(tmpDate.getDay()+6)%7,firstColIndex=(((weekDayC-o.firstDayOfWeek)+7)%7)
-1,dpm=daysInMonth(cm,cy),today=new Date(),stub=String(tmpDate.getFullYear())
+pad(tmpDate.getMonth()+1),cellAdded=[4,4,4,4,4,4],lm=new Date(cy,cm-1,1),nm=new Date(cy,cm+1,1),daySub=daysInMonth(lm.getMonth(),lm.getFullYear()),stubN=String(nm.getFullYear())
+pad(nm.getMonth()+1),stubP=String(lm.getFullYear())
+pad(lm.getMonth()+1),weekDayN=(nm.getDay()+6)%7,weekDayP=(lm.getDay()+6)%7,today=today.getFullYear()
+pad(today.getMonth()+1)+pad(today.getDate()),spn=document.createElement('span');o.firstDateShown=!o.constrainSelection&&o.fillGrid&&(0-firstColIndex<1)?String(stubP)
+(daySub+(0-firstColIndex)):stub+"01";o.lastDateShown=!o.constrainSelection&&o.fillGrid?stubN
+pad(41-firstColIndex-dpm):stub+String(dpm);o.currentYYYYMM=stub;bespokeRenderClass=o.callback("redraw",{id:o.id,dd:pad(cd),mm:pad(cm+1),yyyy:cy,firstDateDisplayed:o.firstDateShown,lastDateDisplayed:o.lastDateShown})||{};dts=o.getDates(cy,cm+1);o.checkSelectedDate();dateSetD=(o.dateSet!=null)?o.dateSet.getFullYear()+pad(o.dateSet.getMonth()+1)
+pad(o.dateSet.getDate()):false;spn.className="fd-screen-reader";if(this.selectedTD!=null){setARIAProperty(this.selectedTD,"selected",false);this.selectedTD=null;};for(var curr=0;curr<42;curr++){row=Math.floor(curr/7);td=o.tds[curr];spnC=spn.cloneNode(false);while(td.firstChild)
td.removeChild(td.firstChild);if((curr>firstColIndex&&curr<=(firstColIndex+dpm))||o.fillGrid){currentStub=stub;weekDay=weekDayC;dt=curr-firstColIndex;cName=[];selectable=true;if(dt<1){dt=daySub+dt;currentStub=stubP;weekDay=weekDayP;selectable=!o.constrainSelection;cName.push("month-out");}else if(dt>dpm){dt-=dpm;currentStub=stubN;weekDay=weekDayN;selectable=!o.constrainSelection;cName.push("month-out");};weekDay=(weekDay+dt+6)%7;cName.push("day-"
+localeDefaults.dayAbbrs[weekDay].toLowerCase());currentDate=currentStub+String(dt<10?"0":"")+dt;if(o.rangeLow&&+currentDate<+o.rangeLow||o.rangeHigh&&+currentDate>+o.rangeHigh){td.className="out-of-range";td.title="";td.appendChild(document.createTextNode(dt));if(o.showWeeks){cellAdded[row]=Math.min(cellAdded[row],2);};}else{if(selectable){td.title=titleFormat?printFormattedDate(new Date(+String(currentStub).substr(0,4),+String(currentStub).substr(4,2)
-1,+dt),titleFormat,true):"";cName.push("cd-"+currentDate+" yyyymm-"
+currentStub+" mmdd-"
+currentStub.substr(4,2)+pad(dt));}else{td.title=titleFormat?getTitleTranslation(13)
+" "
+printFormattedDate(new Date(+String(currentStub).substr(0,4),+String(currentStub).substr(4,2)
-1,+dt),titleFormat,true):"";cName.push("yyyymm-"+currentStub+" mmdd-"
+currentStub.substr(4,2)+pad(dt)
+" not-selectable");};if(currentDate==today){cName.push("date-picker-today");};if(dateSetD==currentDate){cName.push("date-picker-selected-date");setARIAProperty(td,"selected","true");this.selectedTD=td;};if(o.disabledDays[weekDay]||dts[currentDate]==0){cName.push("day-disabled");if(titleFormat&&selectable){td.title=getTitleTranslation(13)+" "
+td.title;};}
if(currentDate in bespokeRenderClass){cName.push(bespokeRenderClass[currentDate]);}
if(o.highlightDays[weekDay]){cName.push("date-picker-highlight");};if(cursorDate==currentDate){td.id=o.id+"-date-picker-hover";};td.appendChild(document.createTextNode(dt));td.className=cName.join(" ");if(o.showWeeks){cellAdded[row]=Math.min(cName[0]=="month-out"?3:1,cellAdded[row]);};};}else{td.className="date-picker-unused";td.appendChild(document.createTextNode(nbsp));td.title="";};if(o.showWeeks&&curr-(row*7)==6){while(o.wkThs[row].firstChild)
o.wkThs[row].removeChild(o.wkThs[row].firstChild);o.wkThs[row].appendChild(document.createTextNode(cellAdded[row]==4&&!o.fillGrid?nbsp:getWeekNumber(cy,cm,curr
-firstColIndex-6)));o.wkThs[row].className="date-picker-week-header"
+(["",""," out-of-range"," month-out",""][cellAdded[row]]);};};var span=o.titleBar.getElementsByTagName("span");while(span[0].firstChild)
span[0].removeChild(span[0].firstChild);while(span[1].firstChild)
span[1].removeChild(span[1].firstChild);span[0].appendChild(document.createTextNode(getMonthTranslation(cm,false)
+nbsp));span[1].appendChild(document.createTextNode(cy));if(o.timerSet){o.timerInc=50+Math.round(((o.timerInc-50)/1.8));o.timer=window.setTimeout(o.updateTable,o.timerInc);};o.inUpdate=o.delayedUpdate=false;o.setNewFocus();};this.destroy=function(){if(document.getElementById("fd-but-"+this.id)){document.getElementById("fd-but-"+this.id).parentNode.removeChild(document.getElementById("fd-but-"
+this.id));};if(!this.created){return;};removeEvent(this.table,"mousedown",o.onmousedown);removeEvent(this.table,"mouseover",o.onmouseover);removeEvent(this.table,"mouseout",o.onmouseout);removeEvent(document,"mousedown",o.onmousedown);removeEvent(document,"mouseup",o.clearTimer);if(window.addEventListener&&!window.devicePixelRatio){try{window.removeEventListener('DOMMouseScroll',this.onmousewheel,false);}catch(err){};}else{removeEvent(document,"mousewheel",this.onmousewheel);removeEvent(window,"mousewheel",this.onmousewheel);};o.removeOnFocusEvents();clearTimeout(o.fadeTimer);clearTimeout(o.timer);if(this.div&&this.div.parentNode){this.div.parentNode.removeChild(this.div);};o=null;};this.resizeInlineDiv=function(){o.div.style.width=o.table.offsetWidth+"px";o.div.style.height=o.table.offsetHeight+"px";};this.create=function(){if(document.getElementById("fd-"+this.id))
return;this.noFocus=true;function createTH(details){var th=document.createElement('th');if(details.thClassName)
th.className=details.thClassName;if(details.colspan){th.setAttribute('colspan',details.colspan);};return th;};function createThAndButton(tr,obj){for(var i=0,details;details=obj[i];i++){var th=createTH(details);tr.appendChild(th);var but=document.createElement('span');but.className=details.className;but.id=o.id+details.id;but.appendChild(document.createTextNode(details.text||o.nbsp));but.title=details.title||"";th.appendChild(but);};};this.div=document.createElement('div');this.div.id="fd-"+this.id;this.div.className="datePicker";this.div.style.visibility="hidden";this.div.style.display="none";if(this.describedBy&&document.getElementById(this.describedBy)){setARIAProperty(this.div,"describedby",this.describedBy);};if(this.labelledBy){setARIAProperty(this.div,"labelledby",this.labelledBy.id);};var tr,row,col,tableHead,tableBody,tableFoot;this.table=document.createElement('table');this.table.className="datePickerTable";this.table.onmouseover=this.onmouseover;this.table.onmouseout=this.onmouseout;this.table.onclick=this.onclick;if(this.staticPos){this.table.onmousedown=this.onmousedown;};this.div.appendChild(this.table);var dragEnabledCN=!this.dragDisabled?" drag-enabled":"";if(!this.staticPos){this.div.style.visibility="hidden";this.div.className+=dragEnabledCN;document.getElementsByTagName('body')[0].appendChild(this.div);setARIAProperty(this.div,"hidden","true");}else{elem=document.getElementById(this.positioned?this.positioned:this.id);if(!elem){this.div=null;if(debug)
throw this.positioned?"Could not locate a datePickers associated parent element with an id:"
+this.positioned:"Could not locate a datePickers associated input with an id:"
+this.id;return;};this.div.className+=" static-datepicker";if(this.positioned){elem.appendChild(this.div);}else{elem.parentNode.insertBefore(this.div,elem.nextSibling);};if(this.hideInput){for(var elemID in this.formElements){elem=document.getElementById(elemID);if(elem){elem.className+=" fd-hidden-input";};};};setTimeout(this.resizeInlineDiv,300);};setARIARole(this.div,"grid");if(this.statusFormat){tableFoot=document.createElement('tfoot');this.table.appendChild(tableFoot);tr=document.createElement('tr');tr.className="date-picker-tfoot";tableFoot.appendChild(tr);this.statusBar=createTH({thClassName:"date-picker-statusbar"
+dragEnabledCN,colspan:this.showWeeks?8:7});tr.appendChild(this.statusBar);this.updateStatus();};tableHead=document.createElement('thead');this.table.appendChild(tableHead);tr=document.createElement('tr');setARIARole(tr,"presentation");tableHead.appendChild(tr);this.titleBar=createTH({thClassName:"date-picker-title"+dragEnabledCN,colspan:this.showWeeks?8:7});tr.appendChild(this.titleBar);tr=null;var span=document.createElement('span');span.appendChild(document.createTextNode(nbsp));span.className="month-display"+dragEnabledCN;this.titleBar.appendChild(span);span=document.createElement('span');span.appendChild(document.createTextNode(nbsp));span.className="year-display"+dragEnabledCN;this.titleBar.appendChild(span);span=null;tr=document.createElement('tr');setARIARole(tr,"presentation");tableHead.appendChild(tr);createThAndButton(tr,[{className:"prev-but prev-year",id:"-prev-year-but",text:"\u00AB",title:getTitleTranslation(2)},{className:"prev-but prev-month",id:"-prev-month-but",text:"\u2039",title:getTitleTranslation(0)},{colspan:this.showWeeks?4:3,className:"today-but",id:"-today-but",text:getTitleTranslation(4)},{className:"next-but next-month",id:"-next-month-but",text:"\u203A",title:getTitleTranslation(1)},{className:"next-but next-year",id:"-next-year-but",text:"\u00BB",title:getTitleTranslation(3)}]);tableBody=document.createElement('tbody');this.table.appendChild(tableBody);var colspanTotal=this.showWeeks?8:7,colOffset=this.showWeeks?0:-1,but,abbr;for(var rows=0;rows<7;rows++){row=document.createElement('tr');if(rows!=0){setARIARole(row,"row");tableBody.appendChild(row);}else{tableHead.appendChild(row);};for(var cols=0;cols<colspanTotal;cols++){if(rows===0||(this.showWeeks&&cols===0)){col=document.createElement('th');}else{col=document.createElement('td');setARIAProperty(col,"describedby",this.id
+"-col-"
+cols
+(this.showWeeks?" "+this.id
+"-row-"+rows:""));setARIAProperty(col,"selected","false");};row.appendChild(col);if((this.showWeeks&&cols>0&&rows>0)||(!this.showWeeks&&rows>0)){setARIARole(col,"gridcell");}else{if(rows===0&&cols>colOffset){col.className="date-picker-day-header";col.scope="col";setARIARole(col,"columnheader");col.id=this.id+"-col-"+cols;}else{col.className="date-picker-week-header";col.scope="row";setARIARole(col,"rowheader");col.id=this.id+"-row-"+rows;};};};};col=row=null;this.ths=this.table.getElementsByTagName('thead')[0].getElementsByTagName('tr')[2].getElementsByTagName('th');for(var y=0;y<colspanTotal;y++){if(y==0&&this.showWeeks){this.ths[y].appendChild(document.createTextNode(getTitleTranslation(6)));this.ths[y].title=getTitleTranslation(8);continue;};if(y>(this.showWeeks?0:-1)){but=document.createElement("span");but.className="fd-day-header";this.ths[y].appendChild(but);};};but=null;this.trs=this.table.getElementsByTagName('tbody')[0].getElementsByTagName('tr');this.tds=this.table.getElementsByTagName('tbody')[0].getElementsByTagName('td');this.butPrevYear=document.getElementById(this.id
+"-prev-year-but");this.butPrevMonth=document.getElementById(this.id
+"-prev-month-but");this.butToday=document.getElementById(this.id+"-today-but");this.butNextYear=document.getElementById(this.id
+"-next-year-but");this.butNextMonth=document.getElementById(this.id
+"-next-month-but");if(this.noToday){this.butToday.style.display="none";};if(this.showWeeks){this.wkThs=this.table.getElementsByTagName('tbody')[0].getElementsByTagName('th');this.div.className+=" weeks-displayed";};tableBody=tableHead=tr=createThAndButton=createTH=null;if(this.rangeLow&&this.rangeHigh&&(this.rangeHigh-this.rangeLow<7)){this.equaliseDates();};this.updateTableHeaders();this.created=true;this.updateTable();if(this.staticPos){this.visible=true;this.opacity=this.opacityTo=this.finalOpacity;this.div.style.visibility="visible";this.div.style.display="block";this.noFocus=true;this.fade();}else{this.reposition();this.div.style.visibility="visible";this.fade();this.noFocus=true;};this.callback("domcreate",{"id":this.id});};this.fade=function(){window.clearTimeout(o.fadeTimer);o.fadeTimer=null;var diff=Math.round(o.opacity+((o.opacityTo-o.opacity)/4));o.setOpacity(diff);if(Math.abs(o.opacityTo-diff)>3&&!o.noFadeEffect){o.fadeTimer=window.setTimeout(o.fade,50);}else{o.setOpacity(o.opacityTo);if(o.opacityTo==0){o.div.style.display="none";o.div.style.visibility="hidden";setARIAProperty(o.div,"hidden","true");o.visible=false;}else{setARIAProperty(o.div,"hidden","false");o.visible=true;};};};this.trackDrag=function(e){e=e||window.event;var diffx=(e.pageX?e.pageX:e.clientX?e.clientX:e.x)
-o.mx;var diffy=(e.pageY?e.pageY:e.clientY?e.clientY:e.Y)
-o.my;o.div.style.left=Math.round(o.x+diffx)>0?Math.round(o.x
+diffx)
+'px':"0px";o.div.style.top=Math.round(o.y+diffy)>0?Math.round(o.y
+diffy)
+'px':"0px";};this.stopDrag=function(e){var b=document.getElementsByTagName("body")[0];b.className=b.className.replace(/fd-drag-active/g,"");removeEvent(document,'mousemove',o.trackDrag,false);removeEvent(document,'mouseup',o.stopDrag,false);o.div.style.zIndex=9999;};this.onmousedown=function(e){e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement,origEl=el,hideDP=true,reg=new RegExp("^fd-(but-)?"
+o.id+"$");o.mouseDownElem=null;while(el){if(el.id&&el.id.length&&el.id.search(reg)!=-1){hideDP=false;break;};try{el=el.parentNode;}catch(err){break;};};if(hideDP){hideAll();return true;};if((o.div.className+origEl.className).search('fd-disabled')!=-1){return true;};if(origEl.id.search(new RegExp("^"
+o.id
+"(-prev-year-but|-prev-month-but|-next-month-but|-next-year-but)$"))!=-1){o.mouseDownElem=origEl;addEvent(document,"mouseup",o.clearTimer);addEvent(origEl,"mouseout",o.clearTimer);var incs={"-prev-year-but":[0,-1,0],"-prev-month-but":[0,0,-1],"-next-year-but":[0,1,0],"-next-month-but":[0,0,1]},check=origEl.id.replace(o.id,""),dateYYYYMM=Number(o.date.getFullYear()
+pad(o.date.getMonth()+1));o.timerInc=800;o.timerSet=true;o.dayInc=incs[check][0];o.yearInc=incs[check][1];o.monthInc=incs[check][2];o.accellerator=1;if(!(o.currentYYYYMM==dateYYYYMM)){if((o.currentYYYYMM<dateYYYYMM&&(o.yearInc==-1||o.monthInc==-1))||(o.currentYYYYMM>dateYYYYMM&&(o.yearInc==1||o.monthInc==1))){o.delayedUpdate=false;o.timerInc=1200;}else{o.delayedUpdate=true;o.timerInc=800;};};o.updateTable();return stopEvent(e);}else if(el.className.search("drag-enabled")!=-1){o.mx=e.pageX?e.pageX:e.clientX?e.clientX:e.x;o.my=e.pageY?e.pageY:e.clientY?e.clientY:e.Y;o.x=parseInt(o.div.style.left);o.y=parseInt(o.div.style.top);addEvent(document,'mousemove',o.trackDrag,false);addEvent(document,'mouseup',o.stopDrag,false);var b=document.getElementsByTagName("body")[0];b.className=b.className.replace(/fd-drag-active/g,"")
+" fd-drag-active";o.div.style.zIndex=10000;return stopEvent(e);};return true;};this.onclick=function(e){if(o.opacity!=o.opacityTo||o.disabled)
return stopEvent(e);e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;while(el.parentNode){if(el.tagName&&el.tagName.toLowerCase()=="td"){if(el.className.search(/cd-([0-9]{8})/)==-1||el.className.search(/date-picker-unused|out-of-range|day-disabled|no-selection|not-selectable/)!=-1)
return stopEvent(e);var cellDate=el.className.match(/cd-([0-9]{8})/)[1];o.date=new Date(cellDate.substr(0,4),cellDate.substr(4,2)
-1,cellDate.substr(6,2));o.dateSet=new Date(o.date);o.noFocus=true;o.callback("dateset",{"id":o.id,"date":o.dateSet,"dd":o.dateSet.getDate(),"mm":o.dateSet.getMonth()+1,"yyyy":o.dateSet.getFullYear()});o.returnFormattedDate();o.hide();o.stopTimer();break;}else if(el.id&&el.id==o.id+"-today-but"){o.date=new Date();o.updateTable();o.stopTimer();break;}else if(el.className.search(/date-picker-day-header/)!=-1){var cnt=o.showWeeks?-1:0,elem=el;while(elem.previousSibling){elem=elem.previousSibling;if(elem.tagName&&elem.tagName.toLowerCase()=="th")
cnt++;};o.firstDayOfWeek=(o.firstDayOfWeek+cnt)%7;o.updateTableHeaders();break;};try{el=el.parentNode;}catch(err){break;};};return stopEvent(e);};this.show=function(autoFocus){if(this.staticPos){return;};var elem,elemID;for(elemID in this.formElements){elem=document.getElementById(this.id);if(!elem||(elem&&elem.disabled)){return;};};this.noFocus=true;if(!this.created||!document.getElementById('fd-'+this.id)){this.created=false;this.fullCreate=false;this.create();this.fullCreate=true;}else{this.setDateFromInput();this.reposition();};this.noFocus=!!!autoFocus;if(this.noFocus){this.clickActivated=true;addEvent(document,"mousedown",this.onmousedown);if(mouseWheel){if(window.addEventListener&&!window.devicePixelRatio)
window.addEventListener('DOMMouseScroll',this.onmousewheel,false);else{addEvent(document,"mousewheel",this.onmousewheel);addEvent(window,"mousewheel",this.onmousewheel);};};}else{this.clickActivated=false;};this.opacityTo=this.finalOpacity;this.div.style.display="block";this.setNewFocus();this.fade();var butt=document.getElementById('fd-but-'+this.id);if(butt){butt.className=butt.className.replace("dp-button-active","")
+" dp-button-active";};};this.hide=function(){if(!this.visible||!this.created||!document.getElementById('fd-'+this.id))
return;this.kbEvent=false;o.div.className=o.div.className.replace("datepicker-focus","");this.stopTimer();this.removeOnFocusEvents();this.clickActivated=false;if(this.statusBar){this.updateStatus(getTitleTranslation(9));};this.noFocus=true;this.setNewFocus();if(this.staticPos){return;};var butt=document.getElementById('fd-but-'+this.id);if(butt)
butt.className=butt.className.replace("dp-button-active","");removeEvent(document,"mousedown",this.onmousedown);if(mouseWheel){if(window.addEventListener&&!window.devicePixelRatio){try{window.removeEventListener('DOMMouseScroll',this.onmousewheel,false);}catch(err){};}else{removeEvent(document,"mousewheel",this.onmousewheel);removeEvent(window,"mousewheel",this.onmousewheel);};};this.opacityTo=0;this.fade();};this.onblur=function(e){o.hide();};this.onfocus=function(e){o.noFocus=false;o.div.className=o.div.className.replace("datepicker-focus","")
+" datepicker-focus";o.addOnFocusEvents();};this.onmousewheel=function(e){e=e||document.parentWindow.event;var delta=0;if(e.wheelDelta){delta=e.wheelDelta/120;if(isOpera&&window.opera.version()<9.2)
delta=-delta;}else if(e.detail){delta=-e.detail/3;};var n=o.date.getDate(),d=new Date(o.date),inc=delta>0?1:-1;d.setDate(2);d.setMonth(d.getMonth()+inc*1);d.setDate(Math.min(n,daysInMonth(d.getMonth(),d.getFullYear())));if(o.outOfRange(d)){return stopEvent(e);};o.date=new Date(d);o.updateTable();if(o.statusBar){o.updateStatus(printFormattedDate(o.date,o.statusFormat,true));};return stopEvent(e);};this.onkeydown=function(e){o.stopTimer();if(!o.visible)
return false;e=e||document.parentWindow.event;var kc=e.keyCode?e.keyCode:e.charCode;if(kc==13){var td=document.getElementById(o.id+"-date-picker-hover");if(!td||td.className.search(/cd-([0-9]{8})/)==-1||td.className.search(/no-selection|out-of-range|day-disabled/)!=-1){return stopEvent(e);};o.dateSet=new Date(o.date);o.callback("dateset",o.createCbArgObj());o.returnFormattedDate();o.hide();return stopEvent(e);}else if(kc==27){if(!o.staticPos){o.hide();return stopEvent(e);};return true;}else if(kc==32||kc==0){o.date=new Date();o.updateTable();return stopEvent(e);}else if(kc==9){if(!o.staticPos){return stopEvent(e);};return true;};if(isMoz){if(new Date().getTime()-o.interval.getTime()<50){return stopEvent(e);};o.interval=new Date();};if((kc>49&&kc<56)||(kc>97&&kc<104)){if(kc>96)
kc-=(96-48);kc-=49;o.firstDayOfWeek=(o.firstDayOfWeek+kc)%7;o.updateTableHeaders();return stopEvent(e);};if(kc<33||kc>40)
return true;var d=new Date(o.date),tmp,cursorYYYYMM=o.date.getFullYear()
+pad(o.date.getMonth()+1);if(kc==36){d.setDate(1);}else if(kc==35){d.setDate(daysInMonth(d.getMonth(),d.getFullYear()));}else if(kc==33||kc==34){var inc=(kc==34)?1:-1;if(e.ctrlKey){d.setFullYear(d.getFullYear()+inc*1);}else{var n=o.date.getDate();d.setDate(2);d.setMonth(d.getMonth()+inc*1);d.setDate(Math.min(n,daysInMonth(d.getMonth(),d.getFullYear())));};}else if(kc==37){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()
-1);}else if(kc==39||kc==34){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()
+1);}else if(kc==38){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()
-7);}else if(kc==40){d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()
+7);};if(o.outOfRange(d)){return stopEvent(e);};o.date=d;if(o.statusBar){o.updateStatus(o.getBespokeTitle(o.date.getFullYear(),o.date.getMonth()
+1,o.date.getDate())||printFormattedDate(o.date,o.statusFormat,true));};var t=String(o.date.getFullYear())+pad(o.date.getMonth()+1)
+pad(o.date.getDate());if(e.ctrlKey||(kc==33||kc==34)||t<o.firstDateShown||t>o.lastDateShown){o.updateTable();}else{if(!o.noToday){o.disableTodayButton();};o.removeOldFocus();for(var i=0,td;td=o.tds[i];i++){if(td.className.search("cd-"+t)==-1){continue;};o.showHideButtons(o.date);td.id=o.id+"-date-picker-hover";o.setNewFocus();break;};};return stopEvent(e);};this.onmouseout=function(e){e=e||document.parentWindow.event;var p=e.toElement||e.relatedTarget;while(p&&p!=this)
try{p=p.parentNode}catch(e){p=this;};if(p==this)
return false;if(o.currentTR){o.currentTR.className="";o.currentTR=null;};if(o.statusBar){o.updateStatus(o.getBespokeTitle(o.date.getFullYear(),o.date.getMonth()
+1,o.date.getDate())||printFormattedDate(o.date,o.statusFormat,true));};};this.onmouseover=function(e){e=e||document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;while(el.nodeType!=1){el=el.parentNode;};if(!el||!el.tagName){return;};var statusText=getTitleTranslation(9);switch(el.tagName.toLowerCase()){case"td":if(el.className.search(/date-picker-unused|out-of-range/)!=-1){statusText=getTitleTranslation(9);}
if(el.className.search(/cd-([0-9]{8})/)!=-1){o.stopTimer();var cellDate=el.className.match(/cd-([0-9]{8})/)[1];o.removeOldFocus();el.id=o.id+"-date-picker-hover";o.setNewFocus();o.date=new Date(+cellDate.substr(0,4),+cellDate.substr(4,2)
-1,+cellDate.substr(6,2));if(!o.noToday){o.disableTodayButton();};statusText=o.getBespokeTitle(+cellDate.substr(0,4),+cellDate.substr(4,2),+cellDate.substr(6,2))||printFormattedDate(o.date,o.statusFormat,true);};break;case"th":if(!o.statusBar){break;};if(el.className.search(/drag-enabled/)!=-1){statusText=getTitleTranslation(10);}else if(el.className.search(/date-picker-week-header/)!=-1){var txt=el.firstChild?el.firstChild.nodeValue:"";statusText=txt.search(/^(\d+)$/)!=-1?getTitleTranslation(7,[txt,txt<3&&o.date.getMonth()==11?getWeeksInYear(o.date.getFullYear())
+1:getWeeksInYear(o.date.getFullYear())]):getTitleTranslation(9);};break;case"span":if(!o.statusBar){break;};if(el.className.search(/drag-enabled/)!=-1){statusText=getTitleTranslation(10);}else if(el.className.search(/day-([0-6])/)!=-1){var day=el.className.match(/day-([0-6])/)[1];statusText=getTitleTranslation(11,[getDayTranslation(day,false)]);}else if(el.className.search(/prev-year/)!=-1){statusText=getTitleTranslation(2);}else if(el.className.search(/prev-month/)!=-1){statusText=getTitleTranslation(0);}else if(el.className.search(/next-year/)!=-1){statusText=getTitleTranslation(3);}else if(el.className.search(/next-month/)!=-1){statusText=getTitleTranslation(1);}else if(el.className.search(/today-but/)!=-1&&el.className.search(/disabled/)==-1){statusText=getTitleTranslation(12);};break;default:statusText="";};while(el.parentNode){el=el.parentNode;if(el.nodeType==1&&el.tagName.toLowerCase()=="tr"){if(o.currentTR){if(el==o.currentTR)
break;o.currentTR.className="";};el.className="dp-row-highlight";o.currentTR=el;break;};};if(o.statusBar&&statusText){o.updateStatus(statusText);};};this.clearTimer=function(){o.stopTimer();o.timerInc=800;o.yearInc=0;o.monthInc=0;o.dayInc=0;removeEvent(document,"mouseup",o.clearTimer);if(o.mouseDownElem!=null){removeEvent(o.mouseDownElem,"mouseout",o.clearTimer);};o.mouseDownElem=null;};var o=this;this.setDateFromInput();if(this.staticPos){this.create();}else{this.createButton();};(function(){var elemID,elem;for(elemID in o.formElements){elem=document.getElementById(elemID);if(elem&&elem.tagName&&elem.tagName.search(/select|input/i)!=-1){addEvent(elem,"change",o.changeHandler);};if(!elem||elem.disabled==true){o.disableDatePicker();};};})();this.fullCreate=true;};datePicker.prototype.addButtonEvents=function(but){function buttonEvent(e){e=e||window.event;var inpId=this.id.replace('fd-but-',''),dpVisible=isVisible(inpId),autoFocus=false,kbEvent=datePickers[inpId].kbEvent;if(kbEvent){datePickers[inpId].kbEvent=false;return;};if(e.type=="keydown"){datePickers[inpId].kbEvent=true;var kc=e.keyCode!=null?e.keyCode:e.charCode;if(kc!=13)
return true;if(dpVisible){this.className=this.className.replace("dp-button-active","");hideAll();return stopEvent(e);};autoFocus=true;}else{datePickers[inpId].kbEvent=false;};this.className=this.className.replace("dp-button-active","");if(!dpVisible){this.className+=" dp-button-active";hideAll(inpId);showDatePicker(inpId,autoFocus);}else{hideAll();};return stopEvent(e);};but.onkeydown=buttonEvent;but.onclick=buttonEvent;if(!buttonTabIndex||this.bespokeTabIndex===false){but.setAttribute(!false?"tabIndex":"tabindex","-1");but.tabIndex=-1;but.onkeydown=null;removeEvent(but,"keydown",buttonEvent);}else{but.setAttribute(!false?"tabIndex":"tabindex",this.bespokeTabIndex);but.tabIndex=this.bespokeTabIndex;};};datePicker.prototype.createButton=function(){if(this.staticPos||document.getElementById("fd-but-"+this.id)){return;};var inp=document.getElementById(this.id),span=document.createElement('span'),but=document.createElement('a');but.href="#"+this.id;but.className="date-picker-control";but.title=getTitleTranslation(5);but.id="fd-but-"+this.id;span.appendChild(document.createTextNode(nbsp));but.appendChild(span);span=document.createElement('span');span.className="fd-screen-reader";span.appendChild(document.createTextNode(but.title));but.appendChild(span);setARIARole(but,"button");setARIAProperty(but,"haspopup",true);if(this.positioned&&document.getElementById(this.positioned)){document.getElementById(this.positioned).appendChild(but);}else{inp.parentNode.insertBefore(but,inp.nextSibling);};this.addButtonEvents(but);but=null;this.callback("dombuttoncreate",{id:this.id});};datePicker.prototype.setBespokeTitles=function(titles){this.bespokeTitles=titles;};datePicker.prototype.addBespokeTitles=function(titles){for(var dt in titles){this.bespokeTitles[dt]=titles[dt];};};datePicker.prototype.getBespokeTitle=function(y,m,d){var dt,dtFull,yyyymmdd=y+String(pad(m))+pad(d);for(dt in this.bespokeTitles){dtFull=dt.replace(/^(\*\*\*\*)/,y).replace(/^(\d\d\d\d)(\*\*)/,"$1"+pad(m));if(dtFull==yyyymmdd)
return this.bespokeTitles[dt];};for(dt in bespokeTitles){dtFull=dt.replace(/^(\*\*\*\*)/,y).replace(/^(\d\d\d\d)(\*\*)/,"$1"+pad(m));if(dtFull==yyyymmdd)
return bespokeTitles[dt];};return false;};datePicker.prototype.returnSelectedDate=function(){return this.dateSet;};datePicker.prototype.setRangeLow=function(range){this.rangeLow=(String(range).search(/^(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)==-1)?false:range;if(!this.inUpdate)
this.setDateFromInput();};datePicker.prototype.setRangeHigh=function(range){this.rangeHigh=(String(range).search(/^(\d\d\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)==-1)?false:range;if(!this.inUpdate)
this.setDateFromInput();};datePicker.prototype.setDisabledDays=function(dayArray){if(!dayArray.length||dayArray.length!=7||dayArray.join("").search(/^([0|1]{7})$/)==-1){if(debug){throw"Invalid values located when attempting to call setDisabledDays";};return false;};this.disabledDays=dayArray;if(!this.inUpdate)
this.setDateFromInput();};datePicker.prototype.setDisabledDates=function(dateObj){this.disabledDates={};this.addDisabledDates(dateObj);};datePicker.prototype.setEnabledDates=function(dateObj){this.enabledDates={};this.addEnabledDates(dateObj);};datePicker.prototype.addDisabledDates=function(dateObj){this.enabledDates=false;this.disabledDates=this.disabledDates||{};var startD;for(startD in dateObj){if((String(startD).search(wcDateRegExp)!=-1&&dateObj[startD]==1)||(String(startD).search(rangeRegExp)!=-1&&String(dateObj[startD]).search(rangeRegExp)!=-1)){this.disabledDates[startD]=dateObj[startD];};};if(!this.inUpdate)
this.setDateFromInput();};datePicker.prototype.addEnabledDates=function(dateObj){this.disabledDates=false;this.enabledDates=this.enabledDates||{};var startD;for(startD in dateObj){if((String(startD).search(wcDateRegExp)!=-1&&dateObj[startD]==1)||(String(startD).search(rangeRegExp)!=-1&&String(dateObj[startD]).search(rangeRegExp)!=-1)){this.enabledDates[startD]=dateObj[startD];};};if(!this.inUpdate)
this.setDateFromInput();};datePicker.prototype.setSelectedDate=function(yyyymmdd){if(String(yyyymmdd).search(wcDateRegExp)==-1){return false;};var match=yyyymmdd.match(rangeRegExp),dt=new Date(+match[2],+match[3]-1,+match[4]);if(!dt||isNaN(dt)||!this.canDateBeSelected(dt)){return false;};this.dateSet=new Date(dt);if(!this.inUpdate)
this.updateTable();this.callback("dateset",this.createCbArgObj());this.returnFormattedDate();};datePicker.prototype.checkSelectedDate=function(){if(this.dateSet&&!this.canDateBeSelected(this.dateSet)){this.dateSet=null;};if(!this.inUpdate)
this.updateTable();};datePicker.prototype.addOnFocusEvents=function(){if(this.kbEventsAdded||this.noFocus){return;};addEvent(document,"keypress",this.onkeydown);addEvent(document,"mousedown",this.onmousedown);if(window.devicePixelRatio){removeEvent(document,"keypress",this.onkeydown);addEvent(document,"keydown",this.onkeydown);};this.noFocus=false;this.kbEventsAdded=true;};datePicker.prototype.removeOnFocusEvents=function(){if(!this.kbEventsAdded){return;};removeEvent(document,"keypress",this.onkeydown);removeEvent(document,"keydown",this.onkeydown);removeEvent(document,"mousedown",this.onmousedown);this.kbEventsAdded=false;};datePicker.prototype.stopTimer=function(){this.timerSet=false;window.clearTimeout(this.timer);};datePicker.prototype.setOpacity=function(op){this.div.style.opacity=op/100;this.div.style.filter='alpha(opacity='+op+')';this.opacity=op;};datePicker.prototype.getDates=function(y,m){var dpm=daysInMonth(m-1,y),obj={},dds=this.getGenericDates(y,m,false),eds=this.getGenericDates(y,m,true),dts=y
+pad(m);for(var i=1;i<=dpm;i++){dt=dts+""+pad(i);if(dds){obj[dt]=(dt in dds)?0:1;}else if(eds){obj[dt]=(dt in eds)?1:0;}else{obj[dt]=1;};};return obj;};datePicker.prototype.getGenericDates=function(y,m,enabled){var deDates=enabled?this.enabledDates:this.disabledDates;if(!deDates){return false;};m=pad(m);var obj={},lower=this.firstDateShown,upper=this.lastDateShown,dt1,dt2,rngLower,rngUpper;if(!upper||!lower){lower=this.firstDateShown=y+pad(m)+"01";upper=this.lastDateShown=y+pad(m)+pad(daysInMonth(m,y));};for(dt in deDates){dt1=dt.replace(/^(\*\*\*\*)/,y).replace(/^(\d\d\d\d)(\*\*)/,"$1"+m);dt2=deDates[dt];if(dt2==1){if(Number(dt1.substr(0,6))>=+String(this.firstDateShown).substr(0,6)&&Number(dt1.substr(0,6))<=+String(this.lastDateShown).substr(0,6)){obj[dt1]=1;};continue;};if(+String(this.firstDateShown).substr(0,6)>=Number(dt1.substr(0,6))&&+String(this.lastDateShown).substr(0,6)<=Number(dt2.substr(0,6))){if(Number(dt1.substr(0,6))==Number(dt2.substr(0,6))){for(var i=dt1;i<=dt2;i++){obj[i]=1;};continue;};rngLower=Number(dt1.substr(0,6))==+String(this.firstDateShown).substr(0,6)?dt1:lower;rngUpper=Number(dt2.substr(0,6))==+String(this.lastDateShown).substr(0,6)?dt2:upper;for(var i=+rngLower;i<=+rngUpper;i++){obj[i]=1;};};};return obj;};datePicker.prototype.truePosition=function(element){var pos=this.cumulativeOffset(element);if(isOpera){return pos;};var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body,dsocleft=document.all?iebody.scrollLeft:window.pageXOffset,dsoctop=document.all?iebody.scrollTop:window.pageYOffset,posReal=this.realOffset(element);return[pos[0]-posReal[0]+dsocleft,pos[1]-posReal[1]+dsoctop];};datePicker.prototype.realOffset=function(element){var t=0,l=0;do{t+=element.scrollTop||0;l+=element.scrollLeft||0;element=element.parentNode;}while(element);return[l,t];};datePicker.prototype.cumulativeOffset=function(element){var t=0,l=0;do{t+=element.offsetTop||0;l+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[l,t];};datePicker.prototype.equaliseDates=function(){var clearDayFound=false,tmpDate;for(var i=this.rangeLow;i<=this.rangeHigh;i++){tmpDate=String(i);if(!this.disabledDays[new Date(tmpDate.substr(0,4),tmpDate.substr(6,2),tmpDate.substr(4,2)).getDay()
-1]){clearDayFound=true;break;};};if(!clearDayFound){this.disabledDays=[0,0,0,0,0,0,0]};};datePicker.prototype.outOfRange=function(tmpDate){if(!this.rangeLow&&!this.rangeHigh){return false;};var level=false;if(!tmpDate){level=true;tmpDate=this.date;};var d=pad(tmpDate.getDate()),m=pad(tmpDate.getMonth()+1),y=tmpDate.getFullYear(),dt=String(y)+String(m)+String(d);if(this.rangeLow&&+dt<+this.rangeLow){if(!level){return true;};this.date=new Date(this.rangeLow.substr(0,4),this.rangeLow.substr(4,2)
-1,this.rangeLow.substr(6,2),5,0,0);return false;};if(this.rangeHigh&&+dt>+this.rangeHigh){if(!level){return true;};this.date=new Date(this.rangeHigh.substr(0,4),this.rangeHigh.substr(4,2)
-1,this.rangeHigh.substr(6,2),5,0,0);};return false;};datePicker.prototype.canDateBeSelected=function(tmpDate){if(!tmpDate)
return false;var d=pad(tmpDate.getDate()),m=pad(tmpDate.getMonth()+1),y=tmpDate.getFullYear(),dt=String(y)+String(m)+String(d),dd=this.getDates(y,m),wd=tmpDate.getDay()==0?7:tmpDate.getDay();if((this.rangeLow&&+dt<+this.rangeLow)||(this.rangeHigh&&+dt>+this.rangeHigh)||(dd[dt]==0)||this.disabledDays[wd-1]){return false;};return true;};datePicker.prototype.updateStatus=function(msg){while(this.statusBar.firstChild){this.statusBar.removeChild(this.statusBar.firstChild);};if(msg&&this.statusFormat.search(/-S|S-/)!=-1&&msg.search(/([0-9]{1,2})(st|nd|rd|th)/)!=-1){msg=msg.replace(/([0-9]{1,2})(st|nd|rd|th)/,"$1<sup>$2</sup>").split(/<sup>|<\/sup>/);var dc=document.createDocumentFragment();for(var i=0,nd;nd=msg[i];i++){if(/^(st|nd|rd|th)$/.test(nd)){var sup=document.createElement("sup");sup.appendChild(document.createTextNode(nd));dc.appendChild(sup);}else{dc.appendChild(document.createTextNode(nd));};};this.statusBar.appendChild(dc);}else{this.statusBar.appendChild(document.createTextNode(msg?msg:getTitleTranslation(9)));};};datePicker.prototype.setDateFromInput=function(){var origDateSet=this.dateSet,m=false,dt,elemID,elem,elemFmt,d,y,elemVal;this.dateSet=null;for(elemID in this.formElements){elem=document.getElementById(elemID);if(!elem){return;};elemVal=String(elem.value);elemFmt=this.formElements[elemID];dt=false;if(!(elemVal=="")){for(var i=0,fmt;fmt=this.formatMasks[elemID][i];i++){dt=parseDateString(elemVal,fmt);if(dt){break;};};};if(dt){if(elemFmt.search(new RegExp('['+dParts+']'))!=-1){d=dt.getDate();};if(elemFmt.search(new RegExp('['+mParts+']'))!=-1){m=dt.getMonth();};if(elemFmt.search(new RegExp('['+yParts+']'))!=-1){y=dt.getFullYear()};};};dt=false;if(d&&!(m===false)&&y){if(+d>daysInMonth(+m,+y)){d=daysInMonth(+m,+y);dt=false;}else{dt=new Date(+y,+m,+d);};};if(!dt||isNaN(dt)){var newDate=new Date(y||new Date().getFullYear(),!(m===false)?m:new Date().getMonth(),1);this.date=this.cursorDate?new Date(+this.cursorDate.substr(0,4),+this.cursorDate.substr(4,2)
-1,+this.cursorDate.substr(6,2)):new Date(newDate.getFullYear(),newDate.getMonth(),Math.min(+d||new Date().getDate(),daysInMonth(newDate.getMonth(),newDate.getFullYear())));this.date.setHours(5);this.outOfRange();this.updateTable();return;};dt.setHours(5);this.date=new Date(dt);this.outOfRange();if(dt.getTime()==this.date.getTime()&&this.canDateBeSelected(this.date)){this.dateSet=new Date(this.date);};if(this.fullCreate)
this.updateTable();this.returnFormattedDate(true);};datePicker.prototype.setSelectIndex=function(elem,indx){for(var opt=elem.options.length-1;opt>=0;opt--){if(elem.options[opt].value==indx){elem.selectedIndex=opt;return;};};};datePicker.prototype.returnFormattedDate=function(noFocus){if(!this.dateSet){return;};var d=pad(this.dateSet.getDate()),m=pad(this.dateSet.getMonth()
+1),y=this.dateSet.getFullYear(),el=false,elemID,elem,elemFmt,fmtDate;noFocus=!!noFocus;for(elemID in this.formElements){elem=document.getElementById(elemID);if(!elem)
return;if(!el)
el=elem;elemFmt=this.formElements[elemID];fmtDate=printFormattedDate(this.dateSet,elemFmt,returnLocaleDate);if(elem.tagName.toLowerCase()=="input"){elem.value=fmtDate;}else{this.setSelectIndex(elem,fmtDate);};};if(this.staticPos){this.noFocus=true;this.updateTable();this.noFocus=false;};if(this.fullCreate){if(el.type&&el.type!="hidden"&&!noFocus){el.focus();};};};datePicker.prototype.disableDatePicker=function(){if(this.disabled)
return;if(this.staticPos){this.removeOnFocusEvents();this.removeOldFocus();this.noFocus=true;this.div.className=this.div.className.replace(/dp-disabled/,"")
+" dp-disabled";this.table.onmouseover=this.table.onclick=this.table.onmouseout=this.table.onmousedown=null;removeEvent(document,"mousedown",this.onmousedown);removeEvent(document,"mouseup",this.clearTimer);}else{if(this.visible)
this.hide();var but=document.getElementById("fd-but-"+this.id);if(but){but.className=but.className.replace(/dp-disabled/,"")
+" dp-disabled";setARIAProperty(but,"disabled",true);but.onkeydown=but.onclick=function(){return false;};but.setAttribute(!false?"tabIndex":"tabindex","-1");but.tabIndex=-1;};};clearTimeout(this.timer);this.disabled=true;};datePicker.prototype.enableDatePicker=function(){if(!this.disabled)
return;if(this.staticPos){this.removeOldFocus();this.noFocus=true;this.updateTable();this.div.className=this.div.className.replace(/dp-disabled/,"");this.disabled=false;this.table.onmouseover=this.onmouseover;this.table.onmouseout=this.onmouseout;this.table.onclick=this.onclick;this.table.onmousedown=this.onmousedown;}else{var but=document.getElementById("fd-but-"+this.id);if(but){but.className=but.className.replace(/dp-disabled/,"");setARIAProperty(but,"disabled",false);this.addButtonEvents(but);};};this.disabled=false;};datePicker.prototype.disableTodayButton=function(){var today=new Date();this.butToday.className=this.butToday.className.replace("fd-disabled","");if(this.outOfRange(today)||(this.date.getDate()==today.getDate()&&this.date.getMonth()==today.getMonth()&&this.date.getFullYear()==today.getFullYear())){this.butToday.className+=" fd-disabled";};};datePicker.prototype.updateTableHeaders=function(){var colspanTotal=this.showWeeks?8:7,colOffset=this.showWeeks?1:0,d,but;for(var col=colOffset;col<colspanTotal;col++){d=(this.firstDayOfWeek+(col-colOffset))%7;this.ths[col].title=getDayTranslation(d,false);if(col>colOffset){but=this.ths[col].getElementsByTagName("span")[0];while(but.firstChild){but.removeChild(but.firstChild);};but.appendChild(document.createTextNode(getDayTranslation(d,true)));but.title=this.ths[col].title;but.className=but.className.replace(/day-([0-6])/,"")
+" day-"+d;but=null;}else{while(this.ths[col].firstChild){this.ths[col].removeChild(this.ths[col].firstChild);};this.ths[col].appendChild(document.createTextNode(getDayTranslation(d,true)));};this.ths[col].className=this.ths[col].className.replace(/date-picker-highlight/g,"");if(this.highlightDays[d]){this.ths[col].className+=" date-picker-highlight";};};if(this.created){this.updateTable();}};datePicker.prototype.callback=function(type,args){if(!type||!(type in this.callbacks)){return false;};var ret=false;for(var func=0;func<this.callbacks[type].length;func++){ret=this.callbacks[type][func](args||this.id);};return ret;};datePicker.prototype.showHideButtons=function(tmpDate){if(!this.butPrevYear){return;};var tdm=tmpDate.getMonth(),tdy=tmpDate.getFullYear();if(this.outOfRange(new Date((tdy-1),tdm,daysInMonth(+tdm,tdy-1)))){if(this.butPrevYear.className.search(/fd-disabled/)==-1){this.butPrevYear.className+=" fd-disabled";};if(this.yearInc==-1)
this.stopTimer();}else{this.butPrevYear.className=this.butPrevYear.className.replace(/fd-disabled/g,"");};if(this.outOfRange(new Date(tdy,(+tdm-1),daysInMonth(+tdm-1,tdy)))){if(this.butPrevMonth.className.search(/fd-disabled/)==-1){this.butPrevMonth.className+=" fd-disabled";};if(this.monthInc==-1)
this.stopTimer();}else{this.butPrevMonth.className=this.butPrevMonth.className.replace(/fd-disabled/g,"");};if(this.outOfRange(new Date((tdy+1),+tdm,1))){if(this.butNextYear.className.search(/fd-disabled/)==-1){this.butNextYear.className+=" fd-disabled";};if(this.yearInc==1)
this.stopTimer();}else{this.butNextYear.className=this.butNextYear.className.replace(/fd-disabled/g,"");};if(this.outOfRange(new Date(tdy,+tdm+1,1))){if(this.butNextMonth.className.search(/fd-disabled/)==-1){this.butNextMonth.className+=" fd-disabled";};if(this.monthInc==1)
this.stopTimer();}else{this.butNextMonth.className=this.butNextMonth.className.replace(/fd-disabled/g,"");};};var localeDefaults={fullMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbrs:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullDays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],dayAbbrs:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],titles:["Previous month","Next month","Previous year","Next year","Today","Show Calendar","wk","Week [[%0%]] of [[%1%]]","Week","Select a date","Click \u0026 Drag to move","Display \u201C[[%0%]]\u201D first","Go to Today\u2019s date","Disabled date :"],firstDayOfWeek:0,imported:false};var joinNodeLists=function(){if(!arguments.length){return[];}
var nodeList=[];for(var i=0;i<arguments.length;i++){for(var j=0,item;item=arguments[i][j];j++){nodeList[nodeList.length]=item;};};return nodeList;};var cleanUp=function(){var dp,fe;for(dp in datePickers){for(fe in datePickers[dp].formElements){if(!document.getElementById(fe)){datePickers[dp].destroy();datePickers[dp]=null;delete datePickers[dp];break;}};};};var hideAll=function(exception){var dp;for(dp in datePickers){if(!datePickers[dp].created||(exception&&exception==datePickers[dp].id))
continue;datePickers[dp].hide();};};var hideDatePicker=function(inpID){if(inpID in datePickers){if(!datePickers[inpID].created||datePickers[inpID].staticPos)
return;datePickers[inpID].hide();};};var showDatePicker=function(inpID,autoFocus){if(!(inpID in datePickers))
return false;datePickers[inpID].clickActivated=!!!autoFocus;datePickers[inpID].show(autoFocus);return true;};var destroy=function(e){e=e||window.event;if(e.persisted){return;};for(dp in datePickers){datePickers[dp].destroy();datePickers[dp]=null;delete datePickers[dp];};datePickers=null;removeEvent(window,'unload',datePickerController.destroy);};var destroySingleDatePicker=function(id){if(id&&(id in datePickers)){datePickers[id].destroy();datePickers[id]=null;delete datePickers[id];};};var getTitleTranslation=function(num,replacements){replacements=replacements||[];if(localeImport.titles.length>num){var txt=localeImport.titles[num];if(replacements&&replacements.length){for(var i=0;i<replacements.length;i++){txt=txt.replace("[[%"+i+"%]]",replacements[i]);};};return txt.replace(/[[%(\d)%]]/g,"");};return"";};var getDayTranslation=function(day,abbreviation){var titles=localeImport[abbreviation?"dayAbbrs":"fullDays"];return titles.length&&titles.length>day?titles[day]:"";};var getMonthTranslation=function(month,abbreviation){var titles=localeImport[abbreviation?"monthAbbrs":"fullMonths"];return titles.length&&titles.length>month?titles[month]:"";};var daysInMonth=function(nMonth,nYear){nMonth=(nMonth+12)%12;return(((0==(nYear%4))&&((0!=(nYear%100))||(0==(nYear%400))))&&nMonth==1)?29:[31,28,31,30,31,30,31,31,30,31,30,31][nMonth];};var getWeeksInYear=function(Y){if(Y in weeksInYearCache){return weeksInYearCache[Y];};var X1,X2,NW;with(X1=new Date(Y,0,4)){setDate(getDate()-(6+getDay())%7);};with(X2=new Date(Y,11,28)){setDate(getDate()+(7-getDay())%7);};weeksInYearCache[Y]=Math.round((X2-X1)/604800000);return weeksInYearCache[Y];};var getWeekNumber=function(y,m,d){var d=new Date(y,m,d,0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};var printFormattedDate=function(date,fmt,useImportedLocale){if(!date||isNaN(date)){return"";};var parts=fmt.split("-"),str=[],d=date.getDate(),D=date.getDay(),m=date.getMonth(),y=date.getFullYear(),flags={"sp":" ","dt":".","sl":"/","ds":"-","cc":",","d":pad(d),"D":useImportedLocale?localeImport.dayAbbrs[D==0?6:D-1]:localeDefaults.dayAbbrs[D==0?6:D-1],"l":useImportedLocale?localeImport.fullDays[D==0?6:D-1]:localeDefaults.fullDays[D==0?6:D-1],"j":d,"N":D==0?7:D,"w":D,"W":getWeekNumber(y,m,d),"M":useImportedLocale?localeImport.monthAbbrs[m]:localeDefaults.monthAbbrs[m],"F":useImportedLocale?localeImport.fullMonths[m]:localeDefaults.fullMonths[m],"m":pad(m+1),"n":m+1,"t":daysInMonth(m,y),"y":String(y).substr(2,2),"Y":y,"S":["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};for(var pt=0,part;part=parts[pt];pt++){str.push(!(part in flags)?"":flags[part]);};return str.join("");};var parseDateString=function(str,fmt){var d=false,m=false,y=false,now=new Date(),parts=fmt.replace(/-sp(-sp)+/g,"-sp").split("-"),divds={"dt":".","sl":"/","ds":"-","cc":","},str=""+str;loopLabel:for(var pt=0,part;part=parts[pt];pt++){if(str.length==0){return false;};switch(part){case"sp":case"dt":case"sl":case"ds":case"cc":str=str.replace(/^(\s|\.|\/|,|-){1,}/,"");break;case"d":case"j":if(str.search(/^(3[01]|[12][0-9]|0?[1-9])/)!=-1){d=+str.match(/^(3[01]|[12][0-9]|0?[1-9])/)[0];str=str.substr(str.match(/^(3[01]|[12][0-9]|0?[1-9])/)[0].length);break;}else{return"";};case"D":case"l":l=localeDefaults.fullDays.concat(localeDefaults.dayAbbrs);if(localeImport.imported){l=l.concat(localeImport.fullDays).concat(localeImport.dayAbbrs);};for(var i=0;i<l.length;i++){if(new RegExp("^"+l[i],"i").test(str)){str=str.substr(l[i].length);continue loopLabel;};};break;case"N":case"w":if(str.search(part=="N"?/^([1-7])/:/^([0-6])/)!=-1){str=str.substr(1);};break;case"S":if(str.search(/^(st|nd|rd|th)/i)!=-1){str=str.substr(2);};break;case"W":if(str.search(/^([1-9]|[1234[0-9]|5[0-3])/)!=-1){str=str.substr(str.match(/^([1-9]|[1234[0-9]|5[0-3])/)[0].length);};break;case"M":case"F":l=localeDefaults.fullMonths.concat(localeDefaults.monthAbbrs);if(localeImport.imported){l=l.concat(localeImport.fullMonths).concat(localeImport.monthAbbrs);};for(var i=0;i<l.length;i++){if(str.search(new RegExp("^"+l[i],"i"))!=-1){str=str.substr(l[i].length);m=((i+12)%12);continue loopLabel;};};return"";case"m":case"n":l=/^(1[012]|0?[1-9])/;if(str.search(l)!=-1){m=+str.match(l)[0]-1;str=str.substr(str.match(l)[0].length);break;}else{return"";};case"t":if(str.search(/2[89]|3[01]/)!=-1){str=str.substr(2);break;};break;case"Y":if(str.search(/^(\d{4})/)!=-1){y=str.substr(0,4);str=str.substr(4);break;}else{return"";};case"y":if(str.search(/^(\d{4})/)!=-1){y=str.substr(0,4);str=str.substr(4);break;}else if(str.search(/^(0[0-9]|[1-9][0-9])/)!=-1){y=str.substr(0,2);y=+y<50?'20'+""+String(y):'19'+""
+String(y);str=str.substr(2);break;}else
return"";default:return"";};};if(!(str=="")||(d===false&&m===false&&y===false)){return false;};m=m===false?11:m;y=y===false?now.getFullYear():y;d=d===false?daysInMonth(+m,+y):d;if(d>daysInMonth(+m,+y)){return false;};var tmpDate=new Date(y,m,d);return!tmpDate||isNaN(tmpDate)?false:tmpDate;};var findLabelForElement=function(element){var label;if(element.parentNode&&element.parentNode.tagName.toLowerCase()=="label")
lebel=element.parentNode;else{var labelList=document.getElementsByTagName('label');for(var lbl=0;lbl<labelList.length;lbl++){if((labelList[lbl]['htmlFor']&&labelList[lbl]['htmlFor']==element.id)||(labelList[lbl].getAttribute('for')==element.id)){label=labelList[lbl];break;};};};if(label&&!label.id){label.id=element.id+"_label";};return label;};var updateLanguage=function(){if(typeof(window.fdLocale)=="object"){localeImport={titles:fdLocale.titles,fullMonths:fdLocale.fullMonths,monthAbbrs:fdLocale.monthAbbrs,fullDays:fdLocale.fullDays,dayAbbrs:fdLocale.dayAbbrs,firstDayOfWeek:("firstDayOfWeek"in fdLocale)?fdLocale.firstDayOfWeek:0,imported:true};}else if(!localeImport){localeImport=localeDefaults;};};var loadLanguage=function(){updateLanguage();for(dp in datePickers){if(!datePickers[dp].created)
continue;datePickers[dp].updateTable();};};var checkElem=function(elem){return!(!elem||!elem.tagName||!((elem.tagName.toLowerCase()=="input"&&(elem.type=="text"||elem.type=="hidden"))||elem.tagName.toLowerCase()=="select"));};var addDatePicker=function(options){updateLanguage();if(!options.formElements){if(debug)
throw"No form elements stipulated within initialisation parameters";return;};options.id=(options.id&&(options.id in options.formElements))?options.id:"";options.formatMasks={};var testParts=[dParts,mParts,yParts],partsFound=[0,0,0],tmpPartsFound,matchedPart,newParts,indParts,fmt,fmtBag,fmtParts,newFormats,myMin,myMax;for(var elemID in options.formElements){elem=document.getElementById(elemID);if(!checkElem(elem)){if(debug)
throw"The element with and id of '"
+elemID
+"' is of the wrong type or does not exist within the DOM";return false;};if(!options.id)
options.id=elemID;fmt=options.formElements[elemID];if(!(fmt.match(validFmtRegExp))){if(debug)
throw"The element with and id of '"
+elemID
+"' has the following incorrect date format assigned to it: "
+fmt;return false;};fmtBag=[fmt];if(options.dateFormats&&(elemID in options.dateFormats)&&options.dateFormats[elemID].length){newFormats=[];for(var f=0,bDft;bDft=options.dateFormats[elemID][f];f++){if(!(bDft.match(validFmtRegExp))){if(debug)
throw"The element with and id of '"
+elemID
+"' has the following incorrect date format assigned to it within the dateFormats parameter: "
+bDft;return false;};newFormats.push(bDft);};fmtBag=fmtBag.concat(newFormats);};tmpPartsFound=[0,0,0];for(var i=0,testPart;testPart=testParts[i];i++){if(fmt.search(new RegExp('('+testPart+')'))!=-1){partsFound[i]=tmpPartsFound[i]=1;if(elem.tagName.toLowerCase()=="input"){matchedPart=fmt.match(new RegExp('('+testPart+')'))[0];newParts=String(matchedPart
+"|"
+testPart.replace(new RegExp("("+matchedPart
+")"),"")).replace("||","|");indParts=newParts.split("|");newFormats=[];for(var z=0,bFmt;bFmt=fmtBag[z];z++){for(var x=0,indPart;indPart=indParts[x];x++){if(indPart==matchedPart)
continue;newFormats.push(bFmt.replace(new RegExp('('+testPart+')(-|$)','g'),indPart+"-").replace(/-$/,""));};};fmtBag=fmtBag.concat(newFormats);};};};options.formatMasks[elemID]=fmtBag.concat();if(elem.tagName.toLowerCase()=="select"){myMin=myMax=0;var selOptions=elem.options;if(tmpPartsFound[0]&&tmpPartsFound[1]&&tmpPartsFound[2]){var yyyymmdd,cursorDate=false;if("disabledDates"in options){delete(options.disabledDates);};options.enabledDates={};for(i=0;i<selOptions.length;i++){for(var f=0,fmt;fmt=fmtBag[f];f++){dt=parseDateString(selOptions[i].value,fmt);if(dt){yyyymmdd=dt.getFullYear()+""
+pad(dt.getMonth()+1)+""
+pad(dt.getDate());if(!cursorDate)
cursorDate=yyyymmdd;options.enabledDates[yyyymmdd]=1;if(!myMin||Number(yyyymmdd)<myMin){myMin=yyyymmdd;};if(!myMax||Number(yyyymmdd)>myMax){myMax=yyyymmdd;};break;};};};if(!options.cursorDate&&cursorDate)
options.cursorDate=cursorDate;}else if(tmpPartsFound[1]&&tmpPartsFound[2]){var yyyymm;for(i=0;i<selOptions.length;i++){for(var f=0,fmt;fmt=fmtBag[f];f++){dt=parseDateString(selOptions[i].value,fmt);if(dt){yyyymm=dt.getFullYear()+""
+pad(dt.getMonth()+1);if(!myMin||Number(yyyymm)<myMin){myMin=yyyymm;};if(!myMax||Number(yyyymm)>myMax){myMax=yyyymm;};break;};};};myMin+=""+"01";myMax+=""
+daysInMonth(+myMax.substr(4,2)-1,+myMax.substr(0,4));}else if(tmpPartsFound[2]){var yyyy;for(i=0;i<selOptions.length;i++){for(var f=0,fmt;fmt=fmtBag[f];f++){dt=parseDateString(selOptions[i].value,fmt);if(dt){yyyy=dt.getFullYear();if(!myMin||Number(yyyy)<myMin){myMin=yyyy;};if(!myMax||Number(yyyy)>myMax){myMax=yyyy;};break;};};};myMin+="0101";myMax+="1231";};if(myMin&&(!options.rangeLow||(+options.rangeLow<+myMin)))
options.rangeLow=myMin;if(myMax&&(!options.rangeHigh||(+options.rangeHigh>+myMin)))
options.rangeHigh=myMax;};};if(!(partsFound[0]&&partsFound[1]&&partsFound[2])){if(debug)
throw"Could not find all of the required date parts for element: "
+elem.id;return false;};var opts={formElements:options.formElements,id:options.id,formatMasks:options.formatMasks,staticPos:!!(options.staticPos),positioned:options.positioned&&document.getElementById(options.positioned)?options.positioned:"",rangeLow:options.rangeLow&&String(options.rangeLow).search(rangeRegExp)!=-1?options.rangeLow:"",rangeHigh:options.rangeHigh&&String(options.rangeHigh).search(rangeRegExp)!=-1?options.rangeHigh:"",statusFormat:options.statusFormat&&String(options.statusFormat).search(validFmtRegExp)!=-1?options.statusFormat:"",noFadeEffect:!!(options.staticPos)?true:!!(options.noFadeEffect),dragDisabled:nodrag||!!(options.staticPos)?true:!!(options.dragDisabled),bespokeTabIndex:options.bespokeTabindex&&typeof options.bespokeTabindex=='number'?parseInt(options.bespokeTabindex,10):0,bespokeTitles:options.bespokeTitles||{},finalOpacity:options.finalOpacity&&typeof options.finalOpacity=='number'&&(options.finalOpacity>20&&options.finalOpacity<=100)?parseInt(+options.finalOpacity,10):(!!(options.staticPos)?100:finalOpacity),hideInput:!!(options.hideInput),noToday:!!(options.noTodayButton),showWeeks:!!(options.showWeeks),fillGrid:!!(options.fillGrid),constrainSelection:"constrainSelection"in options?!!(options.constrainSelection):true,cursorDate:options.cursorDate&&String(options.cursorDate).search(rangeRegExp)!=-1?options.cursorDate:"",labelledBy:findLabelForElement(elem),describedBy:(options.describedBy&&document.getElementById(options.describedBy))?options.describedBy:describedBy&&document.getElementById(describedBy)?describedBy:"",callbacks:options.callbackFunctions?options.callbackFunctions:{},highlightDays:options.highlightDays&&options.highlightDays.length&&options.highlightDays.length==7?options.highlightDays:[0,0,0,0,0,1,1],disabledDays:options.disabledDays&&options.disabledDays.length&&options.disabledDays.length==7?options.disabledDays:[0,0,0,0,0,0,0]};if(options.disabledDates){if(options.enabledDates)
delete(options.enabledDates);opts.disabledDates={};var startD;for(startD in options.disabledDates){if((String(startD).search(wcDateRegExp)!=-1&&options.disabledDates[startD]==1)||(String(startD).search(rangeRegExp)!=-1&&String(options.disabledDates[startD]).search(rangeRegExp)!=-1)){opts.disabledDates[startD]=options.disabledDates[startD];};};}else if(options.enabledDates){var startD;opts.enabledDates={};for(startD in options.enabledDates){if((String(startD).search(wcDateRegExp)!=-1&&options.enabledDates[startD]==1)||(String(startD).search(rangeRegExp)!=-1&&String(options.enabledDates[startD]).search(rangeRegExp)!=-1)){opts.enabledDates[startD]=options.enabledDates[startD];};};};datePickers[options.id]=new datePicker(opts);datePickers[options.id].callback("create",datePickers[options.id].createCbArgObj());};var isVisible=function(id){return(!id||!(id in datePickers))?false:datePickers[id].visible;};addEvent(window,'unload',destroy);return{addEvent:function(obj,type,fn){return addEvent(obj,type,fn);},removeEvent:function(obj,type,fn){return removeEvent(obj,type,fn);},stopEvent:function(e){return stopEvent(e);},show:function(inpID){return showDatePicker(inpID,false);},hide:function(inpID){return hideDatePicker(inpID);},createDatePicker:function(options){addDatePicker(options);},destroyDatePicker:function(inpID){destroySingleDatePicker(inpID);},cleanUp:function(){cleanUp();},printFormattedDate:function(dt,fmt,useImportedLocale){return printFormattedDate(dt,fmt,useImportedLocale);},setDateFromInput:function(inpID){if(!inpID||!(inpID in datePickers))
return false;datePickers[inpID].setDateFromInput();},setRangeLow:function(inpID,yyyymmdd){if(!inpID||!(inpID in datePickers)){return false;};datePickers[inpID].setRangeLow(yyyymmdd);},setRangeHigh:function(inpID,yyyymmdd){if(!inpID||!(inpID in datePickers)){return false;};datePickers[inpID].setRangeHigh(yyyymmdd);},setBespokeTitles:function(inpID,titles){if(!inpID||!(inpID in datePickers)){return false;};datePickers[inpID].setBespokeTitles(titles);},addBespokeTitles:function(inpID,titles){if(!inpID||!(inpID in datePickers)){return false;};datePickers[inpID].addBespokeTitles(titles);},parseDateString:function(str,format){return parseDateString(str,format);},setGlobalVars:function(json){affectJSON(json);},setSelectedDate:function(inpID,yyyymmdd){if(!inpID||!(inpID in datePickers)){return false;};datePickers[inpID].setSelectedDate(yyyymmdd);},dateValidForSelection:function(inpID,dt){if(!inpID||!(inpID in datePickers))
return false;return datePickers[inpID].canDateBeSelected(dt);},addDisabledDates:function(inpID,dts){if(!inpID||!(inpID in datePickers))
return false;datePickers[inpID].addDisabledDates(dts);},setDisabledDates:function(inpID,dts){if(!inpID||!(inpID in datePickers))
return false;datePickers[inpID].setDisabledDates(dts);},addEnabledDates:function(inpID,dts){if(!inpID||!(inpID in datePickers))
return false;datePickers[inpID].addEnabledDates(dts);},setEnabledDates:function(inpID,dts){if(!inpID||!(inpID in datePickers))
return false;datePickers[inpID].setEnabledDates(dts);},disable:function(inpID){if(!inpID||!(inpID in datePickers))
return false;datePickers[inpID].disableDatePicker();},enable:function(inpID){if(!inpID||!(inpID in datePickers))
return false;datePickers[inpID].enableDatePicker();},setCursorDate:function(inpID,yyyymmdd){if(!inpID||!(inpID in datePickers))
return false;datePickers[inpID].setCursorDate(yyyymmdd);},getSelectedDate:function(inpID){return(!inpID||!(inpID in datePickers))?false:datePickers[inpID].returnSelectedDate();},loadLanguage:function(){loadLanguage();},setDebug:function(dbg){debug=!!(dbg);}};})();Ext.ns("Ext.ux");Ext.ux.MessageSlider=Ext.extend(Ext.util.Observable,{items:[],renderTo:document.body,displayIndex:-1,intervalTime:6,msgContainerCls:"ux-msg-slider-container",msgInnerCls:"ux-msg-slider-item",constructor:function(a){Ext.apply(this,a);Ext.ux.MessageSlider.superclass.constructor.call(this);this.addEvents("change");this.init()},init:function(){this.el=Ext.get(this.renderTo);this.activeItem=this.items[this.displayIndex];this.itemscontainer=[],this.initMarkup();this.initEvents()},initMarkup:function(){this.containerEl=this.el.createChild({tag:"div",cls:this.msgContainerCls});for(a in this.items){if(Ext.isObject(this.items[a])){var innerEl=this.containerEl.createChild({tag:"div",cls:this.msgInnerCls,html:this.items[a].content+' ... '});innerEl.createChild({tag:"a",cls:this.msgInnerCls,href:this.items[a].url||"#",html:'Weiterlesen',target:this.items[a].target||"_blank"});this.itemscontainer.push(innerEl);}};},initEvents:function(){this.containerEl.on('mouseenter',function(){Ext.TaskMgr.stop(this.playTask);},this);this.containerEl.on('mouseleave',function(){Ext.TaskMgr.start(this.playTask);},this,{buffer:(this.intervalTime/2)*1000});this.playTask={run:function(){if(Ext.get(this.containerEl).parent().isVisible()){this.displayIndex=this.itemscontainer[this.displayIndex
+1]?this.displayIndex+1:0;this.showMsg(this.displayIndex);}},interval:this.intervalTime*1000,scope:this};this.playTaskBuffer=new Ext.util.DelayedTask(function(){Ext.TaskMgr.start(this.playTask);},this);this.playTaskBuffer.delay(this.intervalTime*1000);},showMsg:function(a){if(this.itemscontainer[a]){this.itemscontainer[a].slideOut("t",{callback:this.updateMsg,scope:this,duration:0.4})}},updateMsg:function(){Ext.fly(this.containerEl).appendChild(this.itemscontainer[this.displayIndex]);this.itemscontainer[this.displayIndex].slideIn("b",{duration:0.2})}});Ext.ux.Anfahrt=Ext.extend(Ext.util.Observable,{anfahrt_map:null,mgr:null,gdir:null,geocoder:null,addressMarker:null,elMap:null,elDirections:null,Lat:null,Lng:null,constructor:function(elMap,elDirections,Lat,Lng){Ext.ux.Anfahrt.superclass.constructor.call(this);this.elMap=Ext.get(elMap);this.elDirections=Ext.get(elDirections);},initialize:function(Lat,Lng){this.elDirections.update("");if(GBrowserIsCompatible()){this.anfahrt_map=new GMap2(this.elMap.dom);this.anfahrt_map.setCenter(new GLatLng(Lat,Lng),13);this.anfahrt_map.addControl(new GMapTypeControl(),new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(10,40)));this.anfahrt_map.addControl(new GLargeMapControl3D(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(10,40)));this.icon=new GIcon(G_DEFAULT_ICON);this.icon.image="/img/icons/nadel.png";this.marker=new GMarker(new GLatLng(Lat,Lng),{icon:this.icon});this.anfahrt_map.addOverlay(this.marker);this.gdir=new GDirections(this.anfahrt_map,this.elDirections.dom);GEvent.addListener(this.gdir,"load",function(){});GEvent.addListener(this.gdir,"error",function(){alert("Zu dieser Adresse konnte kein korrespondierender geografischer Ort gefunden werden. Das kann daran liegen, dass die Adresse neu ist oder inkorrekt.");});}},setDirections:function(fromAddress,toAddress,locale){if(window.Header){Header.showMap();}
this.initialize(this.Lat,this.Lng);this.gdir.load("from: "+fromAddress+" to: "+toAddress,{"locale":locale});this.marker.hide();}});Ext.ux.Videos=Ext.extend(Ext.util.Observable,{width:600,height:300,maxWidth:'2000',maxHeight:'2000',autoplay:true,showAndDontplay:false,constructor:function(renderTo,oberverregion,config){Ext.apply(this,config);this.renderTo=renderTo;if(config.width=='auto'&&this.renderTo!='popup'){this.width=Ext.get(this.renderTo).getWidth();}else if(config.width!='auto'){this.maxWidth=config.width;}
if(config.height=='auto'&&this.renderTo!='popup'){this.height=Ext.get(this.renderTo).getHeight();}else if(config.height!='auto'){this.maxHeight=config.height;}
if(this.autoplay){this.showAndDontplay=false;}
this.el=Ext.get(oberverregion);this.init();},init:function(){if(this.renderTo=='popup'){Ext.getBody().createChild('<div id="hiddenvidoediv" style="display:none;"></div>');this.renderTo='hiddenvidoediv';this.width='100%';this.height='100%';var w=this.maxWidth;var h=this.maxHeight;Ext.ux.extbox.register('a.popup',false,{href:'#'+this.renderTo,innerWidth:w,innerHeight:h,inline:true,scale:true,current:"{current} of {total}",close:'&#215;',hideInfo:'auto'});}
this.addEvents('click');this.el.select('a').each(function(el){el.on("click",function(e,t){e.preventDefault();var target=Ext.get(t);if(target&&target.hasClass('video')){if(target.hasClass('youtube')){Youtubeplayer.playVideo(target.getAttribute('href'),this.renderTo,this.width,this.height);}
if(target&&target.hasClass('vimeo')){Vimeoplayer.playVideo(target.getAttribute('href'),this.renderTo,this.width,this.height);}}},this);},this);if((this.autoplay||this.showAndDontplay)&&this.renderTo!='popup'){var target=this.el.select('a:first');var target=Ext.get(target.elements[0]);if(target&&target.hasClass('video')){if(target.hasClass('youtube')){Youtubeplayer.playVideo(target.getAttribute('href'),this.renderTo,this.width,this.height,this.showAndDontplay);}
if(target&&target.hasClass('vimeo')){Vimeoplayer.playVideo(target.getAttribute('href'),this.renderTo,this.width,this.height,this.showAndDontplay);}}}}});Ext.ux.Youtubeplayer=Ext.extend(Ext.util.Observable,{ytPlayer:null,isFirst:true,constructor:function(renderTo,element,self,config){Ext.apply(this,config);},isFirst:function(){if(this.isFirst){this.isFirst=false;return true;}
return this.isFirst;},playVideo:function(videoId,target,width,height,isFirst){this.isFirst=isFirst;if(isFirst==null||isFirst==0){autoplay=1;}else{autoplay=0;}
videoId=videoId.split("/");videoId=videoId[videoId.length-1];Ext.get(target).update('<div id="videoplace"></div>');target="videoplace";var params={allowScriptAccess:"always",wmode:"transparent"};var atts={id:"ytPlayer"};swfobject.embedSWF("http://www.youtube.com/v/"
+videoId
+"&enablejsapi=1&playerapiid=ytPlayer&color1=ffffff&color2=cccccc&showsearch=0&showinfo=0&rel=0&autoplay="
+autoplay+"&fs=1",target,width,height,"8",null,null,params,atts);}});var Youtubeplayer=new Ext.ux.Youtubeplayer();function onYouTubePlayerReady(playerId){if(!Youtubeplayer.isFirst()){document.getElementById(playerId).playVideo()}}
Ext.ux.Vimeoplayer=Ext.extend(Ext.util.Observable,{vPlayer:null,constructor:function(renderTo,element,self,config){Ext.apply(this,config);},isFirst:function(){if(this.isFirst){this.isFirst=false;return true;}
return this.isFirst;},playVideo:function(videoId,target,width,height,isFirst){this.isFirst=isFirst;if(isFirst==null||isFirst==0){autoplay=1;}else{autoplay=0;}
videoId=videoId.split("/");videoId=videoId[1];Ext.get(target).update('<div id="videocontainer"><div id="videoplace"></div></div>');target="videoplace";var flashvars={clip_id:videoId,show_portrait:1,show_byline:0,show_title:0,autoplay:0,js_api:1,js_onLoad:'onVimeoPlayerReady',js_swf_id:'moogaloop'};var params={allowscriptaccess:'always',allowfullscreen:'true',wmode:"transparent"};var attributes={id:"moogaloop"};swfobject.embedSWF("http://vimeo.com/moogaloop.swf",target,width,height,"10.0.0","expressInstall.swf",flashvars,params,attributes);}});var Vimeoplayer=new Ext.ux.Vimeoplayer();function onVimeoPlayerReady(playerId){if(!Vimeoplayer.isFirst()){document.getElementById(playerId).api_play();}
document.getElementById(playerId).api_changeColor('ffffff');}
Ext.ux.Newsroom=Ext.extend(Ext.util.Observable,{open:true,elId:null,oheight:0,els:{},constructor:function(elId,config){config=config||{};Ext.apply(this,config);Ext.ux.Newsroom.superclass.constructor.call(this,config);this.elId=elId;this.el=Ext.get(elId);this.initMarkup();this.initEvents();},initMarkup:function(){this.els.open=Ext.get(this.el.select('.more').elements[0]);this.els.close=Ext.get(this.el.select('.less').elements[0]);this.els.box=Ext.get(this.el.select('.newsrooomitems-block').elements[0]);this.oheight=this.els.box.getHeight()+10;this.els.box.setStyle({visibility:'visible',height:'420px'})},initEvents:function(){Ext.get(this.el.select('.more').elements[0]).on('click',function(ev){this.open();},this);Ext.get(this.el.select('.less').elements[0]).on('click',function(ev){this.close();},this);},close:function(){Ext.get(this.el.select('.more').elements[0]).show();Ext.get(this.el.select('.less').elements[0]).hide();Ext.get(this.el.select('.newsrooomitems-block').elements[0]).scale(null,420,{easing:'easeOut',duration:1});Ext.get(this.el.select('.newsrooomitems-block').elements[0])
window.scrollTo('top',Ext.get(this.el.select('.newsrooomitems-block').elements[0]).getTop());},open:function(dontshowmap){Ext.get(this.el.select('.more').elements[0]).hide();Ext.get(this.el.select('.less').elements[0]).show();Ext.get(this.el.select('.newsrooomitems-block').elements[0]).scale(null,this.oheight,{easing:'easeOut',duration:2.5});}});Ext.ns('Ext.ux');Ext.ux.GoogleMap=Ext.extend(Ext.util.Observable,{map:null,markers:[],markerClusterer:null,data:null,defaultCenter:[54.174492,12.082214],box:null,els:[],constructor:function(elId,config){config=config||{};Ext.apply(this,config);if(GBrowserIsCompatible()){Ext.ux.GoogleMap.superclass.constructor.call(this,config);this.addEvents('change');this.addEvents('showonmaps');this.el=Ext.get(elId);this.isrendered=false;if(this.el.getHeight()>0){this.init();}
this.els.showonmap=Ext.getBody().select('.showOnMap');this.initEvents();}},init:function(){if(this.el.getHeight()==0)
return;this.initMarkup();this.loadData(this.data);this.refreshMap();this.show();this.isrendered=true;},hasRendered:function(){return this.isrendered;},initMarkup:function(){var dh=Ext.DomHelper;this.map=new GMap2(this.el.dom);this.map.setMapType(G_NORMAL_MAP);this.map.setUIToDefault();this.map.setCenter(new GLatLng(this.defaultCenter[0],this.defaultCenter[1]),11);this.map.addControl(new GMapTypeControl());this.myscaleControl=new GLargeMapControl3D();this.map.addControl(this.myscaleControl);this.mgr=new MarkerManager(this.map,{trackMarkers:true});this.map.disableScrollWheelZoom();this.icon=new GIcon(G_DEFAULT_ICON);this.icon.image="/img/icons/nadel.png";},initEvents:function(){this.els.showonmap.on('click',function(ev,t){this.showOnMap(t);},this);},loadData:function(data){this.data=data;for(var i=0;i<data.points.length;++i){if(data.points[i].Article.lat!=""){var latlng=new GLatLng(data.points[i].Article.lat,data.points[i].Article.lng);var marker=new GMarker(latlng,{icon:this.icon,map:this.map});marker.info={'id':data.points[i].Menu.id};marker.gmobject=this;GEvent.addListener(marker,"click",function(e){var pixCord=this.gmobject.map.fromLatLngToContainerPixel(this.getLatLng());var mapSize=this.gmobject.map.getSize();this.gmobject.map.panBy(new GSize(Math.round(mapSize.width*0.75)
-pixCord.x,Math.round(mapSize.height/2)
-pixCord.y));Ext.get('mapinfo').show();Ext.get('mapinfo').update("<img src='/img/css/frontend/ajax-loader.gif' class='loader' />");Ext.Ajax.request({url:'/articles/getmapinfo.json',method:'POST',params:{id:this.info.id},success:function(response,opts){var obj=Ext.decode(response.responseText);Ext.get('mapinfo').update(obj.content);}});});this.markers.push(marker);this.mgr.addMarkers(this.markers);}}},refreshMap:function(){if(this.markerClusterer!=null){this.markerClusterer.clearMarkers();}
this.markerClusterer=new MarkerClusterer(this.map,this.markers,{maxZoom:10,gridSize:40});},showOnMap:function(t){t=Ext.get(t);var lat=t.getAttribute('lat');var lon=t.getAttribute('lon');var mid=t.getAttribute('mid');if(this.el.getHeight()==0){this.init();}
Header.showMap();var ll=new GLatLng(lat,lon)
var pixCord=this.map.fromLatLngToContainerPixel(ll);var mapSize=this.map.getSize();this.map.panBy(new GSize(Math.round(mapSize.width*0.75)-pixCord.x,Math.round(mapSize.height/2)-pixCord.y));Ext.get('mapinfo').show();Ext.Ajax.request({url:'/articles/getmapinfo.json',method:'POST',params:{id:mid},success:function(response,opts){var obj=Ext.decode(response.responseText);Ext.get('mapinfo').update(obj.content);}});},show:function(){if(this.markers.length>0){this.markerBounds=new GLatLngBounds();for(var i=0;i<this.markers.length;i++){this.markerBounds.extend(this.markers[i].getLatLng());}
if(this.box){this.map.removeOverlay(this.box);}
this.box=this.map.showBounds(this.markerBounds,{top:30,right:10,left:50});}}});GMap2.prototype.showBounds=function(bounds_,opt_options){var opts=opt_options||{};opts.top=opt_options.top*1||0;opts.left=opt_options.left*1||0;opts.bottom=opt_options.bottom*1||0;opts.right=opt_options.right*1||0;opts.save=opt_options.save||true;opts.disableSetCenter=opt_options.disableSetCenter||false;opts.maxZoom=opt_options.maxZoom*1||18;var ty=this.getCurrentMapType();var port=this.getSize();if(!opts.disableSetCenter){var virtualPort=new GSize(port.width-opts.left-opts.right,port.height-opts.top-opts.bottom);var goodZoom=ty.getBoundsZoomLevel(bounds_,virtualPort);this.setZoom(Math.min(goodZoom,opts.maxZoom));var xOffs=(opts.left-opts.right)/2;var yOffs=(opts.top-opts.bottom)/2;var bPxCenter=this.fromLatLngToDivPixel(bounds_.getCenter());var newCenter=this.fromDivPixelToLatLng(new GPoint(bPxCenter.x
-xOffs,bPxCenter.y-yOffs));this.setCenter(newCenter);if(opts.save)
this.savePosition();}
var portBounds=new GLatLngBounds();portBounds.extend(this.fromContainerPixelToLatLng(new GPoint(opts.left,port.height-opts.bottom)));portBounds.extend(this.fromContainerPixelToLatLng(new GPoint(port.width
-opts.right,opts.top)));return portBounds;}
Ext.ns('Ext.ux');Ext.Element.DISPLAY=2;Ext.ux.Header=Ext.extend(Ext.util.Observable,{hideNavigation:false,activeEl:'Img',open:true,elId:'headercontent',els:{},constructor:function(elId,config){config=config||{};Ext.apply(this,config);Ext.ux.Header.superclass.constructor.call(this,config);this.addEvents('beforeprev','prev','beforenext','next','change','play','pause','freeze','unfreeze');this.el=Ext.get(elId);this.initMarkup();this.initEvents();this.init();},init:function(){this.updateMerken();},initMarkup:function(){var dh=Ext.DomHelper;this.els.merken=Ext.select('.merken').setVisibilityMode(Ext.Element.DISPLAY);this.els.openClose=this.el.select('.header-open-close').setVisibilityMode(Ext.Element.DISPLAY);this.els.openCloseBtn=this.el.select('a.toggleCenterArea');this.els.showimg=this.el.select('.header-showimg').setVisibilityMode(Ext.Element.DISPLAY);this.els.showmap=this.el.select('.header-showmap').setVisibilityMode(Ext.Element.DISPLAY);this.els.showvideo=this.el.select('.header-showvideo').setVisibilityMode(Ext.Element.DISPLAY);this.els.header=this.el.select('.header-center-area').setVisibilityMode(Ext.Element.DISPLAY);this.els.map=this.el.select('.header-map').setVisibilityMode(Ext.Element.DISPLAY);this.els.img=this.el.select('.header-img').setVisibilityMode(Ext.Element.DISPLAY);this.els.video=this.el.select('.header-video').setVisibilityMode(Ext.Element.DISPLAY);this.els.quickinfotoggle=Ext.select('.quick-info-toggle');},initEvents:function(){this.els.openClose.on('click',function(ev){this.toggleHeader();},this);this.els.showimg.on('click',function(ev){this.showImg();},this);this.els.showmap.on('click',function(ev){this.showMap();},this);this.els.showvideo.on('click',function(ev){this.showVideo();},this);this.els.merken.on('click',function(e,t){this.merken(e,t);},this);this.els.quickinfotoggle.on('click',function(ev,t){this.quickinfotoggle(ev,t);},this);},quickinfotoggle:function(ev,t){var el=Ext.get(Ext.DomQuery.selectNode('div.quick-info',Ext.get(t).up('.listitem').id));if(!el.isVisible()){el.slideIn('t',{useDisplay:true});}else{el.slideOut('t',{useDisplay:true});}},updateMerken:function(){var data=VisitorStates.get();for(var i in data.merkliste){var el=Ext.get('merken-'+i);if(el){var elli=Ext.fly(el.findParent('li'));elli.addClass('active-permanent');el.update('Seite gemerkt');}}},merken:function(e,t){var el=Ext.get(t);var elli=Ext.fly(el.findParent('li'));var id=el.id.split('merken-');if(elli.hasClass('active-permanent')){elli.removeClass('active-permanent');el.update('Diese Seite merken');VisitorStates.del(id[1],'merkliste');}else{elli.addClass('active-permanent');el.update('Seite gemerkt');VisitorStates.add(id[1],1,'merkliste');}},open:function(dontshowmap){if(!Ext.fly(this.els.header.elements[0]).isVisible()){this._setVisibilityMode();this.els.openCloseBtn.update('Schließen');this.els.header.slideIn('t',{useDisplay:true});if(!dontshowmap&&!this.map.hasRendered()){this.map.init();}
VisitorStates.add('header.open',true);}},toggleHeader:function(dontshowmap){if(!Ext.fly(this.els.header.elements[0]).isVisible()){this.open(dontshowmap);}else{this._setVisibilityMode();this.els.openCloseBtn.update('Öffnen');this.els.header.slideOut('t',{useDisplay:true});VisitorStates.add('header.open',false);}},showMap:function(){this._setVisibilityMode();this.open(true);this.els.img.hide();this.els.map.show();this.els.video.hide();if(!this.map.hasRendered()){this.map.init();}
VisitorStates.add('header.activeel','map');},showImg:function(){this._setVisibilityMode();this.open();this.els.map.hide();this.els.img.show();this.els.video.hide();VisitorStates.add('header.activeel','img');},showVideo:function(){this._setVisibilityMode();this.open();this.els.map.hide();this.els.img.hide();this.els.video.show();VisitorStates.add('header.activeel','video');},showOnMap:function(){showMap();},_setVisibilityMode:function(){}});Ext.ux.Mainmenu=Ext.extend(Ext.util.Observable,{els:{},frameWidth:500,constructor:function(elId,config){config=config||{};Ext.apply(this,config);Ext.ux.Mainmenu.superclass.constructor.call(this,config);this.el=Ext.get(elId);this.initMarkup();this.initEvents();},initMarkup:function(){var dh=Ext.DomHelper;this.el.addClass('divMenu');dh.insertAfter(this.el,'<div style="clear: both; visibility: hidden;"></div>');this.els.firstlis=this.el.select('ul:first > li');Ext.each(this.els.firstlis.elements,function(li){var template=new Ext.Template('<div class="mainframe" style="display: none;">','<div class="menubg"><ul>{content}</ul></div>','<div class="menufooter"></div>','</div>');var el=Ext.get(li).first('ul');if(el){template.append(Ext.get(li),{content:el.dom.innerHTML});el.remove();}
dh.insertBefore(Ext.get(li).first('a'),'<div class="menuleftborder"></div');var seclis=Ext.get(li).select('ul:first > li');Ext.each(seclis.elements,function(li){var e=Ext.get(li).first('ul');if(e)
dh.insertAfter(e,' <div style="clear: both; visibility: hidden;"/>');});});var gesamtbreite=0;for(var j=0;j<this.els.firstlis.elements.length;j++){var e=Ext.get(this.els.firstlis.elements[j]);var breite=e.getWidth()+e.getBorderWidth('rl');gesamtbreite=gesamtbreite+breite;if(gesamtbreite>=this.frameWidth){e.select('.menubg').addClass('menubg-right');e.select('.menufooter').addClass('menufooter-right');e.select('.mainframe').setStyle({left:((breite-e.getBorderWidth('rl'))-501)
+'px'});}}},initEvents:function(){this.showTask=new Ext.util.DelayedTask(this.showMenu,this);this.hideTask=new Ext.util.DelayedTask(function(){this.showTask.cancel();this.hideAll();this.fireEvent('hide');},this);this.el.hover(function(){this.hideTask.cancel();},function(){this.hideTask.delay(0.1*1000);},this);this.els.firstlis.on('mouseenter',this.onParentEnter,false,{me:this,delay:5});this.el.on('mouseover',function(ev,t){this.manageSiblings(t);if(Ext.isIE){this.showTask.cancel();}},this,{delegate:'li'});},onParentEnter:function(ev,link,o){var item=Ext.get(this),me=o.me;if(item.hasClass('menurightborder')){return;}
me.showTask.delay(me.delay*1000,false,false,[item]);},showMenu:function(item){var item=Ext.get(item);item.addClass("menurightborder");item.select('.mainframe').setStyle('display','block');this.fireEvent('show',item,this);},manageSiblings:function(item){var item=Ext.get(item);item.parent().select('li.menurightborder').each(function(child){if(child.dom.id!==item.dom.id){child.removeClass('menurightborder');child.select('.mainframe').stopFx(false).setStyle('display','none');}});},hideAll:function(){this.manageSiblings(this.el);}});Ext.ns('Ext.ux');Ext.ux.Pagesitebar=Ext.extend(Ext.util.Observable,{hideNavigation:false,activeEl:'Img',open:true,elId:'headercontent',els:{},constructor:function(elId,config){config=config||{};Ext.apply(this,config);Ext.ux.Pagesitebar.superclass.constructor.call(this,config);this.addEvents('beforeprev','prev','beforenext','next','change','play','pause','freeze','unfreeze');this.el=Ext.get('pagesitebar');this.initMarkup();this.initEvents();},initMarkup:function(){var dh=Ext.DomHelper;if(this.el){this.els.img=this.el.select('.showimages').setVisibilityMode(Ext.Element.DISPLAY);this.els.map=this.el.select('.showmap').setVisibilityMode(Ext.Element.DISPLAY);this.els.download=this.el.select('.showdownloads').setVisibilityMode(Ext.Element.DISPLAY);this.els.video=this.el.select('.showvideos').setVisibilityMode(Ext.Element.DISPLAY);this.els.img.originalDisplay='block';this.els.map.originalDisplay='block';this.els.download.originalDisplay='block';this.els.video.originalDisplay='block';}},initEvents:function(){if(this.els.img){this.els.img.on('click',function(ev){this.img();},this);}
if(this.els.map){this.els.map.on('click',function(ev){this.showmap();},this);}
if(this.els.download){this.els.download.on('click',function(ev){this.download();},this);}
if(this.els.video){this.els.video.on('click',function(ev){this.video();},this);}},img:function(){this._hideAll();this.el.select('.page_images').setVisibilityMode(Ext.Element.DISPLAY).show();},showmap:function(){this._hideAll();this.el.select('.page_map').setVisibilityMode(Ext.Element.DISPLAY).show();if(GBrowserIsCompatible()){var map=new GMap2(document.getElementById("page_map"));map.setCenter(new GLatLng(this.data.points[0]['Article']['lat'],this.data.points[0]['Article']['lng']),14);map.setMapType(G_SATELLITE_MAP);map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());map.enableScrollWheelZoom();map.disableScrollWheelZoom();var icon=new GIcon(G_DEFAULT_ICON);icon.image="/img/icons/map-default.png";icon.iconSize=new GSize(25,24);icon.iconAnchor=new GPoint(12,12);icon.shadow="/img/icons/map-default-shadow.png";icon.shadowSize=new GSize(36,36);markerOptions={icon:icon};var point=new GPoint(this.data.points[0]['Article']['lng'],this.data.points[0]['Article']['lat']);map.addOverlay(new GMarker(point,markerOptions));}},video:function(){this._hideAll();this.el.select('.page_videos').setVisibilityMode(Ext.Element.DISPLAY).show();},download:function(){this._hideAll();this.el.select('.page_downloads').setVisibilityMode(Ext.Element.DISPLAY).show();},_hideAll:function(){this.el.select('.page_images').setVisibilityMode(Ext.Element.DISPLAY).hide();this.el.select('.page_videos').setVisibilityMode(Ext.Element.DISPLAY).hide();this.el.select('.page_map').setVisibilityMode(Ext.Element.DISPLAY).hide();this.el.select('.page_downloads').setVisibilityMode(Ext.Element.DISPLAY).hide();}});Ext.ns('Ext.ux');Ext.ux.Rating=Ext.extend(Ext.util.Observable,{starWidth:24,split:1,resetValue:'',defaultSelected:-1,selected:-1,showTitles:true,constructor:function(element,config){Ext.apply(this,config);Ext.ux.Rating.superclass.constructor.call(this);this.addEvents('change','reset');this.el=Ext.get(element);this.init();},init:function(){var me=this;this.values=[];this.titles=[];this.stars=[];this.container=this.el.createChild({cls:'ux-rating-container ux-rating-clearfix'});if(this.canReset){this.resetEl=this.container.createChild({cls:'ux-rating-reset',cn:[{tag:'a',title:this.showTitles?(this.resetTitle||'Reset your vote'):'',html:'Reset'}]});this.resetEl.visibilityMode=Ext.Element.DISPLAY;this.resetEl.hover(function(){Ext.fly(this).addClass('ux-rating-reset-hover');},function(){Ext.fly(this).removeClass('ux-rating-reset-hover');});this.resetEl.on('click',this.reset,this);}
this.on('change',this.change,this);this.radioBoxes=this.el.select('input[type=radio]');this.radioBoxes.each(this.initStar,this);this.input=this.container.createChild({tag:'input',type:'hidden',name:this.name,value:this.values[this.defaultSelected]||this.resetValue});this.radioBoxes.remove();this.select((this.defaultSelected===undefined?false:this.defaultSelected),false)
if(this.disabled){this.disable();}
else{this.enable();}},initStar:function(item,all,i){var sw=Math.floor(this.starWidth/this.split);if(i==0){this.name=item.dom.name;this.disabled=item.dom.disabled;}
this.values[i]=item.dom.value;this.titles[i]=item.dom.title;if(item.dom.checked){this.defaultSelected=i;}
var star=this.container.createChild({cls:'ux-rating-star'});var starLink=star.createChild({tag:'a',html:this.values[i],title:this.showTitles?this.titles[i]:''});if(this.split){var odd=(i%this.split);star.setWidth(sw);starLink.setStyle('margin-left','-'+(odd*sw)+'px');}
this.stars.push(star.dom);},onStarClick:function(ev,t){if(!this.disabled){this.select(this.stars.indexOf(t));}},onStarOver:function(ev,t){if(!this.disabled){this.fillTo(this.stars.indexOf(t),true);}},onStarOut:function(ev,t){if(!this.disabled){this.fillTo(this.selected,false);}},reset:function(ev,t){this.select(-1);},select:function(index,fireEvent){if(fireEvent===undefined){fireEvent=true;}
if(index===false||index===-1){this.value=this.resetValue;this.title="";this.input.dom.value='';if(this.canReset){this.resetEl.setOpacity(0.5);}
this.fillNone();if(this.selected!==-1&&fireEvent){this.fireEvent('change',this,this.values[index],this.stars[index]);}
this.selected=-1;}
else
if(index!==this.selected){this.selected=index;this.value=this.values[index];this.title=this.titles[index];this.input.dom.value=this.value;if(this.canReset){this.resetEl.setOpacity(0.99);}
this.fillTo(index,false);if(fireEvent)
this.fireEvent('change',this,this.values[index],this.stars[index]);}},fillTo:function(index,hover){if(index!=-1){var addClass=hover?'ux-rating-star-hover':'ux-rating-star-on';var removeClass=hover?'ux-rating-star-on':'ux-rating-star-hover';Ext.each(this.stars.slice(0,index+1),function(){Ext.fly(this).removeClass(removeClass).addClass(addClass);});Ext.each(this.stars.slice(index+1),function(){Ext.fly(this).removeClass([removeClass,addClass]);});}
else{this.fillNone();}},change:function(e,a,b){Ext.Ajax.request({url:'/articles/vote.json',method:'POST',params:{id:e.name,vote:a},success:function(response,opts){var obj=Ext.decode(response.responseText);}});},fillNone:function(){this.container.select('.ux-rating-star').removeClass(['ux-rating-star-hover','ux-rating-star-on']);},enable:function(){if(this.canReset){this.resetEl.show();}
this.input.dom.disabled=null;this.disabled=false;this.container.removeClass('ux-rating-disabled');this.container.on({click:this.onStarClick,mouseover:this.onStarOver,mouseout:this.onStarOut,scope:this,delegate:'div.ux-rating-star'});},disable:function(){if(this.canReset){this.resetEl.hide();}
this.input.dom.disabled=true;this.disabled=true;this.container.addClass('ux-rating-disabled');this.container.un({click:this.onStarClick,mouseover:this.onStarOver,mouseout:this.onStarOut,scope:this,delegate:'div.ux-rating-star'});},getValue:function(){return this.values[this.selected]||this.resetValue;},destroy:function(){this.disable();this.container.remove();this.radioBoxes.appendTo(this.el);if(this.selected!==-1){this.radioBoxes.elements[this.selected].checked=true;}}});function MarkerClusterer(map,opt_markers,opt_opts){var clusters_=[];var map_=map;var maxZoom_=null;var me_=this;var gridSize_=60;var sizes=[53,56,66,78,90];var styles_=[];var leftMarkers_=[];var mcfn_=null;var calculator_=function(markers){var index=0;var count=markers.length;var dv=count;while(dv!==0){dv=parseInt(dv/10,10);index++;}
var stylesCount=this.getStyles().length;if(stylesCount<index){index=stylesCount;}
return{'text':count,'index':index};};var i=0;for(i=1;i<=5;++i){styles_.push({'url':'/img/icons/map-default.png',height:'24',width:'25'});}
if(typeof opt_opts==='object'&&opt_opts!==null){if(typeof opt_opts.gridSize==='number'&&opt_opts.gridSize>0){gridSize_=opt_opts.gridSize;}
if(typeof opt_opts.maxZoom==='number'){maxZoom_=opt_opts.maxZoom;}
if(typeof opt_opts.styles==='object'&&opt_opts.styles!==null&&opt_opts.styles.length!==0){styles_=opt_opts.styles;}
if(typeof opt_opts.calculator==='function'){calculator_=opt_opts.calculator;}}
this.setCalculator=function(calculator){calculator_=calculator;};this.getCalculator=function(){return GEvent.callback(this,calculator_);};function addLeftMarkers_(){if(leftMarkers_.length===0){return;}
var leftMarkers=[];for(i=0;i<leftMarkers_.length;++i){if(isMarkerInViewport_(leftMarkers_[i])){me_.addMarker(leftMarkers_[i],true,null,null,true);}else{leftMarkers.push(leftMarkers_[i]);}}
leftMarkers_=leftMarkers;}
this.getStyles=function(){return styles_;};this.clearMarkers=function(){for(var i=0;i<clusters_.length;++i){if(typeof clusters_[i]!=="undefined"&&clusters_[i]!==null){clusters_[i].clearMarkers();}}
clusters_=[];leftMarkers_=[];};function isMarkerInViewport_(marker){return map_.getBounds().containsLatLng(marker.getLatLng());}
function reAddMarkers_(markers){var len=markers.length;var clusters=[];for(var i=len-1;i>=0;--i){me_.addMarker(markers[i].marker,true,markers[i].isAdded,clusters,true);}
addLeftMarkers_();}
this.addMarker=function(marker,opt_isNodraw,opt_isAdded,opt_clusters,opt_isNoCheck){if(opt_isNoCheck!==true){if(!isMarkerInViewport_(marker)){leftMarkers_.push(marker);return;}}
var isAdded=opt_isAdded;var clusters=opt_clusters;var pos=map_.fromLatLngToDivPixel(marker.getLatLng());if(typeof isAdded!=="boolean"){isAdded=false;}
if(typeof clusters!=="object"||clusters===null){clusters=clusters_;}
var length=clusters.length;var cluster=null;for(var i=length-1;i>=0;i--){cluster=clusters[i];var center=cluster.getCenter();if(center===null){continue;}
center=map_.fromLatLngToDivPixel(center);if(pos.x>=center.x-gridSize_&&pos.x<=center.x+gridSize_&&pos.y>=center.y-gridSize_&&pos.y<=center.y+gridSize_){cluster.addMarker({'isAdded':isAdded,'marker':marker});if(!opt_isNodraw){cluster.redraw_();}
return;}}
cluster=new Cluster(this,map);cluster.addMarker({'isAdded':isAdded,'marker':marker});if(!opt_isNodraw){cluster.redraw_();}
clusters.push(cluster);if(clusters!==clusters_){clusters_.push(cluster);}};this.removeMarker=function(marker){for(var i=0;i<clusters_.length;++i){if(clusters_[i].removeMarker(marker)){clusters_[i].redraw_();return;}}};this.redraw_=function(){var clusters=this.getClustersInViewport_();for(var i=0;i<clusters.length;++i){clusters[i].redraw_(true);}};this.getClustersInViewport_=function(){var clusters=[];var curBounds=map_.getBounds();for(var i=0;i<clusters_.length;i++){if(clusters_[i].isInBounds(curBounds)){clusters.push(clusters_[i]);}}
return clusters;};this.getMaxZoom_=function(){return maxZoom_;};this.getMap_=function(){return map_;};this.getGridSize_=function(){return gridSize_;};this.getTotalMarkers=function(){var result=0;for(var i=0;i<clusters_.length;++i){result+=clusters_[i].getTotalMarkers();}
return result;};this.getTotalClusters=function(){return clusters_.length;};this.resetViewport=function(){var clusters=this.getClustersInViewport_();var tmpMarkers=[];var removed=0;for(var i=0;i<clusters.length;++i){var cluster=clusters[i];var oldZoom=cluster.getCurrentZoom();if(oldZoom===null){continue;}
var curZoom=map_.getZoom();if(curZoom!==oldZoom){var mks=cluster.getMarkers();for(var j=0;j<mks.length;++j){var newMarker={'isAdded':false,'marker':mks[j].marker};tmpMarkers.push(newMarker);}
cluster.clearMarkers();removed++;for(j=0;j<clusters_.length;++j){if(cluster===clusters_[j]){clusters_.splice(j,1);}}}}
reAddMarkers_(tmpMarkers);this.redraw_();};this.addMarkers=function(markers){for(var i=0;i<markers.length;++i){this.addMarker(markers[i],true);}
this.redraw_();};if(typeof opt_markers==="object"&&opt_markers!==null){this.addMarkers(opt_markers);}
mcfn_=GEvent.addListener(map_,"moveend",function(){me_.resetViewport();});}
function Cluster(markerClusterer){var center_=null;var markers_=[];var markerClusterer_=markerClusterer;var map_=markerClusterer.getMap_();var clusterMarker_=null;var zoom_=map_.getZoom();this.getMarkers=function(){return markers_;};this.isInBounds=function(bounds){if(center_===null){return false;}
if(!bounds){bounds=map_.getBounds();}
var sw=map_.fromLatLngToDivPixel(bounds.getSouthWest());var ne=map_.fromLatLngToDivPixel(bounds.getNorthEast());var centerxy=map_.fromLatLngToDivPixel(center_);var inViewport=true;var gridSize=markerClusterer.getGridSize_();if(zoom_!==map_.getZoom()){var dl=map_.getZoom()-zoom_;gridSize=Math.pow(2,dl)*gridSize;}
if(ne.x!==sw.x&&(centerxy.x+gridSize<sw.x||centerxy.x-gridSize>ne.x)){inViewport=false;}
if(inViewport&&(centerxy.y+gridSize<ne.y||centerxy.y-gridSize>sw.y)){inViewport=false;}
return inViewport;};this.getCenter=function(){return center_;};this.addMarker=function(marker){if(center_===null){center_=marker.marker.getLatLng();}
markers_.push(marker);};this.removeMarker=function(marker){for(var i=0;i<markers_.length;++i){if(marker===markers_[i].marker){if(markers_[i].isAdded){map_.removeOverlay(markers_[i].marker);}
markers_.splice(i,1);return true;}}
return false;};this.getCurrentZoom=function(){return zoom_;};this.redraw_=function(isForce){if(!isForce&&!this.isInBounds()){return;}
zoom_=map_.getZoom();var i=0;var mz=markerClusterer.getMaxZoom_();if(mz===null){mz=map_.getCurrentMapType().getMaximumResolution();}
if(zoom_>mz||this.getTotalMarkers()===1){for(i=0;i<markers_.length;++i){if(markers_[i].isAdded){if(markers_[i].marker.isHidden()){markers_[i].marker.show();}}else{map_.addOverlay(markers_[i].marker);markers_[i].isAdded=true;}}
if(clusterMarker_!==null){clusterMarker_.hide();}}else if(this.getTotalMarkers()>1){for(i=0;i<markers_.length;++i){if(markers_[i].isAdded&&(!markers_[i].marker.isHidden())){markers_[i].marker.hide();}}
var sums=markerClusterer_.getCalculator()(this.getRealMarkers());if(clusterMarker_===null){clusterMarker_=new ClusterMarker_(center_,sums,markerClusterer_.getStyles(),markerClusterer_.getGridSize_());map_.addOverlay(clusterMarker_);}else{if(clusterMarker_.isHidden()){clusterMarker_.show();}
clusterMarker_.setSums(sums);clusterMarker_.redraw(true);}}};this.clearMarkers=function(){if(clusterMarker_!==null){map_.removeOverlay(clusterMarker_);}
for(var i=0;i<markers_.length;++i){if(markers_[i].isAdded){map_.removeOverlay(markers_[i].marker);}}
markers_=[];};this.getTotalMarkers=function(){return markers_.length;};this.getRealMarkers=function(){var result=[];for(var i=0;i<markers_.length;++i){result.push(markers_[i].marker);}
return result;};}
function ClusterMarker_(latlng,sums,styles,padding){var index=sums.index;this.useStyle(styles[index-1]);this.styleDirty_=false;this.latlng_=latlng;this.index_=index;this.styles_=styles;this.text_=sums.text;this.padding_=padding;this.sums_=sums;}
ClusterMarker_.prototype=new GOverlay();ClusterMarker_.prototype.useStyle=function(style){this.url_=style.url;this.height_=style.height;this.width_=style.width;this.textColor_=style.opt_textColor;this.anchor_=style.opt_anchor;};ClusterMarker_.prototype.initialize=function(map){this.map_=map;var div=document.createElement("div");var latlng=this.latlng_;var pos=this.getPosFromLatLng(latlng);div.style.cssText=this.createCss(pos);div.innerHTML=this.text_;map.getPane(G_MAP_MAP_PANE).appendChild(div);var padding=this.padding_;GEvent.addDomListener(div,"click",function(){var pos=map.fromLatLngToDivPixel(latlng);var sw=new GPoint(pos.x-padding,pos.y+padding);sw=map.fromDivPixelToLatLng(sw);var ne=new GPoint(pos.x+padding,pos.y-padding);ne=map.fromDivPixelToLatLng(ne);var zoom=map.getBoundsZoomLevel(new GLatLngBounds(sw,ne),map.getSize());map.setCenter(latlng,zoom);});this.div_=div;};ClusterMarker_.prototype.getPosFromLatLng=function(latlng){var pos=this.map_.fromLatLngToDivPixel(latlng);pos.x-=parseInt(this.width_/2,10);pos.y-=parseInt(this.height_/2,10);return pos;};ClusterMarker_.prototype.createCss=function(pos){var mstyle="";if(document.all){mstyle='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+this.url_+'");';}else{mstyle="background:url("+this.url_+");";}
if(typeof this.anchor_==="object"){if(typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){mstyle+='height:'+(this.height_-this.anchor_[0])+'px;padding-top:'+this.anchor_[0]+'px;';}else{mstyle+='height:'+this.height_+'px;line-height:'+this.height_+'px;';}
if(typeof this.anchor_[1]==="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){mstyle+='width:'+(this.width_-this.anchor_[1])+'px;padding-left:'+(this.anchor_[1]+7)+'px;';}else{mstyle+='width:'+this.width_+'px;text-align:center;';}}else{mstyle+='height:'+this.height_+'px;line-height:'+this.height_+'px;';mstyle+='width:'+this.width_+'px;text-align:center;';}
var txtColor=this.textColor_?this.textColor_:'black';return mstyle+'cursor:pointer;top:'+pos.y+"px;left:"+
pos.x+"px;color:"+txtColor+";position:absolute;font-size:11px;"+'font-family:Arial,sans-serif;font-weight:bold';};ClusterMarker_.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_);};ClusterMarker_.prototype.copy=function(){return new ClusterMarker_(this.latlng_,this.sums_,this.text_,this.styles_,this.padding_);};ClusterMarker_.prototype.redraw=function(force){if(!force){return;}
var pos=this.getPosFromLatLng(this.latlng_);if(this.styleDirty_){this.styleDirty_=false;this.useStyle(this.styles_[this.index_-1]);this.div_.style.cssText=this.createCss(pos);}else{this.div_.style.top=pos.y+"px";this.div_.style.left=pos.x+"px";}};ClusterMarker_.prototype.hide=function(){this.div_.style.display="none";};ClusterMarker_.prototype.show=function(){this.div_.style.display="";};ClusterMarker_.prototype.isHidden=function(){return this.div_.style.display==="none";};ClusterMarker_.prototype.setSums=function(sums){if(sums.index!==this.index_){this.styleDirty_=true;}
this.sums_=sums;this.text_=sums.text;this.index_=sums.index;this.div_.innerHTML=sums.text;};eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 4(c,b){2 e=3;e.13=c;e.D=c.1k();e.1h=c.1V().1N();b=b||{};e.N=4.1f;2 g=c.29();2 h=g[0].1o();l(2 i=0;i<g.E;i++){2 f=g[i].1o();7(f>h){h=f}}e.p=b.1J||h;e.18=b.1E;e.m=b.15||C;2 d;7(28 b.1s==="24"){d=b.1s}11{d=4.1q}e.1p=w q(-d,d);e.1j=w q(d,-d);e.1Y=d;e.B=[];e.H=[];e.H[e.p]=[];e.s=[];e.s[e.p]=0;X.1e(c,"1U",e,e.1d);e.r=5(a){c.1L(a);e.G--};e.t=5(a){7(e.m){c.1G(a);e.G++}};e.U();e.G=0;e.8=e.V()}4.1f=1C;4.1q=1z;4.1w=1x;4.6.U=5(){2 a=3;2 c=4.1w;l(2 b=0;b<=a.p;++b){a.H[b]=[];a.s[b]=0;a.B[b]=o.2c(c/a.N);c<<=1}};4.6.27=5(){2 a=3;a.v(a.8,a.r);a.U()};4.6.n=5(a,c,b){2 d=3.1h.25(a,c);9 w 23(o.1r((d.x+b.22)/3.N),o.1r((d.y+b.1Z)/3.N))};4.6.10=5(e,a,f){2 b=e.Z();e.1n=a;7(3.18){X.1e(e,"1m",3,3.1l)}2 d=3.n(b,f,q.A);l(2 c=f;c>=a;c--){2 g=3.Y(d.x,d.y,c);g.1i(e);d.x=d.x>>1;d.y=d.y>>1}};4.6.F=5(e){2 a=3;2 c=a.8.J<=e.y&&e.y<=a.8.I;2 f=a.8.M;2 d=f<=e.x&&e.x<=a.8.K;7(!d&&f<0){2 b=a.B[a.8.z];d=f+b<=e.x&&e.x<=b-1}9 c&&d};4.6.1l=5(e,i,g){2 c=3;2 a=c.p;2 f=O;2 h=c.n(i,a,q.A);2 d=c.n(g,a,q.A);1g(a>=0&&(h.x!==d.x||h.y!==d.y)){2 b=c.L(h.x,h.y,a);7(b){7(c.W(b,e)){c.Y(d.x,d.y,a).1i(e)}}7(a===c.D){7(c.F(h)){7(!c.F(d)){c.r(e);f=C}}11{7(c.F(d)){c.t(e);f=C}}}h.x=h.x>>1;h.y=h.y>>1;d.x=d.x>>1;d.y=d.y>>1;--a}7(f){c.u()}};4.6.1T=5(e){2 c=3;2 b=c.p;2 a=O;2 f=e.Z();2 d=c.n(f,b,q.A);1g(b>=0){2 g=c.L(d.x,d.y,b);7(g){c.W(g,e)}7(b===c.D){7(c.F(d)){c.r(e);a=C}}d.x=d.x>>1;d.y=d.y>>1;--b}7(a){c.u()}c.s[e.1n]--};4.6.1S=5(b,a,c){2 d=3.R(c);l(2 i=b.E-1;i>=0;i--){3.10(b[i],a,d)}3.s[a]+=b.E};4.6.R=5(a){9 a||3.p};4.6.1Q=5(a){2 b=0;l(2 z=0;z<=a;z++){b+=3.s[z]}9 b};4.6.1P=5(e,b,a){2 d=3;2 h=w 1O(e,b);2 g=d.n(h,a,q.A);2 f=w 1M(h);2 c=d.L(g.x,g.y,a);7(c!=1b){l(2 i=0;i<c.E;i++){7(e==c[i].1a().1K()&&b==c[i].1a().T()){f=c[i]}}}9 f};4.6.1I=5(e,a,c){2 b=3;2 f=3.R(c);b.10(e,a,f);2 d=b.n(e.Z(),b.D,q.A);7(b.F(d)&&a<=b.8.z&&b.8.z<=f){b.t(e);b.u()}3.s[a]++};19.6.1H=5(a){2 b=3;9(b.M<=a.x&&b.K>=a.x&&b.J<=a.y&&b.I>=a.y)};4.6.Y=5(x,y,z){2 b=3.H[z];7(x<0){x+=3.B[z]}2 c=b[x];7(!c){c=b[x]=[];9(c[y]=[])}2 a=c[y];7(!a){9(c[y]=[])}9 a};4.6.L=5(x,y,z){2 a=3.H[z];7(x<0){x+=3.B[z]}2 b=a[x];9 b?b[y]:1b};4.6.17=5(j,b,c,e){b=o.S(b,3.p);2 i=j.1F();2 f=j.1D();2 d=3.n(i,b,c);2 g=3.n(f,b,e);2 a=3.B[b];7(f.T()<i.T()||g.x<d.x){d.x-=a}7(g.x-d.x+1>=a){d.x=0;g.x=a-1}2 h=w 19([d,g]);h.z=b;9 h};4.6.V=5(){2 a=3;9 a.17(a.13.1R(),a.D,a.1p,a.1j)};4.6.1d=5(){2 a=3;a.16(3,3.1c,0)};4.6.16=5(b,a,c){9 1B.1A(5(){a.1W(b)},c)};4.6.1X=5(){9 3.m?C:O};4.6.1y=5(){9!3.m};4.6.15=5(){3.m=C;3.P()};4.6.20=5(){3.m=O;3.P()};4.6.21=5(){3.m=!3.m;3.P()};4.6.P=5(){2 a=3;7(a.G>0){a.v(a.8,a.r)}7(a.m){a.v(a.8,a.t)}a.u()};4.6.1c=5(){2 a=3;a.D=3.13.1k();2 b=a.V();7(b.2d(a.8)&&b.z===a.8.z){9}7(b.z!==a.8.z){a.v(a.8,a.r);7(a.m){a.v(b,a.t)}}11{a.14(a.8,b,a.1v);7(a.m){a.14(b,a.8,a.1u)}}a.8=b;a.u()};4.6.u=5(){X.2b(3,"1m",3.8,3.G)};4.6.v=5(b,a){l(2 x=b.M;x<=b.K;x++){l(2 y=b.J;y<=b.I;y++){3.Q(x,y,b.z,a)}}};4.6.Q=5(x,y,z,a){2 b=3.L(x,y,z);7(b){l(2 i=b.E-1;i>=0;i--){a(b[i])}}};4.6.1v=5(x,y,z){3.Q(x,y,z,3.r)};4.6.1u=5(x,y,z){3.Q(x,y,z,3.t)};4.6.14=5(c,d,a){2 b=3;b.1t(c,d,5(x,y){a.2a(b,[x,y,c.z])})};4.6.1t=5(j,k,b){2 f=j.M;2 a=j.J;2 d=j.K;2 h=j.I;2 g=k.M;2 c=k.J;2 e=k.K;2 i=k.I;2 x,y;l(x=f;x<=d;x++){l(y=a;y<=h&&y<c;y++){b(x,y)}l(y=o.12(i+1,a);y<=h;y++){b(x,y)}}l(y=o.12(a,c);y<=o.S(h,i);y++){l(x=o.S(d+1,g)-1;x>=f;x--){b(x,y)}l(x=o.12(f,e+1);x<=d;x++){b(x,y)}}};4.6.W=5(a,c,b){2 d=0;l(2 i=0;i<a.E;++i){7(a[i]===c||(b&&a[i]===c)){a.26(i--,1);d++}}9 d};',62,138,'||var|this|MarkerManager|function|prototype|if|shownBounds_|return||||||||||||for|show_|getTilePoint_|Math|maxZoom_|GSize|removeOverlay_|numMarkers_|addOverlay_|notifyListeners_|processAll_|new||||ZERO|gridWidth_|true|mapZoom_|length|isGridPointVisible_|shownMarkers_|grid_|maxY|minY|maxX|getGridCellNoCreate_|minX|tileSize_|false|refresh|processCellMarkers_|getOptMaxZoom_|min|lng|resetManager_|getMapGridBounds_|removeFromArray_|GEvent|getGridCellCreate_|getPoint|addMarkerBatch_|else|max|map_|rectangleDiff_|show|objectSetTimeout_|getGridBounds_|trackMarkers_|GBounds|getLatLng|undefined|updateMarkers_|onMapMoveEnd_|bind|DEFAULT_TILE_SIZE_|while|projection_|push|nePadding_|getZoom|onMarkerMoved_|changed|MarkerManager_minZoom|getMaximumResolution|swPadding_|DEFAULT_BORDER_PADDING_|floor|borderPadding|rectangleDiffCoords_|addCellMarkers_|removeCellMarkers_|MERCATOR_ZOOM_LEVEL_ZERO_RANGE|256|isHidden|100|setTimeout|window|1024|getNorthEast|trackMarkers|getSouthWest|addOverlay|containsPoint|addMarker|maxZoom|lat|removeOverlay|GMarker|getProjection|GLatLng|getMarker|getMarkerCount|getBounds|addMarkers|removeMarker|moveend|getCurrentMapType|call|visible|borderPadding_|height|hide|toggle|width|GPoint|number|fromLatLngToPixel|splice|clearMarkers|typeof|getMapTypes|apply|trigger|ceil|equals'.split('|'),0,{}))
function ExtInfoWindow(marker,windowId,html,opt_opts){this.html_=html;this.marker_=marker;this.infoWindowId_=windowId;this.options_=opt_opts===null?{}:opt_opts;this.ajaxUrl_=this.options_.ajaxUrl==null?null:this.options_.ajaxUrl;this.callback_=this.options_.ajaxCallback==null?null:this.options_.ajaxCallback;this.maxContent_=this.options_.maxContent==null?null:this.options_.maxContent;this.maximizeEnabled_=this.maxContent_==null?false:true;this.isMaximized_=false;this.borderSize_=this.options_.beakOffset==null?0:this.options_.beakOffset;this.paddingX_=this.options_.paddingX==null?0+this.borderSize_:this.options_.paddingX+this.borderSize_;this.paddingY_=this.options_.paddingY==null?0+this.borderSize_:this.options_.paddingY+this.borderSize_;this.maxPanning_=this.options_.maxPanning==null?500:this.options_.maxPanning;this.map_=null;this.container_=document.createElement('div');this.container_.style.position='relative';this.container_.style.display='none';this.contentDiv_=document.createElement('div');this.contentDiv_.id=this.infoWindowId_+'_contents';this.contentDiv_.innerHTML=this.html_;this.contentDiv_.style.display='block';this.contentDiv_.style.visibility='hidden';this.wrapperDiv_=document.createElement('div');};ExtInfoWindow.prototype=new GOverlay();ExtInfoWindow.prototype.initialize=function(map){this.map_=map;if(this.maximizeEnabled_){this.maxWidth_=this.map_.getSize().width*0.9;this.maxHeight_=this.map_.getSize().height*0.9;}
this.defaultStyles={containerWidth:this.map_.getSize().width/2,borderSize:1};this.wrapperParts={tl:{t:0,l:0,w:0,h:0,domElement:null},t:{t:0,l:0,w:0,h:0,domElement:null},tr:{t:0,l:0,w:0,h:0,domElement:null},l:{t:0,l:0,w:0,h:0,domElement:null},r:{t:0,l:0,w:0,h:0,domElement:null},bl:{t:0,l:0,w:0,h:0,domElement:null},b:{t:0,l:0,w:0,h:0,domElement:null},br:{t:0,l:0,w:0,h:0,domElement:null},beak:{t:0,l:0,w:0,h:0,domElement:null},close:{t:0,l:0,w:0,h:0,domElement:null}};if(this.maximizeEnabled_){this.wrapperParts.max={t:0,l:0,w:0,h:0,domElement:null};this.wrapperParts.min={t:0,l:0,w:0,h:0,domElement:null};}
for(var i in this.wrapperParts){var tempElement=document.createElement('div');tempElement.id=this.infoWindowId_+'_'+i;tempElement.style.visibility='hidden';document.body.appendChild(tempElement);tempElement=document.getElementById(this.infoWindowId_+'_'+i);var tempWrapperPart=this.wrapperParts[i];tempWrapperPart.w=parseInt(this.getStyle_(tempElement,'width'),10);tempWrapperPart.h=parseInt(this.getStyle_(tempElement,'height'),10);document.body.removeChild(tempElement);}
for(var i in this.wrapperParts){if(i=='close'){this.wrapperDiv_.appendChild(this.contentDiv_);}
var wrapperPartsDiv=null;if(this.wrapperParts[i].domElement==null){wrapperPartsDiv=document.createElement('div');this.wrapperDiv_.appendChild(wrapperPartsDiv);}else{wrapperPartsDiv=this.wrapperParts[i].domElement;}
wrapperPartsDiv.id=this.infoWindowId_+'_'+i;wrapperPartsDiv.style.position='absolute';wrapperPartsDiv.style.width=this.wrapperParts[i].w+'px';wrapperPartsDiv.style.height=this.wrapperParts[i].h+'px';wrapperPartsDiv.style.top=this.wrapperParts[i].t+'px';wrapperPartsDiv.style.left=this.wrapperParts[i].l+'px';this.wrapperParts[i].domElement=wrapperPartsDiv;}
this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_);this.container_.id=this.infoWindowId_;var containerWidth=this.getStyle_(document.getElementById(this.infoWindowId_),'width');this.container_.style.width=(containerWidth==null?this.defaultStyles.containerWidth:containerWidth);this.map_.getContainer().appendChild(this.contentDiv_);this.contentWidth=this.getDimensions_(this.container_).width;this.contentDiv_.style.width=this.contentWidth+'px';this.contentDiv_.style.position='absolute';this.container_.appendChild(this.wrapperDiv_);if(this.maximizeEnabled_){this.minWidth_=this.getDimensions_(this.container_).width;}
if(this.maximizeEnabled_){thisMap=this.map_;thisMaxWidth=this.maxWidth_;thisMaxHeight=this.maxHeight_;thisContainer=this.container_;thisMaxContent=this.maxContent_;if(this.marker_){GEvent.trigger(this.marker_,'extinfowindowbeforeclose');}
thisMinWidth=this.container_.style.width;thisMinHeight=this.container_.style.height;GEvent.addDomListener(this.wrapperParts.max.domElement,'click',function(){var infoWindow=thisMap.getExtInfoWindow();infoWindow.container_.style.width=thisMaxWidth+'px';infoWindow.ajaxRequest_(thisMaxContent);if(this.marker_){GEvent.trigger(this.marker_,'extinfowindowclose');}
infoWindow.isMaximized_=true;infoWindow.redraw(true);infoWindow.toggleMaxMin_();});GEvent.addDomListener(this.wrapperParts.min.domElement,'click',function(){var infoWindow=thisMap.getExtInfoWindow();infoWindow.container_.style.width=thisMinWidth;infoWindow.container_.style.height=thisMinHeight;if(infoWindow.ajaxUrl_!=null){infoWindow.ajaxRequest_(this.ajaxUrl_);}else{infoWindow.contentDiv_.innerHTML=infoWindow.html_;}
infoWindow.isMaximized_=false;infoWindow.redraw(true);infoWindow.resize();infoWindow.toggleMaxMin_();});this.toggleMaxMin_();}
var stealEvents=['mousedown','dblclick','DOMMouseScroll'];for(i=0;i<stealEvents.length;i++){GEvent.bindDom(this.container_,stealEvents[i],this,this.onClick_);}
GEvent.trigger(this.map_,'extinfowindowopen');if(this.ajaxUrl_!=null){this.ajaxRequest_(this.ajaxUrl_);}};ExtInfoWindow.prototype.onClick_=function(e){if(navigator.userAgent.toLowerCase().indexOf('msie')!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false;}else{e.stopPropagation();}};ExtInfoWindow.prototype.remove=function(){if(this.map_.getExtInfoWindow()!=null){GEvent.trigger(this.map_,'extinfowindowbeforeclose');GEvent.clearInstanceListeners(this.container_);if(this.container_.outerHTML){this.container_.outerHTML='';}
if(this.container_.parentNode){this.container_.parentNode.removeChild(this.container_);}
this.container_=null;GEvent.trigger(this.map_,'extinfowindowclose');this.map_.setExtInfoWindow_(null);}};ExtInfoWindow.prototype.copy=function(){return new ExtInfoWindow(this.marker_,this.infoWindowId_,this.html_,this.options_);};ExtInfoWindow.prototype.redraw=function(force){if(!force||this.container_==null)return;var contentHeight=this.contentDiv_.offsetHeight;this.contentDiv_.style.height=contentHeight+'px';this.contentWidth=this.getDimensions_(this.container_).width;this.contentDiv_.style.width=this.container_.style.width;this.contentDiv_.style.left=this.wrapperParts.l.w+'px';this.contentDiv_.style.top=this.wrapperParts.tl.h+'px';this.contentDiv_.style.visibility='visible';this.wrapperParts.tl.t=0;this.wrapperParts.tl.l=0;this.wrapperParts.t.l=this.wrapperParts.tl.w;this.wrapperParts.t.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.tl.w-this.wrapperParts.tr.w;this.wrapperParts.t.h=this.wrapperParts.tl.h;this.wrapperParts.tr.l=this.wrapperParts.t.w+this.wrapperParts.tl.w;this.wrapperParts.l.t=this.wrapperParts.tl.h;this.wrapperParts.l.h=contentHeight;this.wrapperParts.r.l=this.contentWidth+this.wrapperParts.l.w;this.wrapperParts.r.t=this.wrapperParts.tr.h;this.wrapperParts.r.h=contentHeight;this.wrapperParts.bl.t=contentHeight+this.wrapperParts.tl.h;this.wrapperParts.b.l=this.wrapperParts.bl.w;this.wrapperParts.b.t=contentHeight+this.wrapperParts.tl.h;this.wrapperParts.b.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.bl.w-this.wrapperParts.br.w;this.wrapperParts.b.h=this.wrapperParts.bl.h;this.wrapperParts.br.l=this.wrapperParts.b.w+this.wrapperParts.bl.w;this.wrapperParts.br.t=contentHeight+this.wrapperParts.tr.h;this.wrapperParts.beak.l=this.borderSize_+(this.contentWidth/2)-(this.wrapperParts.beak.w/2);this.wrapperParts.beak.t=this.wrapperParts.bl.t+this.wrapperParts.bl.h-this.borderSize_;this.wrapperParts.close.l=this.wrapperParts.tr.l+this.wrapperParts.tr.w-this.wrapperParts.close.w-this.borderSize_;this.wrapperParts.close.t=this.borderSize_;if(this.maximizeEnabled_){this.wrapperParts.max.l=this.wrapperParts.close.l-this.wrapperParts.max.w-5;this.wrapperParts.max.t=this.wrapperParts.close.t;this.wrapperParts.min.l=this.wrapperParts.max.l;this.wrapperParts.min.t=this.wrapperParts.max.t;}
for(var i in this.wrapperParts){if(i=='close'){this.wrapperDiv_.insertBefore(this.contentDiv_,this.wrapperParts[i].domElement);}
var wrapperPartsDiv=null;if(this.wrapperParts[i].domElement==null){wrapperPartsDiv=document.createElement('div');this.wrapperDiv_.appendChild(wrapperPartsDiv);}else{wrapperPartsDiv=this.wrapperParts[i].domElement;}
wrapperPartsDiv.id=this.infoWindowId_+'_'+i;wrapperPartsDiv.style.position='absolute';wrapperPartsDiv.style.width=this.wrapperParts[i].w+'px';wrapperPartsDiv.style.height=this.wrapperParts[i].h+'px';wrapperPartsDiv.style.top=this.wrapperParts[i].t+'px';wrapperPartsDiv.style.left=this.wrapperParts[i].l+'px';this.wrapperParts[i].domElement=wrapperPartsDiv;}
var currentMarker=this.marker_;var thisMap=this.map_;GEvent.addDomListener(this.wrapperParts.close.domElement,'click',function(){thisMap.closeExtInfoWindow();});var pixelLocation=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.style.position='absolute';var markerIcon=this.marker_.getIcon();this.container_.style.left=(pixelLocation.x
-(this.contentWidth/2)
-markerIcon.iconAnchor.x
+markerIcon.infoWindowAnchor.x)+'px';this.container_.style.top=(pixelLocation.y
-this.wrapperParts.bl.h
-contentHeight
-this.wrapperParts.tl.h
-this.wrapperParts.beak.h
-markerIcon.iconAnchor.y
+markerIcon.infoWindowAnchor.y
+this.borderSize_)+'px';this.container_.style.display='block';if(this.map_.getExtInfoWindow()!=null){this.repositionMap_();}};ExtInfoWindow.prototype.toggleMaxMin_=function(){if(this.wrapperParts.max.domElement!=null&&this.wrapperParts.min.domElement!=null){if(this.isMaximized_){this.wrapperParts.max.domElement.style.display='none';this.wrapperParts.min.domElement.style.display='block';}else{this.wrapperParts.max.domElement.style.display='block';this.wrapperParts.min.domElement.style.display='none';}}};ExtInfoWindow.prototype.resize=function(){var tempElement=this.contentDiv_.cloneNode(true);tempElement.id=this.infoWindowId_+'_tempContents';tempElement.style.visibility='hidden';tempElement.style.height='auto';document.body.appendChild(tempElement);tempElement=document.getElementById(this.infoWindowId_+'_tempContents');var contentHeight=tempElement.offsetHeight;document.body.removeChild(tempElement);this.contentDiv_.style.height=contentHeight+'px';var contentWidth=this.container_.offsetWidth;var pixelLocation=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var oldWindowHeight=this.wrapperParts.t.domElement.offsetHeight+this.wrapperParts.l.domElement.offsetHeight+this.wrapperParts.b.domElement.offsetHeight;var oldWindowPosTop=this.wrapperParts.t.domElement.offsetTop;this.wrapperParts.l.domElement.style.height=contentHeight+'px';this.wrapperParts.r.domElement.style.height=contentHeight+'px';var newPosTop=this.wrapperParts.b.domElement.offsetTop-contentHeight;this.wrapperParts.l.domElement.style.top=newPosTop+'px';this.wrapperParts.r.domElement.style.top=newPosTop+'px';this.contentDiv_.style.top=newPosTop+'px';windowTHeight=parseInt(this.wrapperParts.t.domElement.style.height,10);newPosTop-=windowTHeight;this.wrapperParts.close.domElement.style.top=newPosTop+this.borderSize_+'px';this.wrapperParts.tl.domElement.style.top=newPosTop+'px';this.wrapperParts.t.domElement.style.top=newPosTop+'px';this.wrapperParts.tr.domElement.style.top=newPosTop+'px';this.repositionMap_();};ExtInfoWindow.prototype.repositionMap_=function(){var mapNE=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var mapSW=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var markerPosition=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var panX=0;var panY=0;var paddingX=this.paddingX_;var paddingY=this.paddingY_;var infoWindowAnchor=this.marker_.getIcon().infoWindowAnchor;var iconAnchor=this.marker_.getIcon().iconAnchor;var windowT=this.wrapperParts.t.domElement;var windowL=this.wrapperParts.l.domElement;var windowB=this.wrapperParts.b.domElement;var windowR=this.wrapperParts.r.domElement;var windowBeak=this.wrapperParts.beak.domElement;var offsetTop=markerPosition.y-(-infoWindowAnchor.y+iconAnchor.y+this.getDimensions_(windowBeak).height+this.getDimensions_(windowB).height+this.getDimensions_(windowL).height+this.getDimensions_(windowT).height+this.paddingY_);if(offsetTop<mapNE.y){panY=mapNE.y-offsetTop;}else{var offsetBottom=markerPosition.y+this.paddingY_;if(offsetBottom>=mapSW.y){panY=-(offsetBottom-mapSW.y);}}
var offsetRight=Math.round(markerPosition.x+this.getDimensions_(this.container_).width/2+this.getDimensions_(windowR).width+this.paddingX_+infoWindowAnchor.x-iconAnchor.x);if(offsetRight>mapNE.x){panX=-(offsetRight-mapNE.x);}else{var offsetLeft=-(Math.round((this.getDimensions_(this.container_).width/2-this.marker_.getIcon().iconSize.width/2)+this.getDimensions_(windowL).width+this.borderSize_+this.paddingX_)-markerPosition.x-infoWindowAnchor.x+iconAnchor.x);if(offsetLeft<mapSW.x){panX=mapSW.x-offsetLeft;}}
if(panX!=0||panY!=0&&this.map_.getExtInfoWindow()!=null){if((panY<0-this.maxPanning_||panY>this.maxPanning_)&&(panX<0-this.maxPanning_||panX>this.maxPanning_)){this.map_.setCenter(this.marker_.getPoint());}else{this.map_.panBy(new GSize(panX,panY));}}};ExtInfoWindow.prototype.ajaxRequest_=function(url){var thisMap=this.map_;var thisCallback=this.callback_;GDownloadUrl(url,function(response,status){if(thisMap.getExtInfoWindow()!==null){var infoWindow=document.getElementById(thisMap.getExtInfoWindow().infoWindowId_+'_contents');if(response==null||status==-1){infoWindow.innerHTML='<span class="error">ERROR: The Ajax request failed to get HTML content from "'+url+'"</span>';}else{infoWindow.innerHTML=response;}
if(thisCallback!=null){thisCallback();}
thisMap.getExtInfoWindow().resize();}
GEvent.trigger(thisMap,'extinfowindowupdate');});};ExtInfoWindow.prototype.getDimensions_=function(element){var display=this.getStyle_(element,'display');if(display!='none'&&display!=null){return{width:element.offsetWidth,height:element.offsetHeight};}
var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility='hidden';els.position='absolute';els.display='block';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};};ExtInfoWindow.prototype.getStyle_=function(element,style){var found=false;style=this.camelize_(style);if(element.id==this.infoWindowId_&&style=='width'&&element.style.display=='none'){element.style.visibility='hidden';element.style.display='';}
var value=element.style[style];if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}else if(element.currentStyle){value=element.currentStyle[style];}}
if((value=='auto')&&(style=='width'||style=='height')&&(this.getStyle_(element,'display')!='none')){if(style=='width'){value=element.offsetWidth;}else{value=element.offsetHeight;}}
if(element.id==this.infoWindowId_&&style=='width'&&element.style.display!='none'){element.style.display='none';element.style.visibility='visible';}
return(value=='auto')?null:value;};ExtInfoWindow.prototype.camelize_=function(element){var parts=element.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=element.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);}
return camelized;};GMap.prototype.ExtInfoWindowInstance_=null;GMap.prototype.ClickListener_=null;GMap.prototype.InfoWindowListener_=null;GMarker.prototype.openExtInfoWindow=function(map,cssId,html,opt_opts){if(map==null){throw'Error in GMarker.openExtInfoWindow: map cannot be null';return false;}
if(cssId==null||cssId==''){throw'Error in GMarker.openExtInfoWindow: must specify a cssId';return false;}
map.closeInfoWindow();if(map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}
if(map.getExtInfoWindow()==null){map.setExtInfoWindow_(new ExtInfoWindow(this,cssId,html,opt_opts));if(map.ClickListener_==null){map.ClickListener_=GEvent.addListener(map,'click',function(event){if(!event&&map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}});}
if(map.InfoWindowListener_==null){map.InfoWindowListener_=GEvent.addListener(map,'infowindowopen',function(event){if(map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}});}
map.addOverlay(map.getExtInfoWindow());}};GMarker.prototype.closeExtInfoWindow=function(map){if(map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}};GMap2.prototype.getExtInfoWindow=function(){return this.ExtInfoWindowInstance_;};GMap2.prototype.setExtInfoWindow_=function(extInfoWindow){this.ExtInfoWindowInstance_=extInfoWindow;};GMap2.prototype.closeExtInfoWindow=function(){if(this.getExtInfoWindow()!=null){this.ExtInfoWindowInstance_.remove();}};Ext.ns('Ext.ux');VisitorStates=function(){var data;return{get:function(){return this.data;},setData:function(data){this.data=data;},add:function(key,value,scope){if(key==undefined){key=null;}
if(value==undefined){value=null;}
if(scope==undefined){scope=null;}
Ext.Ajax.request({url:'/visitors/add.json',method:'POST',params:{key:key,value:value,scope:scope},success:function(response,opts){var obj=Ext.decode(response.responseText);}});},del:function(key,scope){if(key==undefined){key=null;}
if(scope==undefined){scope=null;}
Ext.Ajax.request({url:'/visitors/del.json',method:'POST',params:{key:key,scope:scope},success:function(response,opts){var obj=Ext.decode(response.responseText);}});}};}();Ext.ux.Listsite=Ext.extend(Ext.util.Observable,{els:[],constructor:function(elId,config){config=config||{};Ext.apply(this,config);Ext.ux.Listsite.superclass.constructor.call(this,config);this.initMarkup();this.initEvents();},initMarkup:function(){var dh=Ext.DomHelper;this.els.quickinfotoggle=Ext.select('.quick-info-toggle');},initEvents:function(){this.els.quickinfotoggle.on('click',function(ev,t){var el=Ext.get(Ext.DomQuery.selectNode('div.quick-info',Ext.get(t).up('.listitem').id));if(!el.isVisible()){el.slideIn('t',{useDisplay:true});}else{el.slideOut('t',{useDisplay:true});}},this);}});Ext.ux.Client=Ext.extend(Ext.util.Observable,{constructor:function(){if(Ext.get('img-subline')!=null){Ext.get('img-subline').setOpacity(0.7);}
Ext.select('ul.tooglebutton  a').each(function(el){el.on("click",function(ev){Ext.get(ev.target).parent('ul').select('li').each(function(el){el.removeClass("active")});Ext.get(ev.target).parent('li').addClass("active");});});var maxHi=0;Ext.select('div.indexitem div.re_article_lu').each(function(el){maxHi=el.getHeight()>maxHi?maxHi=el.getHeight():maxHi=maxHi;});Ext.select('div.indexitem div.re_article_lu').each(function(el){el.setStyle({height:(maxHi)+'px'})});if(Ext.get('ArticleSearch')){var el=Ext.get('ArticleSearch');if(el.dom.value==""){el.dom.value='Was suchen Sie?';}
el.on("focus",function(ev){if(el.dom.value=="Was suchen Sie?"){el.dom.value="";}});el.on("blur",function(ev){if(el.dom.value==""){el.dom.value="Was suchen Sie?";}});}}});
