var widgets=[];var identifiersToStringLocalizations=[];var Widget=Class.create({initialize:function(k,j,i,l,g,h){if(k){this.instanceID=k;this.widgetPath=j;this.sharedPath=i;this.sitePath=l;this.preferences=g;this.runningInApp=(h===undefined)?false:h;this.onloadReceived=false;if(this.preferences&&this.runningInApp==true){this.preferences.widget=this;setTransparentGifURL(this.sharedPath.stringByAppendingPathComponent("None.gif"))}this.div().widget=this;window[k]=this;widgets.push(this);widgets[k]=this;if(!this.constructor.instances){this.constructor.instances=new Array()}this.constructor.instances.push(this)}},div:function(){var b=this.instanceID;if(arguments.length==1){b=this.instanceID+"-"+arguments[0]}return $(b)},onload:function(){this.onloadReceived=true},onunload:function(){},didBecomeSelected:function(){},didBecomeDeselected:function(){},didBeginEditing:function(){},didEndEditing:function(){},setNeedsDisplay:function(){},preferenceForKey:function(d){var c;if(this.preferences){c=this.preferences[d]}return c},initializeDefaultPreferences:function(c){var d=this;$H(c).each(function(a){if(d.preferenceForKey(a.key)===undefined){d.setPreferenceForKey(a.value,a.key,false)}})},setPreferenceForKey:function(e,f,d){if(this.runningInApp){if(d===undefined){d=true}if((d==false)&&this.preferences.disableUndoRegistration){this.preferences.disableUndoRegistration()}this.preferences[f]=e;if((d==false)&&this.preferences.enableUndoRegistration){this.preferences.enableUndoRegistration()}}else{this.preferences[f]=e;this.changedPreferenceForKey(f)}},changedPreferenceForKey:function(b){},postNotificationWithNameAndUserInfo:function(c,d){if(window.NotificationCenter!==undefined){NotificationCenter.postNotification(new IWNotification(c,null,d))}},sizeWillChange:function(){},sizeDidChange:function(){},widgetWidth:function(){var b=this.div();if(b){return b.offsetWidth}else{return null}},widgetHeight:function(){var b=this.div();if(b){return b.offsetHeight}else{return null}},getInstanceId:function(c){var d=this.instanceID+"-"+c;if(arguments.length==2){d+=("$"+arguments[1])}return d},getElementById:function(c){var d=this.getInstanceId.apply(this,arguments);return $(d)},localizedString:function(b){return LocalizedString(this.widgetIdentifier,b)},showView:function(h){var f=this.m_views[h];if((f!=this.m_currentView)&&(f!=this.m_futureView)){this.m_futureView=f;if(this.m_fadeAnimation){this.m_fadeAnimation.stop()}var e=this.m_currentView;this.m_currentView=f;var g=this.m_currentView;this.m_futureView=null;this.m_fadeAnimation=new SimpleAnimation(function(){delete this.m_fadeAnimation}.bind(this));this.m_fadeAnimation.pre=function(){if(e){e.ensureDiv().setStyle({zIndex:0,opacity:1})}if(g){g.ensureDiv().setStyle({zIndex:1,opacity:0});g.show();g.render()}};this.m_fadeAnimation.post=function(){!e||e.hide();!g||g.ensureDiv().setStyle({zIndex:"",opacity:1});!g||!g.doneFadingIn||g.doneFadingIn()};this.m_fadeAnimation.update=function(a){!g||g.ensureDiv().setOpacity(a);!e||e.ensureDiv().setOpacity(1-a)}.bind(this);this.m_fadeAnimation.start()}}});Widget.onload=function(){for(var b=0;b<widgets.length;b++){widgets[b].onload()}};Widget.onunload=function(){for(var b=0;b<widgets.length;b++){widgets[b].onunload()}};function RegisterWidgetStrings(c,d){identifiersToStringLocalizations[c]=d}function LocalizedString(e,f){var h=undefined;var g=identifiersToStringLocalizations[e];if(g===undefined){iWLog("warning: no localizations for widget "+e+", (key:"+f+")")}else{h=g[f]}if(h===undefined){iWLog("warning: couldn't find a localization for '"+f+"' for widget "+e);h=f}return h}function WriteLocalizedString(c,d){document.write(LocalizedString(c,d))}var JSONFeedRendererWidget=Class.create(Widget,{initialize:function($super,k,j,i,l,g,h){if(k){$super(k,j,i,l,g,h)}},changedPreferenceForKey:function(key){try{var value=this.preferenceForKey(key);if(key=="sfr-shadow"){if(value!=null){this.sfrShadow=eval(value)}else{this.sfrShadow=null}this.renderFeedItems("sfr-shadow")}if(key=="sfr-stroke"){if(value!==null){this.sfrStroke=eval(value)}else{this.sfrStroke=null}this.invalidateFeedItems("sfr-stroke")}if(key=="sfr-reflection"){if(value!==null){this.sfrReflection=eval(value)}else{this.sfrReflection=null}this.invalidateFeedItems("sfr-reflection")}}catch(e){iWLog("JSONFeedRendererWidget: exception");debugPrintException(e)}},invalidateFeedItems:function(b){trace("invalidateFeedItems(%s)",b);if(this.pendingRender!==null){clearTimeout(this.pendingRender)}this.pendingRender=setTimeout(function(){this.pendingRender=null;this.renderFeedItems(b)}.bind(this),50)},rerenderImage:function(p,s,k,t,m,o,l,q){p.update();if(t){p.strokeApplied=false;p.reflectionApplied=false;p.shadowApplied=false;p.setStyle({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});p.style.position="relative";s.style.position="relative";var n=k||transparentGifURL();var r=IWCreateImage(n);r.load(function(c,e,a,f,d){var b=this.croppingDivForImage(c,m,o);a.appendChild(b);if(f){f()}if(c.sourceURL()!==transparentGifURL()){this.applyEffects(a)}if(d){d()}}.bind(this,r,s,p,l,q))}},croppingDivForImage:function(n,m,q){var p=function(c,d,b){if(d=="Square"){return new IWSize(b,b)}else{if(d=="Landscape"){return new IWSize(b,b*(3/4))}else{if(d=="Portrait"){return new IWSize(b,b*(4/3))}else{var a=b/c.width;return c.scale(a,a,true)}}}};var j=null;if(n.loaded()){var l=$(document.createElement("img"));l.src=n.sourceURL();var r=n.naturalSize();j=$(document.createElement("div"));j.appendChild(l);var k=function(c){if(c){r=new IWSize(c.width,c.height)}var e=p(r,m,q);var a=e.width/r.width;if(r.aspectRatio()>e.aspectRatio()){a=e.height/r.height}var b=r.scale(a);var d=new IWPoint(Math.abs(b.width-e.width)/2,Math.abs(b.height-e.height)/2);l.setStyle({width:px(b.width),height:px(b.height),marginLeft:px(-d.x),marginTop:px(-d.y),position:"relative"});j.setStyle({width:px(e.width),height:px(e.height),overflow:"hidden",position:"relative"});j.className="crop"};if(windowsInternetExplorer&&effectiveBrowserVersion<7&&l.src.indexOf(transparentGifURL())!=-1){var o=new Image();o.src=l.originalSrc;if(o.complete){k(o)}else{o.onload=k.bind(null,o)}}else{k(null)}}return j},applyEffects:function(e){if(this.sfrShadow||this.sfrReflection||this.sfrStroke){if((e.offsetWidth===undefined)||(e.offsetHeight===undefined)||(e.offsetWidth===0)||(e.offsetHeight===0)){setTimeout(JSONFeedRendererWidget.prototype.applyEffects.bind(this,e),0);return}if(this.sfrStroke&&(e.strokeApplied==false)){this.sfrStroke.applyToElement(e);e.strokeApplied=true}if(this.sfrReflection&&(e.reflectionApplied==false)){this.sfrReflection.applyToElement(e);e.reflectionApplied=true}if(this.sfrShadow&&(!this.disableShadows)&&(e.shadowApplied==false)){this.sfrShadow.applyToElement(e);e.shadowApplied=true}if(this.runningInApp&&(window.webKitVersion<=419)&&this.preferences.setNeedsDisplay){this.preferences.setNeedsDisplay()}}if(windowsInternetExplorer){var d=e.select(".crop");var f=d[d.length-1];if(f){f.onclick=function(){var b=e.parentNode;var a=locationHRef();while(b&&(b.tagName!="A")){b=b.parentNode}if(b){a=b.href}window.location=a};f.onmouseover=function(){this.style.cursor="pointer"}}}},summaryExcerpt:function(e,h){var g=document.createElement("div");g.innerHTML=e;if(h>0){var f=new HTMLTextModel(g);f.truncateAroundPosition(h,"...")}else{if(h===0){g.innerHTML=""}}return g.innerHTML}});var PrefMarkupWidget=Class.create(Widget,{initialize:function($super,k,j,i,l,g,h){if(k){$super(k,j,i,l,g,h)}},onload:function(){if(!this.runningInApp){this.setUpSubDocumentOnLoad()}},setUpSubDocumentOnLoad:function(){var d=this;var c=this.getElementById("frame");if(c){setTimeout(function(){d.loadedSubDocument()},250)}},loadedSubDocument:function(){var f=this.getElementById("frame");var e=f.contentWindow||f.contentDocument;if(e.document){e=e.document}if(e.body){this.fixTargetOnElements(e,"a");this.fixTargetOnElements(e,"form")}else{var d=this;setTimeout(function(){d.loadedSubDocument()},250)}},fixTargetOnElements:function(f,i){var h=f.getElementsByTagName(i);for(var j=0;j<h.length;j++){var g=h[j].target;if(g===undefined||g==""){h[j].target="_top"}}}});function IWScrollbar(b){}IWScrollbar.prototype._init=function(){var c=null;var d=null;this._track=$(document.createElement("div"));c=this._track.style;c.height="100%";c.width="100%";this.scrollbar.appendChild(this._track);d=$(document.createElement("div"));d.style.position="absolute";this._setObjectStart(d,0);this._track.appendChild(d);d=$(document.createElement("div"));d.style.position="absolute";this._track.appendChild(d);d=$(document.createElement("div"));d.style.position="absolute";windowsInternetExplorer||this._setObjectEnd(d,0);this._track.appendChild(d);this._thumb=$(document.createElement("div"));c=this._thumb.style;c.position="absolute";this._setObjectSize(this._thumb,this.minThumbSize);this._track.appendChild(this._thumb);d=$(document.createElement("div"));d.style.position="absolute";this._setObjectStart(d,0);this._thumb.appendChild(d);d=$(document.createElement("div"));d.style.position="absolute";this._thumb.appendChild(d);d=$(document.createElement("div"));d.style.position="absolute";windowsInternetExplorer||this._setObjectEnd(d,0);this._thumb.appendChild(d);this.setSize(this.size);this.setTrackStart(this.trackStartPath,this.trackStartLength);this.setTrackMiddle(this.trackMiddlePath);this.setTrackEnd(this.trackEndPath,this.trackEndLength);this.setThumbStart(this.thumbStartPath,this.thumbStartLength);this.setThumbMiddle(this.thumbMiddlePath);this.setThumbEnd(this.thumbEndPath,this.thumbEndLength);this._thumb.style.display="none";Event.observe(this._track,"mousedown",this._mousedownTrackHandler,false);Event.observe(this._thumb,"mousedown",this._mousedownThumbHandler,false)};IWScrollbar.prototype.remove=function(){this.scrollbar.removeChild(this._track)};IWScrollbar.prototype._captureEvent=function(b){b.stopPropagation();b.preventDefault()};IWScrollbar.prototype._mousedownThumb=function(b){Event.observe(document,"mousemove",this._mousemoveThumbHandler,true);Event.observe(document,"mouseup",this._mouseupThumbHandler,true);Event.observe(document,"mouseover",this._captureEventHandler,true);Event.observe(document,"mouseout",this._captureEventHandler,true);this._thumbStart_temp=this._getMousePosition(b);this._scroll_thumbStartPos=this._getThumbStartPos();b.stopPropagation();b.preventDefault()};IWScrollbar.prototype._mousemoveThumb=function(f){var e=this._getMousePosition(f)-this._thumbStart_temp;var d=this._scroll_thumbStartPos+e;this.scrollTo(this._contentPositionForThumbPosition(d));f.stopPropagation();f.preventDefault()};IWScrollbar.prototype._mouseupThumb=function(b){Event.stopObserving(document,"mousemove",this._mousemoveThumbHandler,true);Event.stopObserving(document,"mouseup",this._mouseupThumbHandler,true);Event.stopObserving(document,"mouseover",this._captureEventHandler,true);Event.stopObserving(document,"mouseout",this._captureEventHandler,true);delete this._thumbStart_temp;delete this._scroll_thumbStartPos;b.stopPropagation();b.preventDefault()};IWScrollbar.prototype._mousedownTrack=function(b){this._track_mouse_temp=this._getMousePosition(b)-this._trackOffset;if(b.altKey){this.scrollTo(this._contentPositionForThumbPosition(this._track_mouse_temp-(this._thumbLength/2)));delete this._track_mouse_temp}else{this._track_scrolling=true;Event.observe(this._track,"mousemove",this._mousemoveTrackHandler,true);Event.observe(this._track,"mouseover",this._mouseoverTrackHandler,true);Event.observe(this._track,"mouseout",this._mouseoutTrackHandler,true);Event.observe(document,"mouseup",this._mouseupTrackHandler,true);this._trackScrollOnePage(this);this._track_timer=setInterval(this._trackScrollDelay,500,this)}b.stopPropagation();b.preventDefault()};IWScrollbar.prototype._trackScrollDelay=function(b){if(!b._track_scrolling){return}clearInterval(b._track_timer);b._trackScrollOnePage(b);b._track_timer=setInterval(b._trackScrollOnePage,150,b)};IWScrollbar.prototype._mousemoveTrack=function(b){this._track_mouse_temp=this._getMousePosition(b)-this._trackOffset;b.stopPropagation();b.preventDefault()};IWScrollbar.prototype._mouseoverTrack=function(b){this._track_mouse_temp=this._getMousePosition(b)-this._trackOffset;this._track_scrolling=true;b.stopPropagation();b.preventDefault()};IWScrollbar.prototype._mouseoutTrack=function(b){this._track_scrolling=false;b.stopPropagation();b.preventDefault()};IWScrollbar.prototype._mouseupTrack=function(b){clearInterval(this._track_timer);Event.stopObserving(this._track,"mousemove",this._mousemoveTrackHandler,true);Event.stopObserving(this._track,"mouseover",this._mouseoverTrackHandler,true);Event.stopObserving(this._track,"mouseout",this._mouseoutTrackHandler,true);Event.stopObserving(document,"mouseup",this._mouseupTrackHandler,true);delete this._track_mouse_temp;delete this._track_scrolling;delete this._track_timer;b.stopPropagation();b.preventDefault()};IWScrollbar.prototype._trackScrollOnePage=function(d){if(!d._track_scrolling){return}var c=Math.round(d._trackLength*d._getViewToContentRatio());if(d._track_mouse_temp<d._thumbStart){d.scrollByThumbDelta(-c)}else{if(d._track_mouse_temp>(d._thumbStart+d._thumbLength)){d.scrollByThumbDelta(c)}}};IWScrollbar.prototype.setScrollArea=function(b){if(this.scrollarea){Event.stopObserving(this.scrollbar,"mousewheel",this.scrollarea._mousewheelScrollHandler,true);Event.stopObserving(this.scrollbar,"DOMMouseScroll",this.scrollarea._mousewheelScrollHandler,true)}this.scrollarea=b;Event.observe(this.scrollbar,"mousewheel",this.scrollarea._mousewheelScrollHandler,true);Event.observe(this.scrollbar,"DOMMouseScroll",this.scrollarea._mousewheelScrollHandler,true)};IWScrollbar.prototype.refresh=function(){this._trackOffset=this._computeTrackOffset();this._trackLength=this._computeTrackLength();var b=this._getViewToContentRatio();if(b>=1||!this._canScroll()){if(this.autohide){this.hide()}this._thumb.style.display="none";this.scrollbar.style.appleDashboardRegion="none"}else{this._thumbLength=Math.max(Math.round(this._trackLength*b),this.minThumbSize);this._numScrollablePixels=this._trackLength-this._thumbLength-(2*this.padding);this._setObjectLength(this._thumb,this._thumbLength);if(windowsInternetExplorer){this._setObjectStart(this._thumb.down().next(),this.thumbStartLength);this._setObjectLength(this._thumb.down().next(),this._thumbLength-this.thumbStartLength-this.thumbEndLength);this._setObjectStart(this._thumb.down().next(1),this._thumbLength-this.thumbEndLength);this._setObjectLength(this._thumb.down().next(1),this.thumbEndLength);if(!this.fixedUpIEPNGBGs){fixupIEPNGBGsInTree(this._track);Event.stopObserving(this._track,"mousedown",this._mousedownTrackHandler);Event.stopObserving(this._thumb,"mousedown",this._mousedownThumbHandler);Event.observe(this._track,"mousedown",this._mousedownTrackHandler);Event.observe(this._thumb,"mousedown",this._mousedownThumbHandler);this.fixedUpIEPNGBGs=true}}this._thumb.style.display="block";this.scrollbar.style.appleDashboardRegion="dashboard-region(control rectangle)";this.show()}this.verticalHasScrolled();this.horizontalHasScrolled()};IWScrollbar.prototype.setAutohide=function(b){this.autohide=b;if(this._getViewToContentRatio()>=1&&b){this.hide()}else{this.show()}};IWScrollbar.prototype.hide=function(){this._track.style.display="none";this.hidden=true};IWScrollbar.prototype.show=function(){this._track.style.display="block";this.hidden=false};IWScrollbar.prototype.setSize=function(b){this.size=b;this._setObjectSize(this.scrollbar,b);this._setObjectSize(this._track.down().next(),b);this._setObjectSize(this._thumb.down().next(),b)};IWScrollbar.prototype.setTrackStart=function(d,e){this.trackStartPath=d;this.trackStartLength=e;var f=this._track.down();f.style.background="url("+d+") no-repeat top left";this._setObjectLength(f,e);this._setObjectSize(f,this.size);this._setObjectStart(this._track.down().next(),e)};IWScrollbar.prototype.setTrackMiddle=function(b){this.trackMiddlePath=b;this._track.down().next().style.background="url("+b+") "+this._repeatType+" top left"};IWScrollbar.prototype.setTrackEnd=function(d,e){this.trackEndPath=d;this.trackEndLength=e;var f=this._track.down().next(1);f.style.background="url("+d+") no-repeat top left";this._setObjectLength(f,e);this._setObjectSize(f,this.size);windowsInternetExplorer||this._setObjectEnd(this._track.down().next(),e)};IWScrollbar.prototype.setThumbStart=function(d,e){this.thumbStartPath=d;this.thumbStartLength=e;var f=this._thumb.down();f.style.background="url("+d+") no-repeat top left";this._setObjectLength(f,e);this._setObjectSize(f,this.size);this._setObjectStart(this._thumb.down().next(),e)};IWScrollbar.prototype.setThumbMiddle=function(b){this.thumbMiddlePath=b;this._thumb.down().next().style.background="url("+b+") "+this._repeatType+" top left"};IWScrollbar.prototype.setThumbEnd=function(d,e){this.thumbEndPath=d;this.thumbEndLength=e;var f=this._thumb.down().next(1);f.style.background="url("+d+") no-repeat top left";this._setObjectLength(f,e);this._setObjectSize(f,this.size);windowsInternetExplorer||this._setObjectEnd(this._thumb.down().next(),e)};IWScrollbar.prototype._contentPositionForThumbPosition=function(b){if(this._getViewToContentRatio()>=1){return 0}else{return(b-this.padding)*((this._getContentLength()-this._getViewLength())/this._numScrollablePixels)}};IWScrollbar.prototype._thumbPositionForContentPosition=function(c){if(this._getViewToContentRatio()>=1){return this.padding}else{var d=this.padding+(c/((this._getContentLength()-this._getViewLength())/this._numScrollablePixels));if(isNaN(d)){d=0}return d}};IWScrollbar.prototype.scrollByThumbDelta=function(b){if(b==0){return}this.scrollTo(this._contentPositionForThumbPosition(this._thumbStart+b))};function IWVerticalScrollbar(c){this.scrollarea=null;this.scrollbar=$(c);this.minThumbSize=28;this.padding=-1;this.autohide=true;this.hidden=true;this.size=19;this.trackStartPath=transparentGifURL();this.trackStartLength=18;this.trackMiddlePath=transparentGifURL();this.trackEndPath=transparentGifURL();this.trackEndLength=18;this.thumbStartPath=transparentGifURL();this.thumbStartLength=9;this.thumbMiddlePath=transparentGifURL();this.thumbEndPath=transparentGifURL();this.thumbEndLength=9;this._track=null;this._thumb=null;this._trackOffset=0;this._trackLength=0;this._numScrollablePixels=0;this._thumbLength=0;this._repeatType="repeat-y";this._thumbStart=this.padding;var d=this;this._captureEventHandler=function(a){d._captureEvent(a)};this._mousedownThumbHandler=function(a){d._mousedownThumb(a)};this._mousemoveThumbHandler=function(a){d._mousemoveThumb(a)};this._mouseupThumbHandler=function(a){d._mouseupThumb(a)};this._mousedownTrackHandler=function(a){d._mousedownTrack(a)};this._mousemoveTrackHandler=function(a){d._mousemoveTrack(a)};this._mouseoverTrackHandler=function(a){d._mouseoverTrack(a)};this._mouseoutTrackHandler=function(a){d._mouseoutTrack(a)};this._mouseupTrackHandler=function(a){d._mouseupTrack(a)};this._init()}IWVerticalScrollbar.prototype=new IWScrollbar(null);IWVerticalScrollbar.prototype.scrollTo=function(b){this.scrollarea.verticalScrollTo(b)};IWVerticalScrollbar.prototype._setObjectSize=function(d,c){d.style.width=c+"px"};IWVerticalScrollbar.prototype._setObjectLength=function(d,c){d.style.height=c+"px"};IWVerticalScrollbar.prototype._setObjectStart=function(d,c){d.style.top=c+"px"};IWVerticalScrollbar.prototype._setObjectEnd=function(c,d){c.style.bottom=d+"px"};IWVerticalScrollbar.prototype._getMousePosition=function(b){if(b!=undefined){return Event.pointerY(b)}else{return 0}};IWVerticalScrollbar.prototype._getThumbStartPos=function(){return this._thumb.offsetTop};IWVerticalScrollbar.prototype._computeTrackOffset=function(){var c=this.scrollbar;var d=0;while(c.offsetParent){d+=c.offsetTop;c=c.offsetParent}return d};IWVerticalScrollbar.prototype._computeTrackLength=function(){return this.scrollbar.offsetHeight};IWVerticalScrollbar.prototype._getViewToContentRatio=function(){return this.scrollarea.viewToContentHeightRatio};IWVerticalScrollbar.prototype._getContentLength=function(){return this.scrollarea.content.scrollHeight};IWVerticalScrollbar.prototype._getViewLength=function(){return this.scrollarea.viewHeight};IWVerticalScrollbar.prototype._canScroll=function(){return this.scrollarea.scrollsVertically};IWVerticalScrollbar.prototype.verticalHasScrolled=function(){var b=this._thumbPositionForContentPosition(this.scrollarea.content.scrollTop);this._thumbStart=b;this._thumb.style.top=b+"px"};IWVerticalScrollbar.prototype.horizontalHasScrolled=function(){};function IWHorizontalScrollbar(c){this.scrollarea=null;this.scrollbar=$(c);this.minThumbSize=28;this.padding=-1;this.autohide=true;this.hidden=true;this.size=19;this.trackStartPath=transparentGifURL();this.trackStartLength=18;this.trackMiddlePath=transparentGifURL();this.trackEndPath=transparentGifURL();this.trackEndLength=18;this.thumbStartPath=transparentGifURL();this.thumbStartLength=9;this.thumbMiddlePath=transparentGifURL();this.thumbEndPath=transparentGifURL();this.thumbEndLength=9;this._track=null;this._thumb=null;this._trackOffset=0;this._trackLength=0;this._numScrollablePixels=0;this._thumbLength=0;this._repeatType="repeat-x";this._thumbStart=this.padding;var d=this;this._captureEventHandler=function(a){d._captureEvent(a)};this._mousedownThumbHandler=function(a){d._mousedownThumb(a)};this._mousemoveThumbHandler=function(a){d._mousemoveThumb(a)};this._mouseupThumbHandler=function(a){d._mouseupThumb(a)};this._mousedownTrackHandler=function(a){d._mousedownTrack(a)};this._mousemoveTrackHandler=function(a){d._mousemoveTrack(a)};this._mouseoverTrackHandler=function(a){d._mouseoverTrack(a)};this._mouseoutTrackHandler=function(a){d._mouseoutTrack(a)};this._mouseupTrackHandler=function(a){d._mouseupTrack(a)};this._init()}IWHorizontalScrollbar.prototype=new IWScrollbar(null);IWHorizontalScrollbar.prototype.scrollTo=function(b){this.scrollarea.horizontalScrollTo(b)};IWHorizontalScrollbar.prototype._setObjectSize=function(d,c){d.style.height=c+"px"};IWHorizontalScrollbar.prototype._setObjectLength=function(d,c){d.style.width=c+"px"};IWHorizontalScrollbar.prototype._setObjectStart=function(d,c){d.style.left=c+"px"};IWHorizontalScrollbar.prototype._setObjectEnd=function(c,d){c.style.right=d+"px"};IWHorizontalScrollbar.prototype._getMousePosition=function(b){if(b!=undefined){return Event.pointerX(b)}else{return 0}};IWHorizontalScrollbar.prototype._getThumbStartPos=function(){return this._thumb.offsetLeft};IWHorizontalScrollbar.prototype._computeTrackOffset=function(){var c=this.scrollbar;var d=0;while(c.offsetParent){d+=c.offsetLeft;c=c.offsetParent}return d};IWHorizontalScrollbar.prototype._computeTrackLength=function(){return this.scrollbar.offsetWidth};IWHorizontalScrollbar.prototype._getViewToContentRatio=function(){return this.scrollarea.viewToContentWidthRatio};IWHorizontalScrollbar.prototype._getContentLength=function(){return this.scrollarea.content.scrollWidth};IWHorizontalScrollbar.prototype._getViewLength=function(){return this.scrollarea.viewWidth};IWHorizontalScrollbar.prototype._canScroll=function(){return this.scrollarea.scrollsHorizontally};IWHorizontalScrollbar.prototype.verticalHasScrolled=function(){};IWHorizontalScrollbar.prototype.horizontalHasScrolled=function(){var b=this._thumbPositionForContentPosition(this.scrollarea.content.scrollLeft);this._thumbStart=b;this._thumb.style.left=b+"px"};function IWScrollArea(h){this.content=$(h);this.scrollsVertically=true;this.scrollsHorizontally=true;this.singlepressScrollPixels=10;this.viewHeight=0;this.viewToContentHeightRatio=1;this.viewWidth=0;this.viewToContentWidthRatio=1;this._scrollbars=new Array();var f=this;this._refreshHandler=function(){f.refresh()};this._keyPressedHandler=function(){f.keyPressed(event)};this._mousewheelScrollHandler=function(a){f.mousewheelScroll(a)};this.content.style.overflow="hidden";this.content.scrollTop=0;this.content.scrollLeft=0;Event.observe(this.content,"mousewheel",this._mousewheelScrollHandler,true);Event.observe(this.content,"DOMMouseScroll",this._mousewheelScrollHandler,true);this.refresh();var g=arguments.length;for(var c=1;c<g;++c){this.addScrollbar(arguments[c])}}IWScrollArea.prototype.addScrollbar=function(b){b.setScrollArea(this);this._scrollbars.push(b);b.refresh()};IWScrollArea.prototype.removeScrollbar=function(g){var c=this._scrollbars;var h=c.length;for(var f=0;f<h;++f){if(c[f]==g){c.splice(f,1);break}}};IWScrollArea.prototype.remove=function(){Event.stopObserving(this.content,"mousewheel",this._mousewheelScrollHandler,true);Event.stopObserving(this.content,"DOMMouseScroll",this._mousewheelScrollHandler,true);var f=this._scrollbars;var e=f.length;for(var c=0;c<e;++c){f[c].setScrollArea(null)}};IWScrollArea.prototype.refresh=function(){this.viewHeight=this.content.offsetHeight;this.viewWidth=this.content.offsetWidth;if(this.content.scrollHeight>this.viewHeight){this.viewToContentHeightRatio=this.viewHeight/this.content.scrollHeight;this.verticalScrollTo(this.content.scrollTop)}else{this.viewToContentHeightRatio=1;this.verticalScrollTo(0)}if(this.content.scrollWidth>this.viewWidth){this.viewToContentWidthRatio=this.viewWidth/this.content.scrollWidth;this.horizontalScrollTo(this.content.scrollLeft)}else{this.viewToContentWidthRatio=1;this.horizontalScrollTo(0)}var f=this._scrollbars;var e=f.length;for(var c=0;c<e;++c){f[c].refresh()}};IWScrollArea.prototype.focus=function(){Event.observe(document,"keypress",this._keyPressedHandler,true)};IWScrollArea.prototype.blur=function(){Event.stopObserving(document,"keypress",this._keyPressedHandler,true)};IWScrollArea.prototype.reveal=function(e){var g=0;var h=e;do{g+=h.offsetTop;h=h.offsetParent}while(h&&h!=this.content);var f=0;h=e;do{f+=h.offsetLeft;h=h.offsetParent}while(h&&h!=this.content);this.verticalScrollTo(g);this.horizontalScrollTo(f)};IWScrollArea.prototype.verticalScrollTo=function(g){if(!this.scrollsVertically){return}var j=this.content.scrollHeight-this.viewHeight;if(g<0){g=0}else{if(g>j){g=j}}this.content.scrollTop=g;var h=this._scrollbars;var c=h.length;for(var i=0;i<c;++i){h[i].verticalHasScrolled()}};IWScrollArea.prototype.horizontalScrollTo=function(c){if(!this.scrollsHorizontally){return}var i=this.content_width-this.viewWidth;if(c<0){c=0}else{if(c>i){c=i}}this.content.scrollLeft=c;var h=this._scrollbars;var g=h.length;for(var j=0;j<g;++j){h[j].horizontalHasScrolled()}};IWScrollArea.prototype.keyPressed=function(d){var c=true;if(d.altKey){return}if(d.shiftKey){return}switch(d.keyIdentifier){case"Home":this.verticalScrollTo(0);break;case"End":this.verticalScrollTo(this.content.scrollHeight-this.viewHeight);break;case"Up":this.verticalScrollTo(this.content.scrollTop-this.singlepressScrollPixels);break;case"Down":this.verticalScrollTo(this.content.scrollTop+this.singlepressScrollPixels);break;case"PageUp":this.verticalScrollTo(this.content.scrollTop-this.viewHeight);break;case"PageDown":this.verticalScrollTo(this.content.scrollTop+this.viewHeight);break;case"Left":this.horizontalScrollTo(this.content.scrollLeft-this.singlepressScrollPixels);break;case"Right":this.horizontalScrollTo(this.content.scrollLeft+this.singlepressScrollPixels);break;default:c=false}if(c){d.stopPropagation();d.preventDefault()}};IWScrollArea.prototype.mousewheelScroll=function(d){var c=d.wheelDelta?(d.wheelDelta/120*this.singlepressScrollPixels):(d.detail/-2*this.singlepressScrollPixels);this.verticalScrollTo(this.content.scrollTop-c);d.stopPropagation();d.preventDefault()};var View=Class.create({initialize:function(d,c){this.m_widget=d;this.m_parentDiv=c;this.m_divInstanceId=this.m_divId;this.hide()},ensureDiv:function(){var b=this.m_widget.div(this.m_divInstanceId);if(!b){b=new Element("div",{id:this.m_widget.getInstanceId(this.m_divInstanceId)});b.addClassName(this.m_divClass);this.m_parentDiv.appendChild(b)}return $(b)},hide:function(){this.ensureDiv().hide()},show:function(){this.ensureDiv().show()},render:function(){},resize:function(){}});var StatusView=Class.create(View,{initialize:function($super,d,c){$super(d,c);this.render();this.hide()},render:function(){var f="<table class='StatusMessageTable'><tr><td>";if(this.badgeImage){f+=imgMarkup(this.m_widget.widgetPath+"/"+this.badgeImage,"","id='"+this.p_badgeImgId()+"'","")}f+="</td></tr></table>";if(this.upperRightBadgeWidth&&this.upperRightBadgeHeight){var d=(this.upperRightBadge)?(this.m_widget.widgetPath+"/"+this.upperRightBadge):transparentGifURL();f+=imgMarkup(d,"","class='StatusUpperRightBadge' width='"+this.upperRightBadgeWidth+"' height='"+this.upperRightBadgeHeight+"' ","")}var e=this.m_widget.sharedPath.stringByAppendingPathComponent("Translucent-Overlay.png");f+=imgMarkup(e,"position: absolute; top: 0; left: 0;","id='"+this.p_overlayImgId()+"' width='700' height='286' ","");if(this.statusMessageKey){f+="<div id='"+this.p_statusMessageBlockId()+"' class='StatusMessageBlock' ><span>"+this.m_widget.localizedString(this.statusMessageKey)+"</span></div>"}this.ensureDiv().update(f);this.resize()},resize:function(){var C=(this.runningInApp)?window.innerWidth:this.m_widget.div().offsetWidth;var x=(this.runningInApp)?window.innerHeight:this.m_widget.div().offsetHeight;if(this.badgeImage){var E=$(this.p_badgeImgId());var B=new IWSize(this.badgeImageWidth,this.badgeImageHeight);if((B.width>C)||(B.height>x)){var y=new IWSize(C,x);B=B.scaleToFit(y)}E.width=B.width;E.height=B.height}var v=700;var D=286;var w=Math.max(C,v);var F=D;var z=Math.min(((x/2)-D),0);var q=Math.min(((C/2)-(v/2)),0);var u=$(this.p_overlayImgId());u.width=w;u.height=F;u.setStyle({left:px(q),top:px(z)});var s=$(this.p_statusMessageBlockId());if(s){var r=px(Math.max(((C-s.offsetWidth)/2),0));var t={left:r};if(this.statusMessageVerticallyCentered){var A=px(Math.max(((x-s.offsetHeight)/2),0));t.top=A}s.setStyle(t)}if(this.footerView){this.footerView.resize()}},doneFadingIn:function(){this.m_widget.setPreferenceForKey(true,"x-viewDoneFadingIn",false)},p_badgeImgId:function(){return this.m_widget.getInstanceId(this.m_divId+"-badge")},p_overlayImgId:function(){return this.m_widget.getInstanceId(this.m_divId+"-overlay")},p_statusMessageBlockId:function(){return this.m_widget.getInstanceId(this.m_divId+"-messageBlock")}});