/*	
	Copyright 2009 British Broadcasting Corporation

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

	   http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
/*@cc_on @*/
/*@if (@_jscript_version > 5.5)@*/
(window.gloader||glow).module({name:"glow.widgets",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events"]],builder:function(d){var c,b,a=d.env;d.ready(function(){c=document;b=c.body;var e=d.dom.create('<div class="glow161-cssTest" style="height:0;position:absolute;visibility:hidden;top:-20px;display:block"></div>').appendTo(b);if(e.css("visibility")!="hidden"){b.className+=" glow161-basic";}else{d._addReadyBlock("glow_widgetsCSS");(function(){if(e.css("z-index")!="1234"){setTimeout(arguments.callee,10);return;}d._removeReadyBlock("glow_widgetsCSS");if(e.css("background-image").indexOf("ctr.png")==-1){b.className+=" glow161-basic";}})();}a.ie&&(b.className+=" glow161-ie");(a.ie<7||!a.standardsMode)&&(b.className+=" glow161-ielt7");a.gecko&&(b.className+=" glow161-gecko");});d.widgets={_scrollPos:function(){var f=window,e=a.standardsMode?c.documentElement:b;return{x:e.scrollLeft||f.pageXOffset||0,y:e.scrollTop||f.pageYOffset||0};}};}});(window.gloader||glow).module({name:"glow.widgets.Mask",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.widgets"]],builder:function(h){var e=h.dom,f=e.get,k=h.events,g=h.widgets,c,a='<div class="glowNoMask" style="margin:0;padding:0;position:absolute;width:100%;top:0;left:0;overflow:auto;',b,i='<iframe class="glowNoMask" src="javascript:false" style="margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);display:none"></iframe>';function d(o){this.opts=h.lang.apply({color:"#000",opacity:0.7,zIndex:9900,disableScroll:false},o||{});var m=document.body,l=this.maskElement=e.create(a+"z-index:"+this.opts.zIndex+";background:"+this.opts.color+';visibility:hidden"></div>').appendTo(m),n=this;l.css("opacity",this.opts.opacity);if(h.env.ie<7){this._iframe=e.create(i).css("z-index",this.opts.zIndex-1).appendTo(m);}k.addListener(l,"click",function(){k.fire(n,"click");});if(this.opts.onClick){k.addListener(this,"click",o.onClick);}}d.prototype={add:function(){var v=f(document),o=f(document.body),p=f(window),q=this;if(this.opts.disableScroll&&!b){b=h.dom.create(a+'height:100%;overflow:hidden;">'+a+'"></div></div>');var t=g._scrollPos(),r=o[0].style,n=p.height(),u=p.width(),m=b.get("div"),l=o.children().filter(function(){return(" "+this.className+" ").indexOf("glowNoMask")==-1;});c={margin:[o.css("margin-top"),o.css("margin-right"),o.css("margin-bottom"),o.css("margin-left")],padding:[o.css("padding-top"),o.css("padding-right"),o.css("padding-bottom"),o.css("padding-left")],height:o.css("height")};r.margin=r.padding=0;r.height="100%";m[0].style.zIndex=this.opts.zIndex-1;b.appendTo(o);m.css("margin",c.margin.join(" ")).css("padding",c.padding.join(" ")).css("top",-t.y-parseFloat(c.margin[0])+"px").css("left",-t.x+"px").append(l);}function s(){q.maskElement.hide();var w=q.opts.disableScroll?b.height():Math.max(p.height(),v.height()),x=q.opts.disableScroll?b.width():Math.max(p.width(),v.width());q.maskElement.width(x).height(w);if(q._iframe){q._iframe.width(x).height(w);}q.maskElement.show();}this.maskElement.css("visibility","visible").css("display","block");if(this._iframe){this._iframe.css("display","block");}s();this._resizeListener=k.addListener(window,"resize",s);},remove:function(){this.maskElement.css("visibility","hidden").css("display","none");if(this._iframe){this._iframe.css("display","none");}k.removeListener(this._resizeListener);if(this.opts.disableScroll){var l=f(document.body),m=b.children();m.children().appendTo(l);window.scroll(-parseInt(m.css("left")),-parseInt(m.css("top")));b.remove();l.css("margin",c.margin.join(" ")).css("padding",c.padding.join(" ")).css("height",c.height);delete b;b=undefined;}}};h.widgets.Mask=d;}});(window.gloader||glow).module({name:"glow.widgets.Overlay",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.anim","glow.widgets","glow.widgets.Mask"]],builder:function(f){var p=f.dom,d=p.get,a=f.events,n=f.widgets,r=f.env,o=f.anim,m=f.tweens,e='<div class="glow161-overlay glowNoMask"><div class="overlay-focalPoint" tabindex="-1"></div></div>',v=0,u='<iframe class="glowNoMask" src="javascript:false" style="display:none;margin:0;padding:0;position:absolute;filter:alpha(opacity=0)"></iframe>',k=/.swf($|\?)/i,b=/<param\s+(?:[^>]*(?:name=["'?]\bwmode["'?][\s\/>]|\bvalue=["'?](?:opaque|transparent)["'?][\s\/>])[^>]*){2}/i,g=(!r.ie&&!(r.webkit<522))||(r.ie>6&&r.standardsMode);function h(y){if(y._hiddenElements[0]){return;}var x=new f.dom.NodeList(),w=y.opts.hideWhileShown,B=y.opts.hideFilter,z=0,A;if(y.opts.hideWindowedFlash){x.push(d("object, embed").filter(function(){return c.call(this,y);}));}if(w){x.push(d(w));}x=x.filter(function(){return !d(this).isWithin(y.content);});if(B){x=x.filter(B);}y._hiddenElements=x;for(var z=0,A=x.length;z<A;z++){x[z].__glowOverlayHideCount=(Number(x[z].__glowOverlayHideCount)||0)+1;if(x[z].__glowOverlayHideCount==1){x[z].__glowOverlayInitVis=x[z].style.visibility;x[z].style.visibility="hidden";}}}function c(w){var x=this,y;if((x.getAttribute("type")=="application/x-shockwave-flash"||k.test(x.getAttribute("data")||x.getAttribute("src")||"")||(x.getAttribute("classid")||"").toLowerCase()=="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000")){y=x.getAttribute("wmode");return(x.nodeName=="OBJECT"&&!b.test(x.innerHTML))||(x.nodeName!="OBJECT"&&y!="transparent"&&y!="opaque");}return false;}function l(x){var z=x._hiddenElements,y=0,w=z.length;for(;y<w;y++){if(--z[y].__glowOverlayHideCount==0){z[y].style.visibility=z[y].__glowOverlayInitVis;}}x._hiddenElements=[];}function q(B,E){var C=[],D=[],y=0,A=0,F=B.opts.anim,G=B.opts.mask,w=B.container,x,z=0;if(F=="fade"){w.css("opacity",(E?0:1));C[A++]=[o.css(w,0.3,{opacity:{from:(E?0:1),to:(E?1:0)}})];if(E){C[A-1][1]=function(){w.css("opacity","");};}C[A++]=[t(B,E)];}else{if(F=="roll"||F=="slide"){if(E){w.css("height","");z=w.height();w.css("height","0");}C[A++]=[function(){if(r.webkit<522&&E){w.css("display","none");setTimeout(function(){w.css("overflow","hidden").css("display","block");},0);}else{w.css("overflow","hidden");}},o.css(w,0.3,{height:{to:z}},{tween:E?m.easeOut():m.easeIn()}),function(){if(!E){w.css("visibility","hidden");}w.css("height","");w.css("overflow","");}];C[A++]=[t(B,E)];}}return new o.Timeline(C);}function t(y,x){if(!y.opts.modal){return 0;}var w=y.opts.mask,A=w.opts.opacity,z=w.maskElement;z.css("opacity",(x?0:A));return o.css(z,0.1,{opacity:{from:(x?0:A),to:(x?A:0)}});}function s(w){l(w);w.container.css("visibility","").css("display","");if(w.opts.modal){w.opts.mask.remove();}else{if(f.env.ie<7){w._iframe.css("display","none");}}a.removeListener(w._scrollEvt);a.removeListener(w._resizeEvt);}function i(D,C){C=C||{};if(C.mask){C.modal=true;}this.opts=C=f.lang.apply({modal:false,closeOnMaskClick:true,zIndex:9990,autoPosition:true,x:"50%",y:"50%",ariaRole:"",ariaProperties:{live:"polite"},hideWindowedFlash:true,focusOnShow:false,id:"glow161Overlay"+(++v),closeOnEsc:false},C);if(C.modal&&!C.mask){C.mask=new f.widgets.Mask(C.zIndex?{zIndex:C.zIndex-1}:{});}var w=this.content=d(D),B=this,z=this.container=p.create(e).css("z-index",C.zIndex).attr("aria-hidden","true"),y=document.body,x;this._focalPoint=z.get("div.overlay-focalPoint");this._hiddenElements=[];z[0].id=C.id;z[0].className+=" "+(C.className||"");this.autoPosition=C.autoPosition;this.isShown=false;this.returnTo=C.returnTo;this._blockActions=false;z.append(w).appendTo(y);if(C.closeOnMaskClick&&C.mask){a.addListener(C.mask,"click",function(){B.hide();});}if(f.env.ie<7&&!C.modal){this._iframe=p.create(u).css("z-index",C.zIndex-1).appendTo(y);}if(C.ariaRole){z.attr("role",C.ariaRole);}for(x in C.ariaProperties){z.attr("aria-"+x,C.ariaProperties[x]);}if(this.opts.closeOnEsc){z.attr("tabIndex","0");var A=(f.env.webkit)?"keyup":"keypress";f.events.addListener(z,A,function(E){if(E.key=="ESC"){B.hide();}});}}i.prototype={setPosition:function(J,H){var z=this.container;if(this.autoPosition){if(J!==undefined&&!(J.source)){this.opts.x=J;this.opts.y=H;}var E=d(window),J=this.opts.x,H=this.opts.y,K=parseFloat(this.opts.x),F=parseFloat(this.opts.y),w=this._blockScrollRepos,B=g&&(!w.x)&&(!w.y),G=((this.opts.mask&&this.opts.mask.opts.disableScroll)||B)?{x:0,y:0}:n._scrollPos(),A,C,I,L;B&&z.css("position","fixed");if(typeof J=="string"&&J.indexOf("%")!=-1){A=E.width();I=z[0].offsetWidth;if(I>A){if(!w.x){z.css("left",n._scrollPos().x+"px").css("position","absolute");w.x=true;}else{if(this.opts.modal&&d(document).width()<I){this.opts.mask.maskElement.css("width",I+"px");}}}else{w.x=false;z.css("left",Math.max(((A-I)*(K/100))+G.x,G.x)+"px");}}else{z.css("left",K+G.x+"px");}if(typeof H=="string"&&H.indexOf("%")!=-1){C=E.height();L=z[0].offsetHeight;if(L>C){if(!w.y){z.css("top",n._scrollPos().y+"px").css("position","absolute");w.y=true;}else{if(this.opts.modal&&d(document).height()<L){this.opts.mask.maskElement.css("height",L+"px");}}}else{w.y=false;z.css("top",Math.max(((C-L)*(F/100))+G.y,G.y)+"px");}}else{z.css("top",F+G.y+"px");}}if(f.env.ie<7&&!this.opts.modal){var D=z[0].style;this._iframe.css("top",D.top).css("left",D.left).css("width",z[0].offsetWidth+"px").css("height",z[0].offsetHeight+"px");}return this;},show:function(){var x=this,w,y=x.opts.anim;if(x._blockActions||x.isShown){return x;}if(a.fire(x,"show").defaultPrevented()){return x;}this._blockScrollRepos={x:false,y:false};h(x);x.container.css("display","block");if(x.opts.modal){x.opts.mask.add();}else{if(f.env.ie<7){x._iframe.css("display","block");}}x._scrollEvt=a.addListener(window,"scroll",x.setPosition,x);x._resizeEvt=a.addListener(window,"resize",x.setPosition,x);x.setPosition();if(typeof y=="string"){w=q(x,true);}else{if(typeof y=="function"){w=y(x,true);}else{if(y){w=y.show;}}}if(w){if(!w._overlayEvtAttached){a.addListener(w,"complete",function(){x._blockActions=false;x.isShown=true;x.container.attr("aria-hidden","false");a.fire(x,"afterShow");});w._overlayEvtAttached=true;}x._blockActions=true;w.start();x.container.css("visibility","visible");}else{x.container.css("visibility","visible");x.isShown=true;x.container.attr("aria-hidden","false");a.fire(x,"afterShow");}if(x.opts.focusOnShow){x._focalPoint[0].focus();}return x;},hide:function(){var z=this,w,A=z.opts.anim,y=z.returnTo?d(z.returnTo):new f.dom.NodeList(),x;if(this._blockActions||!z.isShown){return z;}if(a.fire(z,"hide").defaultPrevented()){return z;}if(typeof A=="string"){w=q(z,false);}else{if(typeof A=="function"){w=A(z,false);}else{if(A){w=A.hide;}}}if(w){if(!w._overlayEvtAttached){a.addListener(w,"complete",function(){s(z);z._blockActions=false;z.isShown=false;a.fire(z,"afterHide");});w._overlayEvtAttached=true;}z._blockActions=true;w.start();}else{s(z);z.isShown=false;a.fire(z,"afterHide");}z.container.attr("aria-hidden","true");if(y[0]){x=y[0].nodeName;if(y[0].tabindex==undefined||x!="input"||x!="select"||x!="textarea"||x!="a"){y.attr("tabindex","-1");}y[0].focus();}if(f.env.ie){z.content.get("object").each(function(B){if((this.getAttribute("type")=="application/x-shockwave-flash"||k.test(this.getAttribute("data")||this.getAttribute("src")||"")||(this.getAttribute("classid")||"").toLowerCase()=="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000")){this.parentNode.insertBefore(this,this.nextSibling);}});}return z;}};f.widgets.Overlay=i;}});(window.gloader||glow).module({name:"glow.widgets.Panel",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.widgets.Overlay","glow.i18n"]],builder:function(m){var f=m.dom,g=f.get,n=m.i18n,p=m.events,k=m.widgets,a=k.Overlay,c=m.lang,h=m.env,b,o={},e='<div class="panelAccess">{END_LABEL}. <a href="#">{CLOSE_LINK}</a></div>';n.addLocaleModule("GLOW_WIDGETS_PANEL","en",{END_LABEL:"End of panel",CLOSE_LINK:"Close Panel"});if(m.env.ie){m.ready(function(){var s=function(z){var y=0,w=z.length,x;for(;y<w;y++){if(z[y].href.indexOf("widgets/widgets")!=-1){return z[y];}else{if(z[y].imports.length&&(x=arguments.callee(z[y].imports))){return x;}}}return false;}(document.styleSheets),q=function(y,w,x){return".glow161-ie .glow161-overlay"+v[y].className+" ."+w+" {background:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+u+"/images/"+v[y].path+"/"+x+".png', sizingMethod='crop');}";},v={light:{className:" .panel-light",path:"lightpanel"},dark:{className:"",path:"darkpanel"}},u=s.href.substring(0,s.href.lastIndexOf("/")),r="<style type='text/css'>";for(var t in v){r=r+q(t,"tr","ctr")+q(t,"tl","ctl")+q(t,"bl","cbl")+q(t,"br","cbr")+q(t,"infoPanel-pointerT","at")+q(t,"infoPanel-pointerR","ar")+q(t,"infoPanel-pointerB","ab")+q(t,"infoPanel-pointerL","al");}r=r+"</style>";m.dom.get("head").append(m.dom.create(r));});}function d(v){var t=v?"<div></div>":"";for(var s=1,q=arguments.length,u=[];s<q;s++){u[s-1]='<div class="'+arguments[s]+'">'+t+"</div>";}return u.join("");}function i(){this.hide();return false;}b=function(){var s=[],q=0;s[q++]='<div class="glow161-panel">';s[q++]='<div class="defaultSkin">';s[q++]=d(false,"infoPanel-pointerT","infoPanel-pointerL","infoPanel-pointerR");s[q++]='<div class="pc">';s[q++]=d(false,"tr","tl");s[q++]=d(true,"tb");s[q++]='<div class="tc">';s[q++]=d(false,"bars");s[q++]='<div class="c">';s[q++]='<a class="panel-close" href="#" title="close">X</a>';s[q++]=d(false,"panel-hd","panel-bd","panel-ft");s[q++]="</div>";s[q++]="</div>";s[q++]=d(false,"br","bl");s[q++]=d(true,"bb");s[q++]="</div>";s[q++]=d(false,"infoPanel-pointerB");s[q++]="</div>";s[q++]="</div>";return s.join("");}();function l(z,q){z=g(z);q=q||{};if(typeof q.width=="number"){q.width+="px";}if(q.template){var r=true;}q=m.lang.apply({template:b,width:"400px",modal:true,theme:"dark",ariaRole:"dialog",focusOnShow:true},q);var B=f.create(q.template),x=z.get("> .hd"),u=z.get("> .ft"),w=document.body,y=this,A,v,t=m.i18n.getLocaleModule("GLOW_WIDGETS_PANEL"),s=f.create(e,{interpolate:t});if(!r){B.addClass("panel-"+q.theme);if(!o[q.theme]&&w.className.indexOf("glow161-basic")==-1){A=B.clone().addClass("glow161-panel-preload").appendTo(w);o[q.theme]=true;}}if(z.length>1){z.each(function(){var C=g(this);if(C.hasClass("hd")){x=C;}else{if(C.hasClass("ft")){u=C;}}});}this.header=B.get(".panel-hd");this.footer=B.get(".panel-ft");this.body=B.get(".panel-bd");if(z.isWithin(w)){B.insertBefore(z);}else{B.appendTo(w);}this.body.append(z);if(x.length){this.header.append(x);}else{if(!r){B.addClass("panel-noHeader");}}if(u.length){this.footer.append(u);}p.addListener(B.get(".panel-close"),"click",i,this);p.addListener(s.get("a"),"click",i,this);a.call(this,B,q);this.container.css("width",q.width).append(s);}c.extend(l,a);m.widgets.Panel=l;}});(window.gloader||glow).module({name:"glow.widgets.Sortable",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.dragdrop","glow.widgets"]],builder:function(h){var e=h.dom.get,i=h.events,b=i.fire,a=i.addListener;var c=function(m,l){this._opts=l=h.lang.apply({dropIndicatorClass:"glow-sortable-dropindicator",equaliseColumns:true,draggableOptions:{}},l||{});this.constrainDragTo=l.constrainDragTo;this.axis=l.axis;this.draggables=[];var m=this.containers=e(m),n=this.dropTargets=[];if(l.onSort){a(this,"sort",l.onSort);}m.each(function(o){n[o]=new h.dragdrop.DropTarget(this,{tolerance:"intersect",dropIndicator:"spacer",dropIndicatorClass:l.dropIndicatorClass});});this.addItems(m.children());};function d(){if(this._itemsInMotion){return false;}if(this._opts.equaliseColumns){f.call(this);}this._itemsInMotion=true;}function f(){var p=[],q=0,n,r=this.dropTargets;this.containers.each(function(l){var s=e(this);p[l]=s.position().top;n=p[l]+s[0].offsetHeight;if(h.env.khtml){n-=s.css("margin-top")+s.css("margin-bottom");}if(n>q){q=n;}});for(var o=0,m=this.dropTargets.length;o<m;o++){this.dropTargets[o].setLogicalBottom(q);}}function k(o){var l=o.attachedTo,m=l.element,n=l.activeTarget;this._previous=m.prev();this._parent=m.parent();if(n){n.moveToPosition(l);}}function g(n){var l=n.attachedTo,m=l.element;if(!m.prev().eq(this._previous||[])||!m.parent().eq(this._parent)){b(this,"sort");}this._itemsInMotion=false;delete this._previous;delete this._parent;}c.prototype={addItems:function(m){var n=this,l=this._opts.draggableOptions;e(m).each(function(){var o=new h.dragdrop.Draggable(this,h.lang.apply({placeholder:"none",axis:n.axis,container:n.constrainDragTo,dropTargets:n.dropTargets},l));a(o,"drag",d,n);a(o,"drop",k,n);a(o,"afterDrop",g,n);n.draggables.push(o);});}};h.widgets.Sortable=c;}});(window.gloader||glow).module({name:"glow.widgets.InfoPanel",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.widgets.Panel"]],builder:function(m){var c=m.dom,e=c.get,n=m.events,l=m.widgets,b=m.lang,h=m.env,g,k=/glow161\-infoPanel\-point[TRBL]/,f={T:{x:"50%",y:"100%"},R:{x:0,y:"50%"},B:{x:"50%",y:0},L:{x:"100%",y:"50%"}};m.ready(function(){g=e(window);});function d(o,q){var t=[o.x,o.y],r=["x","y"],s=["Width","Height"],p=0;for(;p<2;p++){if(t[p].slice){t[p]=parseFloat(o[r[p]]);if(o[r[p]].slice(-1)=="%"){t[p]=q[0]["offset"+s[p]]*(t[p]/100);}}}return{x:t[0],y:t[1]};}function i(t,s){var r=l._scrollPos(),o={x:g.width(),y:g.height()},q={T:o.y-t.top-s.y+r.y,R:t.left-r.x,B:t.top-r.y,L:o.x-t.left-s.x+r.x},p=["T","R","B","L"];p.sort(function(v,u){return q[u]-q[v];});return p[0];}function a(q,p){p=p||{};if(p.template){var o=true;}p=m.lang.apply({modal:false,theme:"light",autoPosition:!!p.context,pointerRegisters:{t:{x:"50%",y:0},r:{x:"100%",y:"50%"},b:{x:"50%",y:"100%"},l:{x:0,y:"50%"}},ariaRole:"description",focusOnShow:true},p);if(p.focusOnShow&&p.returnTo===undefined){p.returnTo=p.context;}p.context=p.context&&e(p.context);l.Panel.call(this,q,p);p.context&&p.context.attr("aria-describedby",this.container[0].id);if(!o){this.content.addClass("glow161-infoPanel");}this.content.addClass("glow161-infoPanel-point"+(p.pointerPosition||"t").slice(0,1).toUpperCase());}b.extend(a,l.Panel);b.apply(a.prototype,{setPosition:function(v,t){var w=(v!==undefined&&!(v.source)),I=!this.container[0].offsetHeight;if(!(this.autoPosition||w)){return this;}else{if(w){this.autoPosition=false;}}if(I){this.container.css("display","block");}var B=this.opts,q=this.content[0],C=(B.pointerPosition||"").slice(0,1),o=B.context,A=this.container,p,u=w?{left:v,top:t}:o.offset(),z=w?{x:0,y:0}:{x:o[0].offsetWidth,y:o[0].offsetHeight},D,E,s,H=A.offset(),G,F;if(!C){C=i(u,z);if(F!=C){F=C;q.className=q.className.replace(k,"glow161-infoPanel-point"+C);p=A.get(".infoPanel-pointer"+C);}}else{C=C.toUpperCase();}if(!p){p=A.get(".infoPanel-pointer"+C);}D=w?{x:0,y:0}:d(B.offsetInContext||f[C],o);s=d(B.pointerRegisters[C.toLowerCase()],p);G=p.offset();E={left:G.left-H.left+s.x,top:G.top-H.top+s.y};if(I){this.container.css("display","none");}A.css("left",u.left+D.x-E.left+"px").css("top",u.top+D.y-E.top+"px");if(h.ie<7&&!B.modal){var r=A[0].style;this._iframe.css("top",r.top).css("left",r.left).css("width",A[0].offsetWidth+"px").css("height",A[0].offsetHeight+"px");}return this;},setContext:function(p){var o=this.opts.context;if(o){o.removeAttr("describedby");if(e(this.returnTo)[0]==o[0]){this.returnTo=p;}}this.opts.context=e(p).attr("describedby",this.container[0].id);if(!this.returnTo){this.returnTo=this.opts.context;}this.autoPosition=true;if(this.container[0].style.display=="block"){this.setPosition();}return this;}});m.widgets.InfoPanel=a;}});(window.gloader||glow).module({name:"glow.widgets.Slider",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.dragdrop","glow.anim","glow.widgets"]],builder:function(o){var k=o.dom.get,c=o.events,E=o.env,B,z,u=["slideStart","slideStop","change"],y=null,A,e,p=navigator.platform.slice(0,3),m=[{containerClassNamePart:"slider",length:"width",lengthUpper:"Width",pos:"left",trackToChange:"_trackOnElm",axis:"x",keyIncrement:"RIGHT",keyDecrement:"LEFT",pagePos:"pageX"},{containerClassNamePart:"vSlider",length:"height",lengthUpper:"Height",pos:"top",trackToChange:"_trackOffElm",axis:"y",keyIncrement:"UP",keyDecrement:"DOWN",pagePos:"pageY"}],g='<div class="slider-theme"><div class="slider-state"><div class="slider-container"><div class="slider-btn-bk"></div><div class="slider-track"><div class="slider-trackOn"></div><div class="slider-trackOff"></div><div class="slider-handle"></div></div><div class="slider-labels"></div><div class="slider-btn-fwd"></div></div></div></div>';function q(){return false;}function d(){var H=0,G=arguments.length,I,F;while(!(I=arguments[H++])&&(H<G)){}for(;H<G;H++){F=arguments[H];if(!F){continue;}while(1){I=I%F;if(!I){I=F;break;}F=F%I;if(!F){break;}}}return I;}(function(){var F=[{containerClassNamePart:"ruler",length:"width",pos:"left"},{containerClassNamePart:"vRuler",length:"height",pos:"top"}];B=function(H,G){H=k(H);G=o.lang.apply({size:300,min:0,max:100},G);var M=F[!!G.vertical*1],V=o.dom.create('<div class="ruler-tickMajor"></div>'),N=o.dom.create('<div class="ruler-tickMinor"></div>'),I=o.dom.create('<div class="ruler-label"><span></span></div>'),K=Number(G.labels),J=d(G.tickMajor,G.tickMinor,K),U,R,S=G.reverse,W=G.max-G.min,P,T,Q,L,O=G.min;this.element=P=o.dom.create('<div role="presentation" class="glow161-'+M.containerClassNamePart+'"><div class="ruler-spacer"></div><div class="ruler-labels"></div></div>');T=P.get("div.ruler-labels");P[0].id=G.id||"";P[0].className+=" "+(G.className||"");for(;O<=G.max;O+=J){U=((O-G.min)/W)*100;U=S?100-U:U;if(G.tickMajor&&!((O-G.min)%G.tickMajor)){V.clone().css(M.pos,U+"%").appendTo(P);}else{if(G.tickMinor&&!((O-G.min)%G.tickMinor)){N.clone().css(M.pos,U+"%").appendTo(P);}}if(K&&!((O-G.min)%K)){Q=I.clone().css(M.pos,U+"%");Q[0]._labelVal=O;Q.get("span").html(G.labelMapper?G.labelMapper(O):O);T.append(Q);}}if(!K){for(L in G.labels){U=((Number(L)-G.min)/W)*100;U=S?100-U:U;if(U<=100){Q=I.clone().css(M.pos,U+"%");Q[0]._labelVal=Number(L);Q.get("span").html(G.labelMapper?G.labelMapper(G.labels[L]):G.labels[L]);T.append(Q);}}}H.append(P);};})();function v(F){return m[!!F._opts.vertical*1];}function l(F){var G=v(F);F[G.trackToChange][0].style[G.length]=parseInt(F._handleElm[0].style[G.pos])+(F._handleSize/2)+"px";}function D(){l(this);if(this._opts.changeOnDrag){var F=a(this);t(this,F);(this._boundInput[0]||{}).value=F;}}function f(F){var G=v(this);that=this;if(y=="prevented"){return false;}else{if(y!=F.key){if(!y&&C(this).defaultPrevented()){y="prevented";return false;}clearInterval(e);e=setTimeout(function(){e=setInterval(function(){x(that,F.key==G.keyIncrement?1:-1);},40);},500);x(that,F.key==G.keyIncrement?1:-1);y=F.key;}}return false;}function b(F){if(y==F.key){y=null;clearInterval(e);s(this);}}function n(H){if(!this._disabled&&!C(this).defaultPrevented()){var F=H.attachedTo.className.indexOf("-fwd")!=-1?1:-1,G=this;x(this,F);A=setTimeout(function(){A=setInterval(function(){x(G,F);},40);},500);}return false;}function w(F){if(A){clearTimeout(A);clearInterval(A);A=null;s(this);}return false;}function x(G,F){var H=(G._opts.step||(1/G._pixelsPerVal))*F;G._nudgeVal=i(G,G._nudgeVal+H);r(G,G._nudgeVal);if(G._opts.changeOnDrag){t(G,G._nudgeVal);(G._boundInput[0]||{}).value=G._val;}}function r(F,I){var H,G=v(F),I=I===undefined?F._val:I;H=F._opts.vertical?(F._opts.max-I)*F._pixelsPerVal:(I-F._opts.min)*F._pixelsPerVal;F._handleElm[0].style[G.pos]=H+"px";l(F);}function a(H){var I=v(H),G=parseInt(H._handleElm[0].style[I.pos]),F=H._opts.vertical?(H._trackSize-H._handleSize)-G:G;F=(F/H._pixelsPerVal)+H._opts.min;return i(H,F);}function i(I,J){var H=I._opts.step,G=I._opts.min,F=I._opts.max;J=Number(J)||0;if(J<G){return G;}if(J>F){return F-((F-G)%(H||1));}if(H==0){return J;}return Math.round((J-G)/H)*H+G;}function t(H,G){var F=H._val,G=(G===undefined)?a(H):G;H.element.attr("aria-valuenow",G);H._val=G;if(G!=F){c.fire(H,"change");}}function C(F){F._valBeforeSlide=F._nudgeVal=F._val;return c.fire(F,"slideStart");}function s(G){var F={initialVal:G._valBeforeSlide,currentVal:a(G)};if(c.fire(G,"slideStop",F).defaultPrevented()){t(G,G._valBeforeSlide);G.val(G._valBeforeSlide);return;}t(G,F.currentVal);if(G._opts.snapOnDrop){G.val(F.currentVal);}else{(G._boundInput[0]||{}).value=F.currentVal;}}function h(I,Q){var F=I._opts,J=v(I),K=I.element,R,O,G,M,P,H,L=d((F.step*F.snapOnDrag),F.tickMinor,F.tickMajor),N;if(F.vertical){R=K.height();I._trackOnElm.height(F.size-R);}else{K.width(F.size);}I._trackSize=I._trackElm[J.length]();N=I._handleElm[0].style[J.length];if(o.env.ie<8){I._handleElm[0].style[J.length]=I._handleElm[0].currentStyle[J.length];I._handleElm[0].style[J.length]=I._handleElm[0].style["pixel"+J.lengthUpper];}I._handleSize=I._handleElm[0]["offset"+J.lengthUpper];I._handleElm[0].style[J.length]=N;if(F.val!=undefined){G=F.val;}else{if(I._boundInput[0]&&I._boundInput[0].value!=""){G=I._boundInput[0].value;}else{G=F.min;}}if(L){O=((I._trackSize-I._handleSize)/(F.max-F.min))*L;O=((Math.floor(O)/L)*(F.max-F.min))+I._handleSize;if(F.vertical){I._trackOnElm.height(O);if(Q){Q.element.height(O-I._handleSize);}}else{K.width(F.size-(I._trackSize-O));}I._trackSize=I._trackElm[J.length]();}I._pixelsPerVal=((I._trackSize-I._handleSize)/(F.max-F.min));I.val(G);K.attr({"aria-valuenow":I._val,"aria-valuemin":F.min,"aria-valuemax":F.max});H={axis:J.axis,container:I._trackElm,onDrag:function(){if(I._disabled||C(I).defaultPrevented()){return false;}I._stateElm.addClass("slider-active");M=c.addListener(document,"mousemove",D,I);},onDrop:function(){I._stateElm.removeClass("slider-active");c.removeListener(M);s(I);}};if(F.snapOnDrag){H.step=I._pixelsPerVal*F.step;}P=new o.dragdrop.Draggable(I._handleElm,H);if(F.jumpOnClick){c.addListener(I._trackElm,"mousedown",function(T){if(I._disabled||T.source==I._handleElm[0]){return;}var U=v(I),S=T[U.pagePos];T[U.pagePos]=I._handleElm.offset()[U.pos]+(I._handleSize/2);if(P._startDragMouse.call(P,T)===false){T[U.pagePos]=S;P._dragMouse.call(P,T);l(I);return false;}});}}z=o.widgets.Slider=function(G,F){this._disabled=false;G=k(G);this._opts=F=o.lang.apply({min:0,max:100,step:1,theme:"light",jumpOnClick:1,buttons:1,size:300},F);var J,O,I=v(this),K,R,N,P=[],M=this,H,Q,L=d((F.step*F.snapOnDrag),F.tickMinor,F.tickMajor);J=u.length;while(J--){O="on"+u[J].charAt(0).toUpperCase()+u[J].slice(1);if(F[O]){c.addListener(this,u[J],F[O]);}}this._boundInput=F.bindTo?k(F.bindTo):new o.dom.NodeList();this.element=K=o.dom.create('<div class="glow161-'+I.containerClassNamePart+'" tabindex="0" role="slider" aria-disabled="false">'+g+"</div>");this._trackElm=K.get("div.slider-track");this._trackOnElm=K.get("div.slider-trackOn");this._trackOffElm=K.get("div.slider-trackOff");this._handleElm=this._trackElm.get("div.slider-handle");this._stateElm=K.get("div.slider-state");K.get("div.slider-theme").addClass("slider-"+F.theme);!F.buttons&&this._stateElm.addClass("slider-noButtons");K[0].id=F.id||"";K[0].className+=" "+(F.className||"");if(F.tickMajor||F.tickMinor||F.labels){F.reverse=F.vertical;Q=new B(K.get("div.slider-labels"),F);}this.element.appendTo(G);h(this,Q);if(this._boundInput[0]){c.addListener(this._boundInput,"change",function(){var S=i(M,this.value);t(M,S);M.val(S);});}c.addListener(this.element,"focus",function(){if(!M._disabled){M._stateElm.addClass("slider-active");P[0]=c.addKeyListener(I.keyIncrement,"down",f,M);P[1]=c.addKeyListener(I.keyDecrement,"down",f,M);P[2]=c.addKeyListener(I.keyIncrement,"up",b,M);P[3]=c.addKeyListener(I.keyDecrement,"up",b,M);P[4]=c.addKeyListener(I.keyIncrement,"press",q);P[5]=c.addKeyListener(I.keyDecrement,"press",q);}});c.addListener(this.element,"blur",function(){M._stateElm.removeClass("slider-active");var S=P.length;while(S--){c.removeListener(P[S]);}P=[];});H=this.element.get(".slider-btn-fwd, .slider-btn-bk");c.addListener(H,"mousedown",n,this);c.addListener(H,"mouseup",w,this);c.addListener(H,"mouseout",w,this);if(Q){c.addListener(Q.element,"mousedown",function(S){if(M._disabled){return;}var T=k(S.source),U;while(T[0]!=Q.element[0]){if(T.hasClass("ruler-label")){U=i(M,T[0]._labelVal);t(M,U);M.val(U);return false;}T=T.parent();}});}};z.prototype={disabled:function(F){if(F!==undefined){this._disabled=F=!!F;this.element.attr("aria-disabled",F);this._stateElm[F?"addClass":"removeClass"]("slider-disabled");(this._boundInput[0]||{}).disabled=F;return this;}else{return this._disabled;}},val:function(F){if(F!=undefined){this._val=i(this,F);this.element.attr("aria-valuenow",this._val);(this._boundInput[0]||{}).value=this._val;r(this);return this;}else{return this._val;}},valToLabel:function(K){if(K===undefined){K=this._val;}var L=this._opts.labels,I=Infinity,H=Infinity,F,J,G;if(L===undefined){return null;}if(typeof L=="number"){return Math.round(K/L)*L;}if(L[K]){return L[K];}for(G in L){J=Math.abs(Number(G)-K);if(J<H){H=J;I=Number(G)-K;F=L[G];}else{if(J==H){if(I<0){H=J;I=Number(G)-K;F=L[G];}}}}return F;},labelToVal:function(F){var G,H=this._opts.labels;if(H===undefined){return null;}if(typeof H=="number"){F=Number(F);if(!(Number(F)%H)&&!isNaN(F)){return F;}return null;}for(G in H){if(F==H[G]){return Number(G);}}return null;}};}});(window.gloader||glow).module({name:"glow.widgets.AutoSuggest",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.anim","glow.widgets","glow.net","glow.widgets.Overlay"]],builder:function(glow){var $=glow.dom.get,events=glow.events,anim=glow.anim;function bindTo(that,inputElement){that.inputElement=$(inputElement);if(!that.inputElement[0].tagName.toLowerCase()=="input"){throw'Argument "inputElement" must be set to an input HTMLElement.';}that.inputElement.attr("autocomplete","off");}function downloadData(that,url,callback){if(that._lastDownload==url){if(callback){callback.apply(that,arguments);}else{that.find();}}else{that._lastDownload=url;if(that._pendingRequest){that._pendingRequest.abort();}that._pendingRequest=glow.net.get(url,{onLoad:function(r){var dataObject=(that.opts.parseData)?that.opts.parseData.apply(that,[r]):eval(r.text());that._pendingRequest=null;that.setData(dataObject);var e=new events.Event();e.data=dataObject;e.text=r.text();events.fire(that,"dataLoad",e);if(callback){callback.apply(that,arguments);}else{that.find();}},onError:function(r){var e=new events.Event();e.response=r;events.fire(that,"dataError",e);},onAbort:function(r){var e=new events.Event();e.response=r;events.fire(that,"dataAbort",e);}});}}function isVisible(that){return($(that.overlay.container).css("display")=="block");}function place(that){var inputOffset=that.inputElement.offset();that.overlay.container.css("left",parseInt(inputOffset.left)+"px").css("top",parseInt(inputOffset.top+that.inputElement[0].offsetHeight-1)+"px").css("width",((that.opts.width)?that.opts.width:that.inputElement[0].offsetWidth+"px"));}function buildIndexer(that){if(that.opts.index){if(typeof that.opts.index=="function"){that._indexer=that.opts.index;}else{if(typeof that.opts.index=="string"){that._indexer=(function(index){return function(dataItem){return dataItem[index];};})(that.opts.index);}else{if(typeof that.opts.index.push!="undefined"){that._indexer=(function(index){var l=index.length-1;return function(dataItem){var result=[];for(var i=l;i>=0;i--){result[i]=dataItem[index[i]];}return result;};})(that.opts.index);}else{throw"opts.index must be of type function, string or array, not "+typeof that.opts.index+".";}}}}else{that._indexer=function(dataItem){return(dataItem.name)?dataItem.name:dataItem.toString();};}}function nextItem(that){var currItem=$(that.overlay.container).get(".active");if(currItem.length==0){var items=$(that.overlay.container).get("li");if(items.length){activateItem(that,items[0]);}}else{var nextItem=currItem.next();if(nextItem&&!nextItem.is("ul")){deactivateItem(that,currItem);activateItem(that,nextItem);}else{that.val(that._original);deactivateItem(that,currItem);}}}function prevItem(that){var currItem=$(that.overlay.container).get(".active");if(currItem.length==0){var allItems=$(that.overlay.container).get("li");var lastItem=allItems[allItems.length-1];activateItem(that,lastItem);}else{var prevItem=currItem.prev();if(prevItem&&!prevItem.is("ul")){deactivateItem(that,currItem);activateItem(that,prevItem);}else{that.val(that._original);deactivateItem(that,currItem);}}}function getParentListItem(that,node){var listItem=node;while(listItem.parentNode&&listItem.parentNode.parentNode){if($(listItem.parentNode.parentNode).hasClass("glow161-autoSuggest")){break;}listItem=listItem.parentNode;}return(listItem.nodeName.toLowerCase()=="li")?listItem:null;}function activateItem(that,listItem){deactivateItems(that,listItem);$(listItem).addClass("active");if(that._lastActive!=listItem){that._lastActive=listItem;events.fire(that,"itemActive");}}function activateItemOffset(that,offset){var li=that.overlay.container.get("li")[offset];if(li){$(li).addClass("active");}}function deactivateItem(that,listItem){$(listItem).removeClass("active");}function deactivateItems(that,listItem){var list=(listItem)?$(listItem).parent():that.overlay.container.get("ul");list.get("li").each(function(i){$(this).removeClass("active");});}function addEvents(that){events.addListener(that,"itemActive",function(e){if(!isVisible(that)){return false;}var selectedOffset=that.getSelectedOffset();if(selectedOffset==-1){return false;}if(that.opts.onItemActive){var e=new events.Event();e.activeItem=that._found[selectedOffset];that.opts.onItemActive.apply(that,[e]);}return true;});events.addListener(that.inputElement,"mousedown",function(e){clearTimeout(that.findTimeout);that._value=that.inputElement.val();valueChanged(that,true);that.hide();that.value+=that._selected;that._selected="";return true;});events.addListener(that,"itemSelect",function(e){if(!isVisible(that)){return false;}var selectedOffset=that.getSelectedOffset();if(selectedOffset==-1){return false;}var e=new events.Event();e.source=$(that.overlay.container).get(".active");e.selectedItem=that._found[selectedOffset];if(that.opts.onItemSelect){that.opts.onItemSelect.apply(that,[e]);}setCaretTo(that.inputElement[0],that.inputElement.val().length);valueChanged(that,true);that.hide();return true;});events.addListener(that.overlay.container.get("ul")[0],"mousedown",function(e){events.fire(that,"itemSelect",e);});events.addListener(window,"resize",function(e){place(that);});events.addListener(that.overlay.container,"mousedown",function(){return false;});events.addListener(that.overlay.container,"beforedeactivate",function(event){if($(event.nativeEvent.toElement).isWithin(that.overlay.container)){return false;}return true;});events.addListener(that.inputElement,"blur",function(e){clearTimeout(that.findTimeout);that._value=that.inputElement.val();valueChanged(that,true);that.hide();});events.addListener(that.overlay.container,"mouseover",function(e){var li=getParentListItem(that,e.source);li&&activateItem(that,li);});events.addListener(that.overlay.container,"mouseout",function(e){var li=getParentListItem(that,e.source);if(li&&li!=e.source){deactivateItem(that,li);}});var ignoreInUp=false;var repeating={ondown:0,onpress:0};function keyDownHandler(e){clearTimeout(that.findTimeout);ignoreInUp=false;repeating.ondown++;if(e.key=="DOWN"){if(isVisible(that)){ignoreInUp=true;nextItem(that);return false;}}else{if(e.key=="UP"){if(isVisible(that)){ignoreInUp=true;prevItem(that);return false;}}else{if(e.key=="LEFT"){if(isVisible(that)){that._value=that.inputElement.val();valueChanged(that,true);that.hide();}}else{if(e.key=="RIGHT"){if(isVisible(that)){that._value=that.inputElement.val();valueChanged(that,true);that.hide();}}else{if(e.key=="ESC"){that.inputElement.val(that._original);that._value=that._original;valueChanged(that,true);that.hide();return false;}else{if(e.key=="DEL"||e.key=="BACKSPACE"){that.hide();}else{if(e.key=="ENTER"){if(isVisible(that)){ignoreInUp=true;}else{return true;}var selectedOffset=that.getSelectedOffset();if(selectedOffset==-1){that.hide();return true;}var e=new events.Event();e.source=$(that.overlay.container).get(".active");e.selectedItem=that._found[selectedOffset];events.fire(that,"itemSelect",e);return false;}}}}}}}return true;}events.addListener(that.inputElement[0],"keydown",keyDownHandler);function keyPressHandler(e){repeating.onpress++;if(repeating.ondown==1&&repeating.onpress>1){if(e.key=="DOWN"){if(isVisible(that)){nextItem(that);}return false;}else{if(e.key=="UP"){if(isVisible(that)){prevItem(that);}return false;}}}return true;}events.addListener(that.inputElement[0],"keypress",keyPressHandler);function keyUpHandler(e){repeating={ondown:0,onpress:0};if(ignoreInUp){return false;}that._value=that.inputElement.val();valueChanged(that);return true;}events.addListener(that.inputElement[0],"keyup",keyUpHandler);}function valueChanged(that,withoutFinding){if(typeof that._oldValue=="undefined"){that._oldValue=that.inputElement.val();}var currentValue=that.getValue();var skipFind=false;if(currentValue.toLowerCase()==that._oldValue.toLowerCase()){var skipFind=true;}that._oldValue=currentValue;if(withoutFinding||skipFind){return;}that.findTimeout=setTimeout(function(){var e=new glow.events.Event();e.value=currentValue;glow.events.fire(that,"inputChange",e);activateItemOffset(that,0);if(!e.defaultPrevented()){if(typeof that.dataSource!="object"){that.loadData();}that.find();}},500);}glow.widgets.AutoSuggest=function(inputElement,dataSource,opts){this.opts=opts||{};bindTo(this,inputElement);this.overlay=new glow.widgets.Overlay(glow.dom.create('<div class="glow161-autoSuggest"><ul></ul></div>'),{autoPosition:false,anim:(this.opts.anim)?this.opts.anim:null});this.configure(this.opts);buildIndexer(this);this.dataSource=dataSource;this.data=[];if(typeof dataSource!="string"){this.loadData();}addEvents(this);if(this.opts.complete){if(this.inputElement.val()==""){this.setData(dataSource);}else{this.setData(dataSource,function(){});}var that=this;events.addListener(that,"itemActive",function(e){var selectedOffset=that.getSelectedOffset();if(selectedOffset==-1){return false;}var matchedOn=(that._found[selectedOffset][this.opts.index]||that._found[selectedOffset]["name"]||that._found[selectedOffset]);if(typeof matchedOn.push!="undefined"){matchedOn=that._matchedOn;}that.suggest(matchedOn);return true;});}};glow.widgets.AutoSuggest.prototype.configure=function(opts){this.opts=opts||{};if(this.opts.height){var listContainer=$(this.overlay.container.get(".glow161-autoSuggest").get("ul")[0]);listContainer.css("overflow-x","hidden");listContainer.css("overflow-y","auto");listContainer.height(this.opts.height);}if(this.opts.theme=="dark"){$(this.overlay.container.get("ul")[0]).removeClass("autosuggest-light");$(this.overlay.container.get("ul")[0]).addClass("autosuggest-dark");}else{$(this.overlay.container.get("ul")[0]).removeClass("autosuggest-dark");$(this.overlay.container.get("ul")[0]).addClass("autosuggest-light");}if(this.opts.onDataLoad){events.addListener(this,"dataLoad",this.opts.onDataLoad);}if(this.opts.onDataError){events.addListener(this,"dataError",this.opts.onDataError);}if(this.opts.onDataAbort){events.addListener(this,"dataAbort",this.opts.onDataAbort);}if(this.opts.onInputChange){events.addListener(this,"inputChange",this.opts.onInputChange);}this._isMatch=this.opts.isMatch||function(word,lookFor){return(word.indexOf(lookFor)==0);};this._formatItem=this.opts.formatItem||function(o){return(o.name)?o.name:o.toString();};this._matchItem=this.opts.formatItem||function(o){return o.name;};this._filter=this.opts.filter||function(results){return results;};};glow.widgets.AutoSuggest.prototype.setData=function(dataSource,callback){if(typeof dataSource=="function"){dataSource=dataSource.call(this);}if(typeof dataSource=="string"){this.dataURL=dataSource;this.data=[];dataSource=dataSource.replace(/\{input\}/g,escape(this.getValue()));downloadData(this,dataSource,callback);}else{this.data=dataSource;this.index={};this.results=[];for(var d=0;d<this.data.length;d++){var datum=this.data[d];this.results.push(datum);var keywords=this._indexer(datum);keywords=(typeof keywords=="string")?[keywords]:keywords;for(var i=0;i<keywords.length;i++){var keyword="="+(this.opts.caseSensitive?String(keywords[i]):String(keywords[i]).toLowerCase());if(!this.index[keyword]){this.index[keyword]=[];}this.index[keyword].push(this.results.length-1);}}return this;}};glow.widgets.AutoSuggest.prototype.loadData=function(callback){this.setData(this.dataSource,callback);return this;};function appendTag(currentValue,delim,value){var split;if(delim==""||currentValue.indexOf(delim)<0){split=new RegExp("^( *)(.*)$");}else{split=new RegExp("^(.*"+delim+" *)([^"+delim+"]*)$");}var lv=split.exec(currentValue)[1];var rv=(split.exec(value)||["","",value])[2];return lv+rv;}glow.widgets.AutoSuggest.prototype.val=function(value){if(typeof value=="undefined"){return this._value;}else{this._value=value;this.inputElement.val(value);return this;}};glow.widgets.AutoSuggest.prototype.setValue=function(value){var currentValue=this._value||this.inputElement.val();var delim=(this.opts.delim||"");value=appendTag(currentValue,delim,value);this._value=value;this.inputElement.val(value);};glow.widgets.AutoSuggest.prototype.getValue=function(){var value=this._value||this.inputElement.val();if(typeof this.opts.delim!="undefined"&&this.opts.delim!=""){value=(value.match(new RegExp("(^|"+this.opts.delim+" *)([^"+this.opts.delim+"]*)$"))||["","",""]);value=value[2];}return value;};glow.widgets.AutoSuggest.prototype.suggest=function(suggested){this._suggested=suggested;var currentValue=this.inputElement.val();var delim=(this.opts.delim||"");var value=appendTag(currentValue,delim,suggested);this.inputElement.val(value);selectRange(this.inputElement[0],{start:(this._value||"").length,end:this.inputElement.val().length});};function selectRange(el,range){el.focus();if(!window.opera&&el.createTextRange){var r=el.createTextRange();r.moveEnd("character",range.end);r.moveStart("character",range.start);r.select();}else{el.select();el.selectionStart=range.start;el.selectionEnd=range.end;}}function setCaretTo(el,pos){selectRange(el,{start:pos,end:pos});}function array_indexOf(value){var index=-1;for(var i=0,l=this.length;i<l;i++){if(this[i]===value){index=i;break;}}return index;}glow.widgets.AutoSuggest.prototype.find=function(lookFor){if(typeof lookFor=="undefined"){lookFor=this.getValue();}while(lookFor.charAt(0)==" "){lookFor=lookFor.substring(1);}if(!this.opts.caseSensitive){lookFor=lookFor.toLowerCase();}var found=[];found.indexOf||(found.indexOf=array_indexOf);if(lookFor){for(var k in this.index){var lookAt=k.substring(1);if(this._isMatch(lookAt,lookFor)){var keys=this.index[k];for(var j=0;j<keys.length;j++){var offset=keys[j];if(found.indexOf(this.results[offset])==-1){found.push(this.results[offset]);}}}}}found=this._filter(found);this._found=found;if(found.length){if(this.opts.maxListLength){found.length=Math.min(found.length,this.opts.maxListLength);}var list=[];for(var i=0;i<found.length;i++){list.push('<li class="'+((i%2)?"odd":"even")+'">'+this._formatItem(found[i])+"</li>");}$(this.overlay.container.get("ul")[0]).html(list.join(""));this.show();}else{this.hide();}if(this.opts.activeOnShow!==false){nextItem(this);}};glow.widgets.AutoSuggest.prototype.hide=function(){this.overlay.hide();};glow.widgets.AutoSuggest.prototype.show=function(){this._original=this.val();place(this);this.overlay.show();};glow.widgets.AutoSuggest.prototype.getSelectedOffset=function(){if(!isVisible(this)){return -1;}var items=this.overlay.container.get("li");for(var i=0;i<items.length;i++){if($(items[i]).hasClass("active")){return i;}}return -1;};}});(window.gloader||glow).module({name:"glow.widgets.AutoComplete",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.widgets.AutoSuggest"]],builder:function(d){var c=d.dom.get,a=d.events,b=d.anim;d.widgets.AutoComplete=function(g,h,f){f=f||{};this.autosuggest=new d.widgets.AutoSuggest(g,[],f);this.autosuggest._indexer=function(i){return i.toString();};this.autosuggest._formatItem=function(i){return i.toString();};this.autosuggest.setData(h);var e=this.autosuggest;a.addListener(e,"itemActive",function(i){var k=e.getSelectedOffset();if(k==-1){return false;}e.suggest(e._found[k]);return true;});};}});(window.gloader||glow).module({name:"glow.widgets.Carousel",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.anim","glow.widgets","glow.i18n"]],builder:function(h){var f=h.dom.get,b=h.events,q=h.dom,m=h.i18n;m.addLocaleModule("GLOW_WIDGETS_CAROUSEL","en",{PREVIOUS:"previous",NEXT:"next"});function p(x,y){var z=m.getLocaleModule("GLOW_WIDGETS_CAROUSEL");y=y||{};this._content=f(x);this._startContentHeight=this._content[0].offsetHeight;this._content.addClass("carousel-content").css("zoom","1");this.items=this._content.children();y=this._opts=h.lang.apply({animDuration:0.4,animTween:h.tweens.easeBoth(),loop:false,step:1,vertical:false,scrollOnHold:true,slideOnScroll:false,theme:"light",pageNav:false},y);y.animDuration=Number(y.animDuration);y.size=Number(y.size);this.element=q.create("<div"+(this._opts.id?' id="'+this._opts.id+'"':"")+' class="'+(this._opts.vertical?"glow161-vCarousel":"glow161-carousel")+(this._opts.className?" "+this._opts.className:"")+'"></div>');var A=q.create('<div class="carousel-'+this._opts.theme+'"></div>');this._viewWindow=q.create('<div class="carousel-window"></div>');this._content.before(this.element);A.prependTo(this.element);this._viewWindow.prependTo(A);this._content.prependTo(this._viewWindow);if(this._opts.vertical){this.element.addClass("glow161-vCarousel");}else{this.element.addClass("glow161-carousel");}if(!this._opts.pageNav){this._navPrev=q.create('<a class="carousel-nav carousel-prev" href="#"><span class="carousel-label">{PREVIOUS}</span><span class="carousel-background"></span><span class="carousel-top"></span><span class="carousel-bottom"></span><span class="carousel-arrow"></span></a>',{interpolate:z}).insertBefore(this._viewWindow);this._navNext=q.create('<a class="carousel-nav carousel-next" href="#"><span class="carousel-label">{NEXT}</span><span class="carousel-background"></span><span class="carousel-top"></span><span class="carousel-bottom"></span><span class="carousel-arrow"></span></a>',{interpolate:z}).insertAfter(this._viewWindow);}o.apply(this,[x,y]);}function o(x,B){var A=this;if(this.items.length==0){return;}var C=this.items[0].style.position;this.items[0].style.position="absolute";this._itemWidth=this.items[0].offsetWidth+parseInt(f(this.items[0]).css(["margin-left","margin-right"]));this._itemHeight=this.items[0].offsetHeight+parseInt(f(this.items[0]).css(["margin-top","margin-bottom"]));this.items[0].style.position=C;this._itemHangingOffEnd=false;if(!B.size){var y;if(B.vertical){this._sizeView=this._startContentHeight;if(!this._opts.pageNav){this._sizeView-=this._navPrev[0].offsetHeight+this._navNext[0].offsetHeight;}this._viewWindow.css("width",this._itemWidth+"px");this._viewWindow.css("height",this._sizeView+"px");y=this._sizeView/this._itemHeight;this._opts.size=Math.floor(y);this._itemHangingOffEnd=(y!=this._opts.size);this.element.css("height",this._sizeView+(this._opts.pageNav?0:this._navPrev[0].offsetHeight+this._navNext[0].offsetHeight)+"px");}else{this._sizeView=this.element[0].offsetWidth;if(!this._opts.pageNav){this._sizeView-=this._navPrev[0].offsetWidth+this._navNext[0].offsetWidth;}this._viewWindow.css("width",this._sizeView+"px");this._viewWindow.css("height",this._itemHeight+"px");y=this._sizeView/this._itemWidth;this._opts.size=Math.floor(y);this._itemHangingOffEnd=(y!=this._opts.size);this.element.css("width",this._sizeView+(this._opts.pageNav?0:this._navPrev[0].offsetWidth+this._navNext[0].offsetWidth)+"px");}}else{if(this._opts.vertical){this._viewWindow.css("width",this._itemWidth+"px");this._viewWindow.css("height",this._opts.size*this._itemHeight+"px");}else{this._viewWindow.css("width",this._opts.size*this._itemWidth+"px");this._viewWindow.css("height",this._itemHeight+"px");}}if(this._opts.step=="page"){this._opts.step=this._opts.size;}if(this._opts.size<this._opts.step){throw new Error("Carousel opts.step ("+this._opts.step+") cannot be larger than carousel size ("+this._opts.size+").");}var E=["addItem","removeItem","scroll","afterScroll","itemClick"],z=E.length,D;while(z--){D="on"+E[z].charAt(0).toUpperCase()+E[z].slice(1);if(B[D]){b.addListener(A,E[z],B[D]);}}this._customButtonDimentions=(this._navPrev&&this._navNext)&&(this._navPrev[0].style.width||this._navPrev[0].style.height||this._navNext[0].style.width||this._navNext[0].style.height);this._originalOptsLoop=this._opts.loop;c.apply(this);n.call(this);k.call(this);d.call(this);this._ready=true;}function d(){var x=this;h.events.addListener(x._content,"click",function(A){var y=f(A.source),z;for(;y[0]!=x.element[0];y=y.parent()){if(y.hasClass("carousel-item")){if(!y.hasClass("carousel-pad")){z=h.events.fire(x,"itemClick",{item:y[0],itemIndex:y[0]["_index"+h.UID]%x._countReal});return !z.defaultPrevented();}break;}}});}function n(){var y=this,x=f(this._navPrev).push(this._navNext);b.addListener(x,"click",function(z){return false;});b.addListener(x,"mouseup",function(z){l.call(y);return false;});b.addListener(x,"mouseleave",function(z){l.call(y);});b.addListener(this._navPrev,"mousedown",function(z){y.prev();w.call(y,true);return false;});b.addListener(this._navNext,"mousedown",function(z){y.next();w.call(y);return false;});}function k(){var x,y=this;b.addListener(this.element,"keydown",function(z){if(x){return false;}switch(z.key){case"UP":case"LEFT":x=z.key;if(!y._isPlaying()){y.prev();w.call(y,true);}return false;case"DOWN":case"RIGHT":x=z.key;if(!y._isPlaying()){y.next();w.call(y);}return false;case"ENTER":x=z.key;if(z.source==y._navNext[0]||(y._pageNav&&z.source.parentNode==y._pageNav.rightarrow[0])){y.next();w.call(y);return false;}else{if(z.source==y._navPrev[0]||(y._pageNav&&z.source.parentNode==y._pageNav.leftarrow[0])){y.prev();w.call(y,true);return false;}}}});b.addListener(this.element,"keyup",function(z){switch(z.key){case"UP":case"LEFT":case"DOWN":case"RIGHT":case"ENTER":x=null;l.call(y);}});b.addListener(this.element,"keypress",function(z){switch(z.key){case"UP":case"LEFT":case"DOWN":case"RIGHT":return false;case"ENTER":if(z.source==y._navNext[0]||(y._pageNav&&z.source.parentNode==y._pageNav.rightarrow[0])||z.source==y._navPrev[0]||(y._pageNav&&z.source.parentNode==y._pageNav.leftarrow[0])){return false;}}});h.events.addListener(this.element,"focus",function(z){t.call(y,f(z.source));});}function t(z){var x=this;if((z[0]!=this._navNext[0])&&(z[0]!=this._navPrev[0])&&(z.parent().parent().hasClass("pageNav")==false)){var y=u.call(this,z);if(y===-1||this.items.slice(y,y+1).hasClass("carousel-added")){return;}if((" "+this.visibleIndexes().join(" ")+" ").indexOf(" "+y+" ")==-1){this.moveTo(y);setTimeout(function(){x._content[0].parentNode.scrollLeft=0;},0);}}}function u(A){while(!A.hasClass("carousel-item")){if(A.length==0){return -1;}A=A.parent();}var z=A.parent().children();var y=-1;z.each(function(x){if(z[x]==A[0]){y=x;}});return y;}function c(){var J=this;this.items=this._content.children();var K;this._notEnoughContent=this.items.length<=this._opts.size;if(this._notEnoughContent){this._opts.loop=false;this.element.get(".carousel-window").addClass("carousel-notEnoughItems");}else{this._opts.loop=this._originalOptsLoop;this.element.get(".carousel-window").removeClass("carousel-notEnoughItems");if(this._navPrev){this._navPrev.removeClass("carousel-prev-disabled");this._navNext.removeClass("carousel-next-disabled");}}if(this._opts.loop){K=this._opts.step-((this.items.length%this._opts.step)||this._opts.step);}else{var z=Math.ceil((this.items.length-this._opts.size)/this._opts.step);K=(this._opts.size+(z*this._opts.step))-this.items.length;K+=Number(this._itemHangingOffEnd);}var D=f(this.items[0]).clone().attr("role","presentation");D.attr("tabIndex","-1");D.get("a, img, input").attr("tabIndex","-1");D.removeAttr("id");D.addClass("carousel-added");D.addClass("carousel-pad");D.children().css("visibility","hidden");for(var G=0;G<K;G++){this._content.append(D.clone());}this.items=this._content.children();var C=this.items.length;if(this._opts.loop){var I=this._opts.size+Number(this._itemHangingOffEnd);var L=this.items.slice(0,I).clone(true).attr("role","presentation");L.attr("tabIndex","-1");L.get("a, img, input").attr("tabIndex","-1");L.addClass("carousel-added");this._content.append(L);this.items=this._content.children();}this.items.addClass("carousel-item");this.items.each(function(O){this["_index"+h.UID]=O;});this._direction=(this._opts.vertical)?"top":"left";this._countRealItems=C-K;this._countReal=C;this._countAll=this.items.length;this._countStep=this._opts.step;this._countView=this._opts.size;this._sizeEach=(this._opts.vertical?this._itemHeight:this._itemWidth);this._sizeStep=this._sizeEach*this._opts.step;this._sizeView=this._sizeEach*this._opts.size;this._sizeReal=this._sizeEach*this._countReal;this._sizeAll=this._sizeEach*this._countAll;this._animationTime=this._opts.animDuration;this._slideAnimationTime=this._animationTime/2;this._animationTween=this._opts.animTween;(this._opts.vertical)?this._content.css("height",this._sizeAll+"px"):this._content.css("width",this._sizeAll+"px");if(!this._opts.pageNav&&!this._customButtonDimentions){if(this._opts.vertical){this._navPrev.width(parseInt(this.items[0].offsetWidth)+parseInt(f(this.items[0]).css(["margin-left","margin-right"])));this._navNext.width(parseInt(this.items[0].offsetWidth)+parseInt(f(this.items[0]).css(["margin-left","margin-right"])));}else{this._navPrev.height(parseInt(this.items[0].offsetHeight)+parseInt(f(this.items[0]).css(["margin-top","margin-bottom"])));this._navNext.height(parseInt(this.items[0].offsetHeight)+parseInt(f(this.items[0]).css(["margin-top","margin-bottom"])));}}var x=[];var B=[];var M,N;function E(){r.apply(J);}if(this._opts.loop){this._movesMax=(this._countReal/this._countStep)-1;}else{this._movesMax=Math.ceil((this._countReal-this._countView-Number(this._itemHangingOffEnd))/this._countStep);}var H=this._movesMax+Number(this._opts.loop);for(var G=0;G<H;G++){M={};M["margin-"+this._direction]={from:(-G*this._sizeStep)+"px",to:(-(G+1)*this._sizeStep)+"px"};N=h.anim.css(this._content,this._slideAnimationTime,M,{tween:h.tweens.linear()});b.addListener(N,"complete",E);B.push(N);M={};M["margin-"+this._direction]={from:(-(G+1)*this._sizeStep)+"px",to:(-G*this._sizeStep)+"px"};N=h.anim.css(this._content,this._slideAnimationTime,M,{tween:h.tweens.linear()});b.addListener(N,"complete",E);x.unshift(N);}this._slidePrev=new h.anim.Timeline(x,{loop:this._opts.loop});this._slideNext=new h.anim.Timeline(B,{loop:this._opts.loop});if(this._opts.pageNav){this._pageNav=new i(this._movesMax+1,function(O){J.moveTo(O*J._countStep);});this._navPrev=this._pageNav.leftarrow;this._navNext=this._pageNav.rightarrow;var A=this.element.get(".carousel-window");A.parent().get(".pageNav").remove();this._pageNav.element.insertAfter(A);A.addClass("paged");if(this._opts.vertical){var F=Math.floor(((A[0].offsetHeight)-this._pageNav.element[0].offsetHeight)/2);this._pageNav.element.css("margin-top",F+"px");}else{var y=Math.floor(((A[0].offsetWidth)-this._pageNav.leftarrow[0].offsetWidth*(3+this._movesMax))/2);this._pageNav.element.css("margin-left",y+"px");}this._pageNav.update((this._visibleIndexFirst()%this._countReal)/this._countStep);}if(this._notEnoughContent){if(this._navPrev){this._navPrev.addClass("carousel-prev-disabled");this._navNext.addClass("carousel-next-disabled");}}else{if(!this._opts.loop){if(!e.apply(this,["prev"])){this._navPrev.addClass("carousel-prev-disabled");}else{if(!e.apply(this,[])){this._navNext.addClass("carousel-next-disabled");}}}}}function g(A){if(this._isPlaying()||!e.call(this,A)){return;}var z=parseInt(this._content.css("margin-"+this._direction))%this._sizeReal;if(A&&z==0){z-=this._sizeReal;}var B=z-((A?-1:+1)*this._sizeStep);var x={};x["margin-"+this._direction]={from:z,to:B};this._step=h.anim.css(this._content,this._animationTime,x,{tween:this._animationTween});this._step.start();var y=this;h.events.addListener(this._step,"complete",function(){r.apply(y);});}function w(y){if(this._slidePrev.isPlaying()||this._slideNext.isPlaying()){return;}var x=this;this._repeat=true;function z(){if(x._opts.slideOnScroll){if(e.apply(x,[y])){var B=v.apply(x);if(y){B=x._slidePrev.duration-B;}var A=y?x._slidePrev:x._slideNext;setTimeout(function(){if(x._isPlaying()||!x._repeat){return;}A.goTo(B).resume();},300);}}else{if(!x._repeat){return;}g.call(x,y);if(x._step){h.events.addListener(x._step,"complete",z);}}}if(this._opts.scrollOnHold){if(this._step&&this._step.isPlaying()){if(!this._step._hasSlidingListener){h.events.addListener(this._step,"complete",z);this._step._hasSlidingListener=true;}}else{z();}}}function l(){this._repeat=false;}function e(y){if(this._opts.loop){return true;}var x=this._visibleIndexFirst();if(y){return x!=0;}return(x+this._countView)<(this._countAll-Number(this._itemHangingOffEnd));}function s(){this._navPrev.removeClass("carousel-prev-disabled");this._navNext.removeClass("carousel-next-disabled");b.fire(this,"scroll",{currentPosition:this._visibleIndexFirst()%this._countReal});}function r(){if(!this._repeat||!this._opts.scrollOnHold){a.apply(this);}var x=this._visibleIndexFirst();b.fire(this,"afterScroll",{position:x%this._countReal});if(this._pageNav){this._pageNav.update((x%this._countReal)/this._countStep);}if(!this._opts.loop){if(!e.apply(this,["prev"])){this._navPrev.addClass("carousel-prev-disabled");}else{if(!e.apply(this,[])){this._navNext.addClass("carousel-next-disabled");}}}}function a(){this._slideNext.stop();this._slidePrev.stop();}p.prototype.prev=function(){if(!this._isPlaying()){if(!e.apply(this,["prev"])){return this;}s.apply(this,["prev"]);g.apply(this,["prev"]);}return this;};p.prototype.next=function(){if(!this._isPlaying()){if(!e.apply(this,[])){return this;}s.apply(this,[]);g.apply(this,[]);}return this;};function v(){var z=parseInt(this._content.css("margin-"+this._direction));var y=Math.abs(z)/this._sizeStep;var x=y*this._slideAnimationTime;return x;}p.prototype._isPlaying=function(){return((this._step&&this._step.isPlaying())||this._slidePrev.isPlaying()||this._slideNext.isPlaying());};p.prototype._visibleIndexFirst=function(){var x=parseInt(this._content.css("margin-"+this._direction))*-1;var y=Math.floor(x/this._sizeEach);return this.items[y]["_index"+h.UID];};p.prototype.visibleIndexes=function(){var A=this._visibleIndexFirst();var y=[];for(var z=0,x=this._opts.size;(z<x);z++){y.push((A+z)%this._countReal);}return y;};p.prototype.visibleItems=function(){var y=this.visibleIndexes();var x=new h.dom.NodeList();for(var z=0;z<y.length;z++){x.push(this.items[y[z]]);}return x;};p.prototype.addItems=function(z,x){z=f(z);var y={items:z};if(b.fire(this,"addItem",y).defaultPrevented()){return z;}this._content.get(".carousel-added").remove();if(typeof x!="undefined"&&x<this._countReal){z.insertBefore(this._content.children().item(x));}else{this._content.append(z);}c.apply(this);return z;};p.prototype.removeItem=function(y){var x=this.items.slice(y,y+1),z={item:x,itemIndex:y};if(b.fire(this,"removeItem",z).defaultPrevented()){return x;}this._content.get(".carousel-added").remove();x.remove();c.apply(this);return x;};p.prototype.moveBy=function(A,x){var y=this._visibleIndexFirst();var z=y+A;if(this._opts.loop){if(z<0){this._content.css("margin-"+this._direction,(this._countReal*-this._sizeEach)+"px");z=this._countReal+z;}if(y>=this._countReal&&z>this._countReal){this._content.css("margin-"+this._direction,"0px");z=z%this._countReal;}}return this.moveTo(z,x);};p.prototype.moveTo=function(B,y){var A=this;if(this._isPlaying()){return this;}if(!this._opts.loop){B=Math.min(B,this._countReal-1);}B=Math.max(B,0);B-=(B%this._countStep);if(!this._opts.loop){B=Math.min(B,this._movesMax*this._countStep);}var z=this._visibleIndexFirst();if(z==B){return this;}s.apply(this,[]);if(y!==false){var x={};x["margin-"+this._direction]={from:(z*-this._sizeEach)+"px",to:(B*-this._sizeEach)+"px"};this._step=h.anim.css(this._content,this._animationTime,x,{tween:this._animationTween});var A=this;h.events.addListener(this._step,"complete",function(){r.apply(A,[]);});this._step.start();}else{this._content.css("margin-"+this._direction,(B*-this._sizeEach)+"px");r.apply(this,[]);}return this;};h.widgets.Carousel=p;function i(A,C){var B=m.getLocaleModule("GLOW_WIDGETS_CAROUSEL");this.leftarrow=q.create("<li class='arrow' id='leftarrow'><a href='#' class='dotLabel'>{PREVIOUS}</a></li>",{interpolate:B});this.rightarrow=q.create("<li class='arrow' id='rightarrow'><a href='#' class='dotLabel'>{NEXT}</a></li>",{interpolate:B});var x="";for(var y=0;y<A;y++){x+="<li class='dot dot"+y+"'><div class='dotLabel'>"+(y+1)+"</div></li>";}this.element=q.create("<ul class='pageNav'>"+x+"</ul>");this.leftarrow.insertBefore(this.element.get("li")[0]);this.rightarrow.insertAfter(this.element.get("li")[this.element.get("li").length-1]);var z=this;h.events.addListener(this.element,"click",function(D){if(f(D.source).parent().hasClass("dot")){C.apply(z,[parseInt(f(D.source).html())-1]);}});this.currentPage=0;}i.prototype.update=function(x){if(typeof x=="undefined"){x=this.currentPage;}this.element.get("li.dot"+this.currentPage+"").removeClass("dotActive");this.element.get("li.dot"+x+"").addClass("dotActive");this.currentPage=x;};}});(window.gloader||glow).module({name:"glow.widgets.Editor",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.widgets","glow.i18n"]],builder:function(l){var h=l.dom.get,c=l.events,r=l.i18n;r.addLocaleModule("GLOW_WIDGETS_EDITOR","en",{ENTER_MESSAGE:"You are about to enter a Rich Text Editor",SKIP_LINK_TEXT:"Skip past",LEAVE_MESSAGE:"You have left the Rich Text Editor",BOLD_TITLE:"Bold",BOLD_LABEL:"B",ITALICS_TITLE:"Italics",ITALICS_LABEL:"I",STRIKE_TITLE:"Strikethrough",STRIKE_LABEL:"Strike"});l.widgets.Editor=function(z,A){z=h(z);var B=r.getLocaleModule("GLOW_WIDGETS_EDITOR");this._tools=g(B);A=this._opts=l.lang.apply({toolset:"basic",onCommit:null},A);this.element=l.dom.create('<div class="glow161-editor"><p class="glow161-hidden">{ENTER_MESSAGE}, <a href="#endOfEditor'+u()+'" tabindex="0">{SKIP_LINK_TEXT}</a></p><div class="editor-'+(A.theme||"light")+'"><div class="editor-state"></div></div><p id="endOfEditor'+u()+'" class="glow161-hidden endOfEditorCounter" tabindex="0">{LEAVE_MESSAGE}</p></div>',{interpolate:B});this.textarea=z;this.toolbar=new l.widgets.Editor.Toolbar(this);if(this._opts.toolset=="basic"){this.toolbar._addToolset("italics","bold","strike");}else{throw new Exception("Unknown toolset name.");}this.editArea=new l.widgets.Editor.EditArea(this);this.cleaner=new v();if(!x()){m.apply(this);f.apply(this,[]);}if(A.onCommit){c.addListener(this,"commit",A.onCommit);}};var u=function(){return l.dom.get("p.endOfEditorCounter").length+1;};var q=function(C,A,F,E){E=this._opts=l.lang.apply({onFire:function(){}},E);var D=this;this.attachTo=C;this.name=A;this.wait=F;this.callback=E.onFire;this.rate=E.rate;this.running=false;this.initiated=false;if(typeof this.name.pop=="undefined"){this.name=[this.name];}for(var B=0,z=this.name.length;B<z;B++){var A=this.name[B];l.events.addListener(this.attachTo,A,function(){clearInterval(D.intervalId);clearTimeout(D.timeoutId);D._tick();});}this._start();};q.prototype.disabled=function(z){if(typeof z=="undefined"){return !this.running;}else{if(z){this._stop();}else{this._start();}}};q.prototype._tick=function(){var z=this;this.timeoutId=setTimeout(function(){if(typeof z.rate!="undefined"){z.intervalId=setInterval(z.callback,z.rate);}else{z.callback();}},z.wait);};q.prototype._start=function(){if(this.running){return;}this._tick();this.running=true;};q.prototype._stop=function(){if(!this.running){return;}clearInterval(this.intervalId);clearTimeout(this.timeoutId);this.running=false;};function m(){var A=this.textarea.offset();var z=(this.textarea[0].offsetHeight>142)?this.textarea[0].offsetHeight:142;this.element.css("width",(this.textarea[0].offsetWidth-2)+"px");this.element.css("height",(z-2)+"px");}var f=function(){this.textarea.before(this.element);this.element.get("iframe").css("height",(parseInt(this.element.css("height"))-42));this.textarea.css("display","block");this.textarea.css("position","absolute");this.textarea.css("left","-9999px");this.textarea.css("top","-9999px");this.bound=true;};l.widgets.Editor.prototype.inject=function(z){this.editArea._setContent(this.cleaner.dirty(this.cleaner.clean(z)));};l.widgets.Editor.prototype.commit=function(){if(this.bound){h(this.textarea).val(this.cleaner.clean(this.editArea._getContent()));}l.events.fire(this,"commit",{});};function v(z){this.opts=z||{};this.whitelist=["em","strong","strike","p","br","blockquote"];}v.prototype.pretreat=function(z){z=z.replace(/<!--[\s\S]*?-->/g,"");z=z.replace(/<style\b[\s\S]*?<\/style>/gi,"");z=z.replace(/<script\b[\s\S]*?<\/script>/gi,"");return z;};v.prototype.clean=function(C){var B="",A=[];C=this.pretreat(C);while(C){var D=1;if(/^(<[^>]+>)/.test(C)){var z=new v.Tag(RegExp.$1);this.tagClean(z);if(z.clean&&z.opening){B+=z.clean.start;if(!z.unary){A.unshift(z);}D=z.text.length;}else{if(A[0]&&C.toLowerCase().indexOf(A[0].end)===0){B+=A[0].clean.end;D=A[0].end.length;A.shift();}else{B+=z;D=z.text.length;}}}else{B+=C.charAt(0);}C=C.substring(D);}B=this.spin(B);return B;};v.prototype.dirty=function(z){var A;if(l.env.gecko){A=z.replace(/<strong>/g,'<b _moz_dirty="">').replace(/<\/strong>/g,"</b>").replace(/<em>/g,'<i _moz_dirty="">').replace(/<\/em>/g,"</i>").replace(/<strike>/g,'<strike _moz_dirty="">');}else{if(l.env.ie||l.env.opera){A=z.replace(/<strong>/g,"<STRONG>").replace(/<\/strong>/g,"</STRONG>").replace(/<em>/g,"<EM>").replace(/<\/em>/g,"</EM>").replace(/<strike>/g,"<STRIKE>").replace(/<\/strike>/g,"</STRIKE>");}else{if(l.env.webkit>528){A=z.replace(/<strong>/g,"<b>").replace(/<\/strong>/g,"</b>").replace(/<em>/g,"<i>").replace(/<\/em>/g,"</i>").replace(/<strike>/g,'<span class="Apple-style-span" style="text-decoration: line-through;">').replace(/<\/strike>/g,"</span>");}else{if(l.env.webkit){A=z.replace(/<strong>/g,'<span class="Apple-style-span" style="font-weight: bold;">').replace(/<\/strong>/g,"</span>").replace(/<em>/g,'<span class="Apple-style-span" style="font-style: italic;">').replace(/<\/em>/g,"</span>").replace(/<strike>/g,'<span class="Apple-style-span" style="text-decoration: line-through;">').replace(/<\/strike>/g,"</span>");}else{throw new Error("Can't be dirty: Unknown browser.");}}}}return A;};v.prototype.spanClean=function(z){var A={start:"",end:""};if(/\bstyle\s*=\s*"(.+)"/.test(z.attrText.toLowerCase())){if(RegExp.$1.indexOf("bold")>-1){A.start+="<strong>";A.end="</strong>"+A.end;}if(RegExp.$1.indexOf("font-weight: normal")>-1){A.start+="</strong>";A.end="<strong>"+A.end;}if(RegExp.$1.indexOf("italic")>-1){A.start+="<em>";A.end="</em>"+A.end;}if(RegExp.$1.indexOf("font-style: normal")>-1){A.start+="</em>";A.end="<em>"+A.end;}if(RegExp.$1.indexOf("line-through")>-1){A.start+="<strike>";A.end="</strike>"+A.end;}}return A;};v.prototype.tagClean=function(z){var A=["",""];if(z.name=="span"){A=this.spanClean(z);}else{if(z.name=="b"){A={start:"<strong>",end:"</strong>"};}else{if(z.name=="i"){A={start:"<em>",end:"</em>"};}}}if(A.start){z.clean=A;}};v.Tag=function(z){/^<(\/?)([a-zA-Z]+)\b(.*)( ?\/)?>$/.exec(z);this.closing=!!RegExp.$1;this.opening=!this.closing;this.unary=!!RegExp.$4;this.name=RegExp.$2.toLowerCase();this.attrText=RegExp.$3;this.text=z;this.start=z.replace(/^<(\/?)([a-zA-Z]+)\b/,"<$1"+this.name);if(this.opening&&!this.unary){this.end="</"+this.name+">";}};v.Tag.prototype.toString=function(){return"<"+RegExp.$1+this.name+RegExp.$4+">";};v.prototype.spin=function(A){var z=this.whitelist.join("|");var B=new RegExp("<(\\/?("+z+")\\b[^>]*)>","g");A=A.replace(B,"\x1D$1\x1D");A=A.replace(/<[^>]+>/g,"");A=A.replace(/\x1D([^\x1D]+)\x1D/g,"<$1>");A=A.replace(/<>/g,"");return A;};l.widgets.Editor.Toolbar=function(z,A){A=A||{};this.editor=z;this.element=l.dom.create('<fieldset class="editor-toolbar"><ul class="editor-toolbar-tools"></ul></fieldset>');this._tools=[];this.editor.element.get(".editor-state").prepend(this.element);};l.widgets.Editor.Toolbar.prototype._addToolset=function(){var C;for(var B=0,A=arguments.length;B<A;B++){if((C=this.editor._tools[arguments[B]])){var z=new l.widgets.Editor.Toolbar.Button(C.name,C.opts);b.call(this,z);}}p.apply(this);return this;};l.widgets.Editor.blackList={FORM:true,TABLE:true,TBODY:true,CAPTION:true,TH:true,TR:true,TD:true,SCRIPT:true,STYLE:true,INPUT:true,BUTTON:true,OBJECT:true,EMBED:true,SELECT:true,H1:true,H2:true,H3:true,H4:true,H5:true,H6:true,DIV:true,ADDRESS:true,CENTER:true,PRE:true,CODE:true,A:true,UL:true,OL:true,LI:true,DL:true,DT:true,DD:true,ABBR:true,ACRONYM:true,DFN:true,INS:true,DEL:true,SAMP:true,VAR:true,BIG:true,SMALL:true,BLINK:true,MARQUEE:true,FONT:true,Q:true,U:true,KBD:true,SUB:true,SUP:true,CITE:true,HTML:true,BODY:true,FIELDSET:true,LEGEND:true,LABEL:true,TEXTAREA:true,HR:true,IMG:true,IFRAME:true,ILAYER:true,LAYER:true};l.widgets.Editor.prototype._rinse=function(){if(this._lastRinse==this.editArea._getContent()){return;}var B=this.editArea.contentWindow.document;var A=B.body;var z=this;function C(E){if(E.childNodes){for(var D=0;D<E.childNodes.length;D++){var G=l.widgets.Editor.blackList[E.childNodes[D].nodeName];if(E.nodeType==1){if(G){var F=B.createElement("SPAN");F.innerHTML=z.cleaner.clean(E.childNodes[D].innerHTML+" ");E.replaceChild(F,E.childNodes[D]);}else{if(E.childNodes[D].nodeName=="P"){E.childNodes[D].removeAttribute("style");}if(E.childNodes[D].nodeName=="SPAN"){if(/font-size/.test(E.childNodes[D].getAttribute("style"))){E.childNodes[D].removeAttribute("style");}}C(E.childNodes[D]);}}}}else{if(l.widgets.Editor.blackList[E.nodeName]){E.parentNode.removeChild(E);}}}C(A);this._lastRinse=this.editArea._getContent();};function b(z){z.editor=this.editor;this._tools.push(z);this.element.get(".editor-toolbar-tools").append(z.element);}l.widgets.Editor.Toolbar.prototype.addButton=function(A,B){var z=new l.widgets.Editor.Toolbar.Button(A,B,this);b.call(this,z);return this;};l.widgets.Editor.Toolbar.prototype.getTool=function(z){var A=this._tools.length;while(--A>=0){if(this._tools[A].name==z){return this._tools[A];}}};l.widgets.Editor.Toolbar.prototype._update=function(B){var C=false;for(var A=0,z=this._tools.length;A<z;A++){if(B.indexOf("|"+this._tools[A].tag+"|")>-1){this._tools[A].activate();C=true;}else{this._tools[A].deactivate();}}return C;};l.widgets.Editor.Toolbar.prototype._shortcut=function(A){var z=this._tools.length;var B=false;while(--z>=0){if(this._tools[z].shortcut==A){this._tools[z].press();return true;}}return false;};l.widgets.Editor.Toolbar.Tool=function(z,B,A){this.name=z;this.opts=B||{};this.action=this.opts.action||function(){};this.tag=this.opts.tag;this.command=this.opts.command;this.shortcut=this.opts.shortcut;this.isActive=false;this.isEnabled=true;if(this.opts.onDeactivate){l.events.addListener(this,"deactivate",this.opts.onDeactivate,A);}if(this.opts.onActivate){l.events.addListener(this,"activate",this.opts.onActivate,A);}if(this.opts.onDisable){l.events.addListener(this,"disable",this.opts.onDisable,A);}if(this.opts.onEnable){l.events.addListener(this,"enable",this.opts.onEnable,A);}};l.widgets.Editor.Toolbar.Tool.prototype.activate=function(){this.isActive=true;l.events.fire(this,"activate");};l.widgets.Editor.Toolbar.Tool.prototype.deactivate=function(){this.isActive=false;l.events.fire(this,"deactivate");};l.widgets.Editor.Toolbar.Tool.prototype.disable=function(){this.isEnabled=false;l.events.fire(this,"disable");};l.widgets.Editor.Toolbar.Tool.prototype.enable=function(){this.isEnabled=true;l.events.fire(this,"enable");};l.widgets.Editor.Toolbar.Tool.prototype.press=function(){if(this.isEnabled){this.action.call(this);if(!this.isActive){this.activate();}else{this.deactivate();}this.editor._lastDomPath=null;}};l.widgets.Editor.Toolbar.Button=function(A,D){this.Base=arguments.callee.base;this.base=this.Base.prototype;this.Base.apply(this,arguments);var z=A.toLowerCase()+"-button";this.element=l.dom.create('<li class="editor-toolbar-item"><span class="editor-toolbar-button"><a href="#" title="'+(D.title||A)+'" tabindex="-1"><span class="editor-toolbar-icon '+z+'"><span>'+(D.label||A)+"</span></span></a></span></li>");var E=this.element.get("a");this.icon=this.element.get(".editor-toolbar-icon");var B;l.events.addListener(this.icon,"mouseover",function(){if(this.isEnabled&&!this.isActive){E.addClass("hover");}},this);l.events.addListener(E,"focus",function(){if(this.isEnabled){E.addClass("hover");}B=o(this);},this);l.events.addListener(this.icon,"mouseout",function(){E.removeClass("hover");},this);l.events.addListener(E,"blur",function(){E.removeClass("hover");l.events.removeListener(B);},this);l.events.addListener(this,"disable",function(){E.addClass("disabled");},this);l.events.addListener(this,"enable",function(){E.removeClass("disabled");},this);l.events.addListener(this,"activate",function(){if(this.isEnabled){E.addClass("active");}},this);l.events.addListener(this,"deactivate",function(){E.removeClass("active");},this);var C=this;l.events.addListener(this.element.get("a"),"mousedown",function(){C.press();return false;},this);l.events.addListener(this.element.get("a"),"click",function(){return false;});};l.lang.extend(l.widgets.Editor.Toolbar.Button,l.widgets.Editor.Toolbar.Tool);l.widgets.Editor.Toolbar.Button.prototype.activate=function(){this.base.activate.apply(this,arguments);};l.widgets.Editor.Toolbar.Button.prototype.deactivate=function(){this.base.deactivate.apply(this,arguments);};l.widgets.Editor.Toolbar.Button.prototype.enable=function(z){this.base.enable.apply(this,arguments);};l.widgets.Editor.Toolbar.Button.prototype.disable=function(z){this.base.disable.apply(this,arguments);};function o(z){return l.events.addListener(l.dom.get(document),"keyup",function(A){if(A.key=="ENTER"){z.press();if(A.preventDefault){A.preventDefault();}return false;}});}function g(z){return{bold:{name:"bold",opts:{title:z.BOLD_TITLE,label:z.BOLD_LABEL,tag:"strong",command:"bold",shortcut:"b",action:function(){y.call(this.editor.editArea,this.command);return false;}}},italics:{name:"italics",opts:{title:z.ITALICS_TITLE,label:z.ITALICS_LABEL,tag:"em",command:"italic",shortcut:"i",action:function(){y.call(this.editor.editArea,this.command);return false;}}},strike:{name:"strike",opts:{title:z.STRIKE_TITLE,label:z.STRIKE_LABEL,tag:"strike",command:"strikethrough",action:function(){y.call(this.editor.editArea,this.command);return false;}}}};}l.widgets.Editor.EditArea=function(z,B){B=B||{};this.editor=z;this.element=h(document.createElement("iframe"));this.element.attr("frameBorder",0);this.element.src="javascript:false";this.editor.element.get(".editor-state").append(this.element);var A=this;setTimeout(function(){A.element[0].contentWindow.document.designMode="on";A.contentWindow=A.element[0].contentWindow;if(A.editor.textarea.val()){A.contentWindow.document.write(A.editor.textarea.val());}else{A.contentWindow.document.write("<p>&nbsp;</p>");}A.contentWindow.document.close();A.editor.iframeFocus=false;i.call(A);k(A);if(l.env.ie||l.env.opera){l.dom.get(A.element[0].contentWindow.document).item(0).attachEvent("onclick",function(){a.call(A);});l.dom.get(A.element[0].contentWindow.document).item(0).attachEvent("onkeyup",function(){a.call(A);});}else{c.addListener(A.contentWindow.document,"blur",function(){a.call(A);});c.addListener(A.contentWindow,"click",function(){a.call(A);});c.addListener(A.contentWindow,"keyup",function(){a.call(A);});}if(l.env.gecko){A.contentWindow.document.execCommand("styleWithCSS",false,false);}c.addListener(A.element[0].contentWindow,"beforeunload",function(){A.editor.commit();return true;});c.addListener(window,"beforeunload",function(){A.editor.commit();return true;});A._toolbarInTabIndex=false;l.events.addListener(A.editor.element.get(".editor-state"),"click",function(){p.apply(A);},A);if(!isNaN(l.env.ie)){A.contentWindow.attachEvent("onfocus",function(){p.apply(A);},A);}else{A.contentWindow.addEventListener("focus",function(){p.apply(A);},A);}if(A.editor.bound){A.idler=new q(A.contentWindow,["mousedown","keypress"],350,{onFire:function(){A.editor._rinse();},rate:700});}},0);};function p(){if(this.editor._toolbarInTabIndex==true){return;}this.editor.toolbar.element.get("a").item(0).tabIndex=0;this.editor._toolbarInTabIndex=true;}function i(){if(!isNaN(l.env.ie)){l.dom.get(this.contentWindow.document).item(0).attachEvent("onkeydown",(function(z){return function(A){A=A||window.event;return d.call(z,A);};})(this));}else{if(!isNaN(l.env.opera)){l.dom.get(this.contentWindow.document).item(0).addEventListener("keypress",(function(z){return function(A){A=A||window.event;return d.call(z,A);};})(this),true);}else{l.dom.get(this.contentWindow.document).item(0).addEventListener("keydown",(function(z){return function(A){A=A||window.event;return d.call(z,A);};})(this),true);}}}function d(z){if((navigator.platform.toLowerCase().indexOf("mac")==-1)||isNaN(l.env.webkit)){if((z.keyCode==9)&&(z.shiftKey==true)){var A=l.dom.get(this.editor.element).get("ul.editor-toolbar-tools a");A.each(function(B){if(A[B].tabIndex==0){window.focus();A[B].focus();}});if(z.preventDefault){z.preventDefault();}return false;}if((z.keyCode==9)){window.focus();this.element[0].focus();l.dom.get(this.editor.element).get("p.endOfEditorCounter").item(0).focus();if(z.preventDefault){z.preventDefault();}return false;}}if(n.call(this,z)){if((this.editor.toolbar._shortcut(String.fromCharCode(z.keyCode).toLowerCase()))||(String.fromCharCode(z.keyCode).toLowerCase()=="u")){if(z.preventDefault){z.preventDefault();}return false;}}return true;}function n(z){if(navigator.platform.toLowerCase().indexOf("mac")!=-1){if(!isNaN(l.env.opera)){return z.ctrlKey;}return z.metaKey;}else{return z.ctrlKey;}}function x(){if((l.env.webkit>400)&&(l.env.webkit<500)){return true;}else{return false;}}function k(A){var z,C,B=A.editor.toolbar.element.get("a");l.events.addListener(l.dom.get(B),"focus",function(){C=l.events.addKeyListener("RIGHT","down",s);z=l.events.addKeyListener("LEFT","down",t);});l.events.addListener(l.dom.get(B),"blur",function(){l.events.removeListener(C);l.events.removeListener(z);});}function t(z){w(e(l.dom.get(z.source),-1));}function s(z){w(e(l.dom.get(z.source),1));}function e(D,z){var A=0,B=l.dom.get(D).parent().parent().parent().get("a"),C=(B.length-1);B.each(function(E){if(this==D.item(0)){A=(E+z);}this.tabIndex=-1;});if(A<0){A=0;}if(A>C){A=C;}return B.item(A);}function w(z){if(typeof z!="undefined"){z.tabIndex=0;z.focus();}}function y(A,z){z=z||null;if(this[A+"_"+z]){this[A+"_"+z]();}else{this._domPath();this.contentWindow.document.execCommand(A,false,null);}this.contentWindow.focus();a.call(this);}l.widgets.Editor.EditArea.prototype._getSelected=function(){if(l.env.ie){return this.contentWindow.document.selection;}else{return this.contentWindow.getSelection();}};function a(){this.editor.commit();var A=this._domPath();if(A!=this.editor._lastDomPath){this.editor._lastDomPath=A;var z=l.events.fire(this,"domPathChange",{domPath:A});if(!z.defaultPrevented()){this.editor.toolbar._update(A);}}}l.widgets.Editor.EditArea.prototype._domPath=function(C){C=C||this._getSelectedNode();var A=l.dom.get(this.editor.editArea.contentWindow.document).get("body").item(0);var z="";while(C.nodeName.toUpperCase()!=A.nodeName.toUpperCase()){z="<"+C.nodeName.toLowerCase()+((C.getAttribute("style"))?' style="'+C.getAttribute("style")+'"':"")+">"+z;C=C.parentNode;}var B=this.editor.cleaner.clean(z);B=B.replace(/></g,"|").replace(/>/g,"|").replace(/</g,"|");B=B.replace(/\|\/[^\|]+\|/g,"|");return B;};l.widgets.Editor.EditArea.prototype._getSelectedNode=function(){if(!l.env.ie){selectedNode=this._getSelected().getRangeAt(0).commonAncestorContainer;if(selectedNode.nodeType===3){return selectedNode.parentNode;}else{return selectedNode;}}else{return this._getSelected().createRange().parentElement();}};l.widgets.Editor.EditArea.prototype._nodeAt=function(C){var B=this.contentWindow;var E=B.document;var A=0;var D=E.body;function F(J,H){if(J.nodeName=="#text"){A+=J.nodeValue.length;if(A>=H){return J.parentNode;}}if(J.childNodes){for(var I=0;I<J.childNodes.length;I++){var G=F(J.childNodes[I],H);if(G){return G;}}}}var z=F(D,C);return z;};l.widgets.Editor.EditArea.prototype._getContent=function(){return this.contentWindow.document.body.innerHTML;};l.widgets.Editor.EditArea.prototype._setContent=function(z){this.contentWindow.document.body.innerHTML=z;};l.widgets.Editor.EditArea.prototype._select=function(){var A=this.contentWindow;A.focus();if(l.env.ie){B=A.document.body.createTextRange();B.moveEnd("textedit");B.select();}else{var B=A.document.createRange();B.selectNodeContents(A.document.body.firstChild.childNodes[0]);var z=A.getSelection();z.removeAllRanges();A.getSelection().addRange(B);}};}});(window.gloader||glow).module({name:"glow.widgets.Timetable",library:["glow","1.6.1"],depends:[["glow","1.6.1","glow.dom","glow.events","glow.widgets","glow.widgets.Slider","glow.dragdrop","glow.i18n"]],builder:function(o){var e=o.dom,h=e.get,w=e.create,i=o.events,u=i.addListener,f=i.fire,g=o.lang,l=g.apply,y=o.i18n,t=0,m=[{length:"width",breadth:"height",rootClass:"glow161-Timetable",dragAxis:"x",pos:"left",posOpposite:"right",otherPos:"top",otherPosOpposite:"bottom"},{length:"height",breadth:"width",rootClass:"glow161-vTimetable",dragAxis:"y",pos:"top",posOpposite:"bottom",otherPos:"left",otherPosOpposite:"right"}];y.addLocaleModule("GLOW_WIDGETS_TIMETABLE","en",{ACCESSIBILITY_MENU_START:"Start",ACCESSIBILITY_MENU_END:"End",ACCESSIBILITY_INTRO:"Use this menu to choose what section of the timetable to view.",SKIPLINK_TO_TRACK:"skip to track data",SKIPLINK_BACK_TO_HEADERS:"back to track headers"});function r(){return o.UID+"TimetableWidget"+(t++);}function q(){return m[!!this._opts.vertical*1];}function v(E){return function(F){if(F instanceof Date){return new Date(F.getTime()+E);}else{return F+E;}};}function z(E){switch(E){case"am/pm":return v(43200000);case"hour":return v(3600000);case"day":return v(86400000);case"week":return v(604800000);case"month":return function(F){var G=new Date(F);G.setMonth(G.getMonth()+1);return G;};case"year":return function(F){var G=new Date(F);G.setFullYear(G.getFullYear()+1);return G;};default:if(E instanceof Function){return E;}else{if(isNaN(E)){throw new Error("Can't create incrementer");}else{return v(parseInt(E));}}}}function s(K,I,E,L){if(K instanceof Array){if(!this.numerical){return o.lang.map(K,function(O){return new Date(O);});}return K;}var G,H,N,F,J=1,M=z(K);if(I=="auto"){N={"am/pm":43200000,hour:3600000,day:86400000};switch(K){case"am/pm":case"hour":case"day":F=new Date(N[K]*Math.floor(E.valueOf()/N[K]));break;case"week":F=new Date(E);F.setHours(0,0,0,0);F.setDate(F.getDate()-F.getDay());break;case"month":F=new Date(E);F.setHours(0,0,0,0);F.setDate(1);break;case"year":F=new Date(E);F.setHours(0,0,0,0);F.setMonth(0,1);break;default:F=E;}}else{F=I||E;}H=[F];while(F<L){F=M(F);H[J++]=F;}return H;}function p(F){var E,G;if(F==undefined){return null;}if(F instanceof e.NodeList){E=F;}else{if(F instanceof Function){E=F(this);}else{E=g.interpolate(""+F,this);}}if(E instanceof e.NodeList){G=e.create("<div></div>").append(E);}else{G=e.create("<div>"+E+"</div>");}return G;}function c(F,G,J,L,M,E){this._opts=E=l({vertical:true,tracks:[],collapseItemBorders:true,collapseTrackBorders:false,keepItemContentInView:true,className:"",theme:"light"},E||{});var I=q.call(this);this._container=h(F);if(!this._container[0]){throw new Error("Could not find container for Timetable");}this.id=E.id||r();this.size=E.size||this._container[I.length]();this.numerical=((typeof G)=="number");this.start=G;this.end=J;this._viewStart=L;this._viewEnd=M;if(!this.numerical){this.start=new Date(G);this.end=new Date(J);this._viewStart=new Date(L);this._viewEnd=new Date(M);}this._viewWindowSize=this._viewEnd-this._viewStart;this.tracks=[];for(var K=0,H=E.tracks.length;K<H;K++){this.addTrack.apply(this,E.tracks[K]);}if(E.onChange){u(this,"change",E.onChange);}if(E.onItemClick){u(this,"itemClick",E.onItemClick);}if(E.onMoveStart){u(this,"moveStart",E.onMoveStart);}if(E.onMoveStop){u(this,"moveStop",E.onMoveStop);}this.element;this._view=new A(this);this._banding=[];this._primaryScales=[];this._secondaryScales=[];this._primaryScrollbar=null;this._secondaryScrollbar=null;}c.prototype={addTrack:function(G,E,F){return this.tracks[this.tracks.length]=new C(this,G,E,F);},currentPosition:function(E){if(E===undefined){var F=(this._view)?this._view.currentPosition():this._viewStart;if(!this.numerical){F=new Date(F);}return F;}else{if(!this.numerical){E=new Date(E);}this._view.currentPosition(E);return this;}},viewRange:function(F){var H=this._viewEnd-this._viewStart,G=this.currentPosition(),E={start:G,end:G.valueOf()+H};if(!this.numerical){E.end=new Date(E.end);}if(F){this._viewStart=F.start||E.start;this._viewEnd=F.end||E.end;if(!this.numerical){this._viewStart=new Date(this._viewStart);this._viewEnd=new Date(this._viewEnd);}if(this._viewStart<this.start){this._viewStart=this.start;}if(this._viewEnd>this.end){this._viewEnd=this.end;}if(this._view&&this._view._drawn){this.draw(true).currentPosition(this._viewStart);}return this;}else{return E;}},setItemTemplate:function(E){this._opts.itemTemplate=E;return this;},setTrackHeaderTemplate:function(E){this._opts.trackHeader=E;return this;},setTrackFooterTemplate:function(E){this._opts.trackFooter=E;return this;},setBanding:function(G,F){var E=F||{};this._banding=s.call(this,G,E.start||"auto",this.start,this.end);return this;},addScale:function(G,E,I,J){var H=J||{},F={template:H.template,size:I,points:s.call(this,G,H.start||"auto",this.start,this.end),opts:H};E=E.toLowerCase();if((E=="both")&&H.id){throw new Error("Cannot apply an id when adding to both sides of the timetable");}if((E=="top")||(E=="left")||(E=="both")){this._primaryScales[this._primaryScales.length]=F;}if((E=="bottom")||(E=="right")||(E=="both")){this._secondaryScales[this._secondaryScales.length]=F;}return this;},removeScales:function(E){if((E=="top")||(E=="left")||(E=="both")){this._primaryScales=[];}if((E=="bottom")||(E=="right")||(E=="both")){this._secondaryScales=[];}return this;},addScrollbar:function(I,E,H,J){var G=l({buttons:true},J||{}),F={template:G.template,size:H,points:s.call(this,I,G.start||"auto",this.start,this.end),opts:G};E=E.toLowerCase();if((E=="both")&&G.id){throw new Error("Cannot apply an id when adding to both sides of the timetable");}if((E=="top")||(E=="left")||(E=="both")){this._primaryScrollbar=F;}if((E=="bottom")||(E=="right")||(E=="both")){this._secondaryScrollbar=F;}return this;},draw:function(E){this._view.draw(E);return this;}};function C(J,I,G,H){this._opts=H=l({className:""},H||{});this.disabled=H.disabled||false;this.data=H.data||{};this.title=I;this.size=G;this.timetable=J;this.id=H.id||r();this.items=[];if(H.items!=undefined){for(var F=0,E=H.items.length;F<E;F++){B.apply(this,H.items[F]);}n.call(this);}}function B(G,H,E,F){return this.items[this.items.length]=new d(this,G,H,E,F);}function D(F,E){return((F.start-E.start)||(F._addIndex-E._addIndex));}function n(){this.items.sort(D);}function x(L,F,I){if(((typeof L)=="number")!==this.timetable.numerical){throw new Error("Cannot get Item(s) - point(s) not in the correct scale type.");}var G=this.items,K={items:[],indices:[]},H=0;if(!this.timetable.numerical){L=new Date(L);F=new Date(F);}for(var J=0,E=G.length;J<E;J++){if(G[J].start>F){break;}if(I.call(G[J],L,F)){K.items[H]=G[J];K.indices[H]=J;H++;}}return K;}function k(F,E){return((this.start>=F)&&(this.end<=E));}function b(F,E){return((this.start<E)&&(this.end>F));}function a(E){return((this.start<=E)&&(this.end>E));}C.prototype={toString:function(){return this.title;},addItem:function(H,I,E,F){var G=B.call(this,H,I,E,F);n.call(this);return G;},itemAt:function(E){return x.call(this,E,E,a).items[0];},indexAt:function(E){return x.call(this,E,E,a).indices[0];},itemsAt:function(E){return x.call(this,E,E,a).items;},indicesAt:function(E){return x.call(this,E,E,a).indices;},itemsInRange:function(F,E){return x.call(this,F,E,b).items;},indicesInRange:function(F,E){return x.call(this,F,E,b).indices;},setItemTemplate:function(E){this._opts.itemTemplate=E;return this;},setTrackHeaderTemplate:function(E){this._opts.trackHeader=E;return this;},setTrackFooterTemplate:function(E){this._opts.trackFooter=E;return this;},getHeader:function(){return p.call(this,this._opts.trackHeader||this.timetable._opts.trackHeader);},getFooter:function(){return p.call(this,this._opts.trackFooter||this.timetable._opts.trackFooter);}};function d(F,H,I,E,G){this._addIndex=F.items.length;this._opts=G=l({className:""},G||{});if(((typeof I)=="number")!==F.timetable.numerical){throw new Error("Item scale type does not match Timetable.");}this.data=G.data||{};this.title=H;this.start=I;this.end=E;if(!F.timetable.numerical){this.start=new Date(I);this.end=new Date(E);}this.track=F;this.id=G.id||r();this.element;}d.prototype={toString:function(){return this.title;},setItemTemplate:function(E){this._opts.itemTemplate=E;return this;},getContent:function(){return p.call(this,this._opts.itemTemplate||this.track._opts.itemTemplate||this.track.timetable._opts.itemTemplate);},inRange:function(F,E){if(!this.track.timetable.numerical){F=new Date(F);E=new Date(E);}return b.call(this,F,E);}};o.widgets.Timetable=c;o.widgets.Timetable.Track=C;o.widgets.Timetable.Item=d;var A;(function(){var R='<div><div class="timetable-theme"><div class="timetable-state"><div class="timetable-container"><div class="timetable-accessibility-navigation">{ACCESSIBILITY_INTRO}</div><div class="timetable-track-headers" role="presentation" id="'+o.UID+'TimetableWidgetHeaders"></div><div class="timetable-scrollView"><div class="timetable-scrollbar1"></div><div class="timetable-innerView"><div class="timetable-dragRange"><div class="timetable-dragArea" aria-live="polite"></div></div></div><div class="timetable-scrollbar2"></div></div><div class="timetable-track-footers" role="presentation" id="'+o.UID+'TimetableWidgetFooters"></div></div></div></div></div>',I='<div class="timetable-header-holder"></div>',an='<div class="timetable-footer-holder"></div>',am='<div class="timetable-track"><ol class="timetable-trackList"></ol></div>',W='<li class="timetable-item" tabindex="0"></li>',S='<div class="timetable-scale"></div>',ah='<div class="timetable-scaleItem"></div>',ab=e.create("<div></div>"),Q=10;function al(aq){if(!this._clickStart){this._clickStart=[aq.pageX,aq.pageY];}else{if(!this._cancelNextItemClick&&(Math.abs(this._clickStart[0]-aq.pageX)>Q||Math.abs(this._clickStart[1]-aq.pageY)>Q)){this._cancelNextItemClick=true;}}E.call(this,this.currentPosition());}function J(ar){if(this._cancelNextItemClick){return false;}var aq=h(ar.source);while(aq[0]!=ar.attachedTo){if(aq.hasClass("timetable-item")){f(this._timetable,"itemClick",l({item:this.itemInstance[aq[0].id]},new i.Event(ar)));}aq=aq.parent();}}function Z(){f(this._timetable,"moveStart");}function E(at){var ar=this._timetable,aq=q.call(ar);this._dragAreaElm.css(aq.pos,-(af.call(this,at)));if(this._scrollbar1){this._scrollbar1.moveToPosition(at);}if(this._scrollbar2){this._scrollbar2.moveToPosition(at);}}function ak(){f(this._timetable,"moveStop");}function G(){H.call(this);Y.call(this);}function H(){var ax=this._timetable,ar=q.call(ax),au=0,ay=ax.tracks.length,aC,at,aq,aA,az=ax.currentPosition(),aw,av,aB=parseInt(this._dragAreaElm[0].style[ar.pos]);if(this._timetable._opts.keepItemContentInView){this._itemContentHangingOffStart.css("margin-"+ar.pos,0);this._itemsHangingOffStart.removeClass("timetable-itemHangingClipping");}this._itemsHangingOffStart.removeClass("timetable-itemHangingOffStart");this._itemContentHangingOffStart=new e.NodeList();this._itemsHangingOffStart=new e.NodeList();for(;au<ay;au++){aC=ax.tracks[au].itemAt(az);if(!aC||aC.start.valueOf()==az.valueOf()){continue;}aA=aC.id;aq=this.itemContent[aA];at=this.items[aA];this._itemContentHangingOffStart.push(aq);this._itemsHangingOffStart.push(at);if(this._timetable._opts.keepItemContentInView){aw=parseInt(at[0].style[ar.pos]);av=-aB-aw;aq.css("margin-"+ar.pos,av);if(at[ar.length]()<(aq[ar.length]()+av)){at.addClass("timetable-itemHangingClipping");}}}this._itemsHangingOffStart.addClass("timetable-itemHangingOffStart");}function af(aq){return(aq-this._timetable.start)/this.scale;}function ai(aq){return(aq*this.scale)+this._timetable.start.valueOf();}function Y(){var ar=this._timetable,aq=ar.currentPosition();if(aq.valueOf()!=this._posBeforeMove.valueOf()){f(ar,"change");this._posBeforeMove=aq;aj.call(this);}}function U(ay,ar){var at=this._timetable,aq=q.call(at),az=af.call(this,ay.start),au=af.call(this,ay.end)-az,aw=e.create(W),av=ay.getContent()||N(ay);aw.attr("id",ay.id);av[0].className="timetable-itemContent "+ay._opts.className;var ax=this;ay.element=this.items[ay.id]=aw;this.itemContent[ay.id]=av;this.itemInstance[ay.id]=ay;au-=ar*((!at._opts.collapseItemBorders)+1);if(au<0){au=0;}aw.css(aq.pos,az).css(aq.length,au);aw.append(av);return aw;}function N(aq){return w("<div>"+aq.title+"</div>");}function F(ar){var ax=this._timetable,au=q.call(ax),az=ar.items,av=0,ay=az.length,aC=this.tracks[ar.id],aw=this._headers[ar.id],aB=this._footers[ar.id],at,aA,aq,aD;if(!aC){aC=this.tracks[ar.id]=O.call(this,ar);aC.css(au.breadth,ar.size);aC.appendTo(this._dragAreaElm);X.call(this,ar);if(aw){aC.prepend(aw.clone().removeClass("timetable-header-holder").addClass("timetable-accessibility-hidden"));}if(aB){aC.append(aB.clone().removeClass("timetable-footer-holder").addClass("timetable-accessibility-hidden"));}}at=aC.get("> ol");aq=e.create(W).appendTo(at);aA=parseInt(aq.css(["border-"+au.pos+"-width","border-"+au.posOpposite+"-width"]))/2;aq.remove();for(;av<ay;av++){aD=ar.items[av];if(!this.items[aD.id]){U.call(this,az[av],aA).appendTo(at);}}}function X(aq){var ar,at=aq.id;ar=aq.getHeader();if(ar){this._headers[at]=e.create(I).append(ar.addClass("timetable-header-content"));this._headerElm.append(this._headers[at]).append('<a class="timetable-accessibility-hidden" href="#'+at+'">'+this._locale.SKIPLINK_TO_TRACK+"</a>");}ar=aq.getFooter();if(ar){this._footers[at]=e.create(an).append(ar.addClass("timetable-footer-content"));this._footerElm.append(this._footers[at]).append('<a class="timetable-accessibility-hidden" href="#'+o.UID+'TimetableWidgetHeaders">'+this._locale.SKIPLINK_BACK_TO_HEADERS+"</a>");}}function O(aq){var ar=e.create(am).attr("id",aq.id);return ar;}function ae(){var av=this._timetable,aq=q.call(av),aH=0,au=av.tracks.length,aL=this._primaryScaleElms.length,aE=this._secondaryScaleElms.length,aC=au+aL+aE,ay,aK,aM,ar=0,aF=0,ax,at,aw=["border-"+aq.otherPos+"-width","border-"+aq.otherPosOpposite+"-width"],aI=0,aJ=av._opts.collapseTrackBorders,aD,az,aA,aB,aG;ax=this._scrollbar1Elm[aq.breadth]()-parseInt(this._headerElm.css("border-"+aq.otherPos+"-width"));for(;aH<aC;aH++){if(aH<aL){ay=this._primaryScaleElms[aH];aK=aM=null;}else{if(aH<aL+au){aG=av.tracks[aH-aL];aB=aG.id;ay=this.tracks[aB];aK=this._headers[aB];aM=this._footers[aB];if(aG.disabled){h(ay,aK,aM).css("display","none");continue;}else{h(ay,aK,aM).css("display","");}}else{ay=this._secondaryScaleElms[aH-aL-au];aK=aM=null;}}aD=parseInt(ay.css(aw))/2;az=aJ?0:parseInt(ay.css("margin-"+aq.otherPosOpposite))||0;aA=parseInt(ay.css(aq.breadth))+(aD*((!aJ)+1))+az;ay.css(aq.otherPos,aI);if(aK){aK.css(aq.otherPos,aI+ax).css(aq.breadth,aG.size+2*aD);ar=Math.max(parseInt(aK.css(aq.length)),ar);}if(aM){aM.css(aq.otherPos,aI+ax).css(aq.breadth,aG.size+2*aD);aF=Math.max(parseInt(aM.css(aq.length)),aF);}aI+=aA;}this._innerViewElm.css(aq.breadth,aI+(aD*aJ)-az);at=aI+(aD*aJ)-az+ax+this._scrollbar2Elm[aq.breadth]();h(this._headerElm,this._footerElm).css(aq.breadth,at-parseInt(this._headerElm.css("border-"+aq.otherPosOpposite+"-width")));this._headerElm.css(aq.length,ar);this._footerElm.css(aq.length,aF);}function M(){var av=this._timetable,aq=q.call(av),au=0,ax=av._banding.length-1,at,ar,aw,ay,az;for(;au<ax;au++){at=av._banding[au].valueOf();aw=av._banding[au+1].valueOf();ar=af.call(this,at);ay=af.call(this,aw)-ar;az=ab.clone().css(aq.pos,ar).css(aq.length,ay).addClass("timetable-band"+(au%2?"Odd":"Even")).appendTo(this._dragAreaElm);}}function aa(aB){var av=this._timetable,ar=q.call(av),aA=w(S).css(ar.breadth,aB.size),at=0,aC=aB.points,ax=aC.length-1,az,au,ay,aw,aq;aA[0].id=aB.opts.id||"";aA[0].className+=" "+(aB.opts.className||"");for(;at<ax;at++){az=aC[at].valueOf();ay=aC[at+1].valueOf();au=af.call(this,az);aw=af.call(this,ay)-au;aq={start:aC[at],end:aC[at+1]};w(ah).append(p.call(aq,aB.template).addClass("timetable-itemContent")).css(ar.pos,au).css(ar.length,aw).appendTo(aA);}return aA;}function ag(){var at=this._timetable,aq=at._primaryScales.length,ar;this._primaryScaleElms=[];this._secondaryScaleElms=[];while(aq--){this._primaryScaleElms[aq]=aa.call(this,at._primaryScales[aq]).addClass("timetable-scalePrimary").appendTo(this._dragAreaElm);}aq=at._secondaryScales.length;ar=aq-1;while(aq--){this._secondaryScaleElms[ar-aq]=aa.call(this,at._secondaryScales[aq]).addClass("timetable-scaleSecondary").appendTo(this._dragAreaElm);}}function K(aq,ar){w('<style type="text/css">'+aq+" { "+ar+" } </style>").appendTo("head");}function ad(){var at=this._timetable,ar=at._primaryScrollbar,aq=at._secondaryScrollbar;if(ar){this._scrollbar1Elm.css("display","block");this._scrollbar1=new ao(this,this._scrollbar1Elm,ar);}this._scrollbar1Elm.css("display",ar?"block":"");if(aq){this._scrollbar2Elm.css("display","block");this._scrollbar2=new ao(this,this._scrollbar2Elm,aq);}this._scrollbar2Elm.css("display",aq?"block":"");}function ap(){var au=this._timetable,ar=q.call(au),at,aq;at=af.call(this,au.end);aq=(at*2)-this._viewSize;this._dragAreaElm[ar.length](at);this._dragRangeElm[ar.length](aq).css("margin-"+ar.pos,-at+this._viewSize);}function V(){var ar=this._timetable,aq=q.call(ar);this._viewSize=this._innerViewElm[aq.length]();this.scale=(ar._viewEnd-ar._viewStart)/this._viewSize;}function T(){var at=this._timetable,ar=q.call(at),aq=this;this._draggable=new o.dragdrop.Draggable(this._dragAreaElm,{axis:ar.dragAxis,container:this._dragRangeElm,placeholder:"none",onDrag:function(){aq._cancelNextItemClick=false;aq._clickStart=0;aq._mouseMoveListener=u(document,"mousemove",al,aq);Z.call(aq);ac.call(aq);},onDrop:function(){ak.call(aq);G.call(aq);aq._mouseMoveListener&&o.events.removeListener(aq._mouseMoveListener);}});}function P(){var ax=this._timetable,az=ax.tracks,ay=az.length,aA=this._inCurrentView,ar=this._innerViewElm,au=null,aB=ax.viewRange(),aw=aB.start,aC=aB.end,aq="",av=0,at=0;if(aA==null){ar.addClass("timetable-hideitems");this._inCurrentView=aA={};}for(aq in aA){if(!aA[aq].inRange(aw,aC)){delete aA[aq];h(aq).css("display","");}}for(j=0;j<ay;j++){au=az[j].itemsInRange(aw,aC);for(av=0,at=au.length;av<at;av++){aq=au[av].id;if(!aA[aq]){aA[aq]=au[av];h("#"+aq).css("display","block");}}}}function ac(){for(id in this._inCurrentView){h("#"+id).css("display","");}this._inCurrentView=null;this._innerViewElm.removeClass("timetable-hideitems");}function L(){var au=this._timetable,aC=au._primaryScales[0]||au._secondaryScales[0]||au._primaryScrollbar||au._secondaryScrollbar;if(aC){var aB=aC.points,at=[],aw=aB.length-1,aq,ar=0,av=this,aA=au.end-au._viewWindowSize,ax='<option value="'+au.start.valueOf()+'">'+this._locale.ACCESSIBILITY_MENU_START+"</option>",az='<option value="'+aA.valueOf()+'">'+this._locale.ACCESSIBILITY_MENU_END+"</option>";for(;ar<aw;ar++){aq={start:aB[ar],end:aB[ar+1]};if((aq.start>=au.start)&&(aq.start<=aA)){at[ar]='<option value="'+aB[ar].valueOf()+'">'+p.call(aq,aC.template).text()+"</option>";if(aq.start.valueOf()==au.start.valueOf()){ax="";}if(aq.start.valueOf()==aA.valueOf()){az="";}}}var ay=this._accessibiltySelect=e.create("<select>"+ax+at.join("")+az+"</select>");u(ay,"change",function(){av._timetable.currentPosition(ay.val()*1);P.call(av);});this._accessibiltyElm.append(ay);aj.call(this);}}function aj(){if(this._accessibiltySelect){var av=this.currentPosition(),ar=this._accessibiltySelect[0].options,au=0,aq=ar.length,aw=ar[au].value*1,at;for(;au<aq;au++){at=ar[au].value*1;if(at<=(av+this.scale)){aw=at;}}this._accessibiltySelect.val(aw);}}A=function(at){var ar=q.call(at),aq=this;this._cancelNextItemClick=false;this._posBeforeMove=at.currentPosition();this._timetable=at;this._headers={};this._footers={};this._inCurrentView=null;this._locale=y.getLocaleModule("GLOW_WIDGETS_TIMETABLE");this.tracks={};this.items={};this.itemContent={};this.itemInstance={};this.element=e.create(R,{interpolate:this._locale}).attr("id",at.id);this.element[0].className=at._opts.className;this.element.addClass(ar.rootClass);this._headerElm=this.element.get("div.timetable-track-headers");this._footerElm=this.element.get("div.timetable-track-footers");this._accessibiltyElm=this.element.get("div.timetable-accessibility-navigation");this._stateElm=this.element.get("div.timetable-state");this._themeElm=this.element.get("div.timetable-theme");this._innerViewElm=this.element.get("div.timetable-innerView");this._dragRangeElm=this.element.get("div.timetable-dragRange");this._dragAreaElm=this.element.get("div.timetable-dragArea");this._scrollbar1Elm=this.element.get("div.timetable-scrollbar1");this._scrollbar2Elm=this.element.get("div.timetable-scrollbar2");this._themeElm.addClass("timetable-"+at._opts.theme);this._itemsHangingOffStart=new e.NodeList();this._itemContentHangingOffStart=new e.NodeList();u(this._dragAreaElm,"click",J,this);};A.prototype={draw:function(ay){var ax=this._timetable,aw=q.call(ax),ar=ax.size,at=ax.tracks,aq=at.length,av,au=0;if(!this._drawn){this.element.appendTo(ax._container.empty());T.call(this);}if(ay){av=ax.currentPosition();this.tracks={};this.items={};this.itemContent={};this.itemInstance={};this._dragAreaElm.empty();this._scrollbar1Elm.empty();this._scrollbar2Elm.empty();this._headerElm.empty();this._footerElm.empty();this._accessibiltyElm.empty();this._headers={};this._footers={};}if(ay||!this._drawn){this._innerViewElm[aw.length](ar);V.call(this);M.call(this);ad.call(this);ap.call(this);ag.call(this);L.call(this);E.call(this,av||ax._viewStart);}for(au=0;au<aq;au++){F.call(this,at[au]);}ae.call(this);H.call(this);this._drawn=true;return this;},currentPosition:function(ar){var aq=q.call(this._timetable);if(ar===undefined){return ai.call(this,-parseInt(this._dragAreaElm[0].style[aq.pos]));}else{ac.call(this);E.call(this,ar);G.call(this);return this;}},hide:function(){P.call(this);},clear:function(){ac.call(this);}};var ao;(function(){var ar=0;function av(){if(this._ignoreChange){return;}E.call(this._timetable._view,(this._timetable._opts.vertical?-1:1)*this.slider.val());if(!this._isDraggingChange){G.call(this._timetable._view);}}function au(){ac.call(this._timetable._view);this._isDraggingChange=true;Z.call(this._timetable._view);}function aq(){this._isDraggingChange=false;ak.call(this._timetable._view);G.call(this._timetable._view);}function at(){var ax=this._timetable,aw=q.call(ax),ay=parseInt(this._sliderHandle[0].style[aw.pos]);if(this._timetable._opts.vertical){this._labelsHighlight[0].style.clip="rect("+ay+"px, auto, "+(ay+this._handleLength)+"px, auto)";}else{this._labelsHighlight[0].style.clip="rect(auto, "+(ay+this._handleLength)+"px, auto, "+ay+"px)";}}ao=function(aG,aH,aA){var aF=aG._timetable,az=q.call(aF),aN=0,aM=aA.points,aP=aM.length-1,aO,aw,ax,aD,aE,aQ=w('<div class="timetable-scrollbarLabels"></div>'),aI=o.UID+"scrollbar"+(ar++),ay,aB=aF._viewEnd-aF._viewStart,aJ=aF.end-aF.start,aK,aL,aR,aC=aF.viewRange().start;this._timetable=aF;K("#"+aI+" .slider-handle",az.length+":"+(aB/aJ)*100+"%");if(aF._opts.vertical){aK=-aF.end+aB;aL=-aF.start;aR=-aC;}else{aK=aF.start-0;aL=aF.end-aB;aR=aC;}this.slider=new o.widgets.Slider(aH,{min:aK,max:aL,vertical:aF._opts.vertical,className:"timetable-scrollbar",id:aI,val:aR,size:aG._innerViewElm[az.length](),step:0,changeOnDrag:true});ay=this.slider.element.get("div.slider-track");if(aF._opts.vertical){ay.css(az.length,ay.get("div.slider-trackOn").css(az.length));}this.slider.element.get("div.slider-btn-bk, div.slider-btn-fwd").push(ay).css(az.breadth,aA.size);this.scale=(aJ)/ay[az.length]();for(;aN<aP;aN++){aO=aM[aN].valueOf();ax=aM[aN+1].valueOf();aw=af.call(this,aO);aD=af.call(this,ax)-aw;aE={start:aM[aN],end:aM[aN+1]};e.create('<div class="timetable-scrollbarItem"></div>').append(p.call(aE,aA.template).addClass("timetable-itemContent")).css(az.pos,aw).css(az.length,aD).appendTo(aQ);}this._labelsHighlight=aQ.clone().addClass("timetable-scrollbarLabelsHighlight");u(this.slider,"change",av,this);u(this.slider,"slideStart",au,this);u(this.slider,"slideStop",aq,this);ay.prepend(aQ).prepend(this._labelsHighlight);this._sliderHandle=this.slider.element.get("div.slider-handle");this._handleLength=this._sliderHandle[az.length]();at.call(this);};ao.prototype={moveToPosition:function(aw){this._ignoreChange=true;this.slider.val((this._timetable._opts.vertical?-1:1)*aw);this._ignoreChange=false;at.call(this);}};})();})();}});
/*@end @*/
