/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */

if(!dojo._hasResource["esri.dijit.Popup"]){dojo._hasResource["esri.dijit.Popup"]=true;dojo.provide("esri.dijit.Popup");dojo.require("esri.InfoWindowBase");dojo.require("esri.PopupBase");dojo.require("esri.utils");dojo.require("dijit._Widget");dojo.require("dijit._Templated");dojo.require("dojo.number");dojo.require("dojo.date.locale");dojo.require("dojox.charting.Chart2D");dojo.require("dojox.charting.themes.PlotKit.base");dojo.require("dojox.charting.action2d.Tooltip");dojo.require("dojo.i18n");(function(){var dc=dojox.charting,pk=dc.themes.PlotKit;pk.popup=pk.base.clone();pk.popup.chart.fill=pk.popup.plotarea.fill="#e7eef6";pk.popup.colors=["#284B70","#702828","#5F7143","#F6BC0C","#382C6C","#50224F","#1D7554","#4C4C4C","#0271AE","#706E41","#446A73","#0C3E69","#757575","#B7B7B7","#A3A3A3"];pk.popup.series.stroke.width=1;pk.popup.marker.stroke.width=1;}());dojo.declare("esri.dijit.Popup",[esri.InfoWindowBase,esri.PopupBase],{offsetX:3,offsetY:3,zoomFactor:4,marginLeft:10,marginTop:10,highlight:true,constructor:function(_1,_2){this.initialize();dojo.mixin(this,_1);this.domNode=dojo.byId(_2);var _3=this._nls=dojo.mixin({},esri.bundle.widgets.popup);var _4=this.domNode;dojo.addClass(_4,"esriPopup");var _5="<div class='esriPopupWrapper' style='position: absolute;'>"+"<div class='sizer'>"+"<div class='titlePane'>"+"<div class='spinner hidden' title='"+_3.NLS_searching+"...'></div>"+"<div class='title'></div>"+"<div class='titleButton prev hidden' title='"+_3.NLS_prevFeature+"'></div>"+"<div class='titleButton next hidden' title='"+_3.NLS_nextFeature+"'></div>"+"<div class='titleButton maximize' title='"+_3.NLS_maximize+"'></div>"+"<div class='titleButton close' title='"+_3.NLS_close+"'></div>"+"</div>"+"</div>"+"<div class='sizer content'>"+"<div class='contentPane'>"+"</div>"+"</div>"+"<div class='sizer'>"+"<div class='actionsPane'>"+"<div class='actionList hidden'>"+"<a class='action zoomTo' href='javascript:void(0);'>"+_3.NLS_zoomTo+"</a>"+"</div>"+"</div>"+"</div>"+"<div class='pointer hidden'></div>"+"</div>"+"<div class='outerPointer hidden'></div>";dojo.attr(_4,"innerHTML",_5);this._sizers=dojo.query(".sizer",_4);var _6=dojo.query(".titlePane",_4)[0];dojo.setSelectable(_6,false);this._title=dojo.query(".title",_6)[0];this._prevFeatureButton=dojo.query(".prev",_6)[0];this._nextFeatureButton=dojo.query(".next",_6)[0];this._maxButton=dojo.query(".maximize",_6)[0];this._spinner=dojo.query(".spinner",_6)[0];this._contentPane=dojo.query(".contentPane",_4)[0];this._positioner=dojo.query(".esriPopupWrapper",_4)[0];this._pointer=dojo.query(".pointer",_4)[0];this._outerPointer=dojo.query(".outerPointer",_4)[0];this._actionList=dojo.query(".actionsPane .actionList",_4)[0];this._eventConnections=[dojo.connect(dojo.query(".close",_6)[0],"onclick",this,this.hide),dojo.connect(this._prevFeatureButton,"onclick",this,this.selectPrevious),dojo.connect(this._nextFeatureButton,"onclick",this,this.selectNext),dojo.connect(this._maxButton,"onclick",this,this._toggleSize),dojo.connect(dojo.query(".zoomTo",this._actionList)[0],"onclick",this,this._zoomToFeature)];if(esri.isTouchEnabled){var _7=esri.setScrollable(this._contentPane);this._eventConnections.push(_7[0],_7[1]);}this._setVisibility(false);this.isShowing=false;},setMap:function(_8){this.inherited(arguments);dojo.place(this.domNode,_8.root);if(this.highlight){this.enableHighlight(_8);}this._maxHeight=dojo.style(this._contentPane,"maxHeight");},unsetMap:function(){this.disableHighlight(this.map);this.inherited(arguments);},setTitle:function(_9){if(!esri._isDefined(_9)||_9===""){_9="&nbsp;";}this.destroyDijits(this._title);this.place(_9,this._title);if(this.isShowing){this.startupDijits(this._title);this.reposition();}},setContent:function(_a){if(!esri._isDefined(_a)||_a===""){_a="&nbsp;";}this.destroyDijits(this._contentPane);this.place(_a,this._contentPane);if(this.isShowing){this.startupDijits(this._contentPane);this.reposition();}},show:function(_b){if(!_b){this._setVisibility(true);this.isShowing=true;return;}var _c=this.map,_d;if(_b.spatialReference){this._location=_b;_d=_c.toScreen(_b);}else{this._location=_c.toMap(_b);_d=_b;}var _e=_c._getFrameWidth();if(_e!==-1){_d.x=_d.x%_e;if(_d.x<0){_d.x+=_e;}if(_c.width>_e){var _f=(_c.width-_e)/2;while(_d.x<_f){_d.x+=_e;}}}if(this._maximized){this.restore();}else{this._setPosition(_d);}if(!this.isShowing){this._setVisibility(true);this.isShowing=true;this.onShow();}},hide:function(){if(this.isShowing){this._setVisibility(false);this.isShowing=false;this.onHide();}},resize:function(_10,_11){this._sizers.style({width:_10+"px"});dojo.style(this._contentPane,"maxHeight",_11+"px");this._maxHeight=_11;if(this.isShowing){this.reposition();}},reposition:function(){if(this.map&&this._location&&!this._maximized&&this.isShowing){this._setPosition(this.map.toScreen(this._location));}},onShow:function(){this._followMap();this.startupDijits(this._title);this.startupDijits(this._contentPane);this.reposition();this.showHighlight();},onHide:function(){this._unfollowMap();this.hideHighlight();},maximize:function(){var map=this.map;if(!map||this._maximized){return;}this._maximized=true;var max=this._maxButton;dojo.removeClass(max,"maximize");dojo.addClass(max,"restore");dojo.attr(max,"title",this._nls.NLS_restore);var _12=this.marginLeft,_13=this.marginTop,_14=map.width-(2*_12),_15=map.height-(2*_13),_16=this.domNode;dojo.style(_16,{left:_12+"px",right:null,top:_13+"px",bottom:null});dojo.style(this._positioner,{left:null,right:null,top:null,bottom:null});this._savedWidth=dojo.style(this._sizers[0],"width");this._savedHeight=dojo.style(this._contentPane,"maxHeight");this._sizers.style({width:_14+"px"});dojo.style(this._contentPane,{maxHeight:(_15-65)+"px",height:(_15-65)+"px"});this._showPointer("");this._unfollowMap();dojo.addClass(this.domNode,"esriPopupMaximized");this.onMaximize();},restore:function(){var map=this.map;if(!map||!this._maximized){return;}this._maximized=false;var max=this._maxButton;dojo.removeClass(max,"restore");dojo.addClass(max,"maximize");dojo.attr(max,"title",this._nls.NLS_maximize);dojo.style(this._contentPane,"height",null);this.resize(this._savedWidth,this._savedHeight);this._savedWidth=this._savedHeight=null;this.show(this._location);this._followMap();dojo.removeClass(this.domNode,"esriPopupMaximized");this.onRestore();},destroy:function(){if(this.map){this.unsetMap();}this.cleanup();if(this.isShowing){this.hide();}this.destroyDijits(this._title);this.destroyDijits(this._content);dojo.forEach(this._eventConnections,dojo.disconnect);dojo.destroy(this.domNode);this._sizers=this._contentPane=this._actionList=this._positioner=this._pointer=this._outerPointer=this._title=this._prevFeatureButton=this._nextFeatureButton=this._spinner=this._eventConnections=this._pagerScope=this._targetLocation=this._nls=this._maxButton=null;},selectNext:function(){this.select(this.selectedIndex+1);},selectPrevious:function(){this.select(this.selectedIndex-1);},setFeatures:function(){this.inherited(arguments);this._updateUI();},onSetFeatures:function(){},onClearFeatures:function(){this.setTitle("&nbsp;");this.setContent("&nbsp;");this._setPagerCallbacks(this);this._updateUI();this.hideHighlight();},onSelectionChange:function(){var ptr=this.selectedIndex;this._updateUI();if(ptr>=0){this.setContent(this.features[ptr].getContent());this.updateHighlight(this.map,this.features[ptr]);if(this.isShowing){this.showHighlight();}}},onDfdComplete:function(){this._updateUI();},onMaximize:function(){},onRestore:function(){},_setVisibility:function(_17){dojo.style(this.domNode,"visibility",_17?"visible":"hidden");},_followMap:function(){this._unfollowMap();var map=this.map;this._handles=[dojo.connect(map,"onPanStart",this,this._onPanStart),dojo.connect(map,"onPan",this,this._onPan),dojo.connect(map,"onZoomStart",this,this._onZoomStart),dojo.connect(map,"onExtentChange",this,this._onExtentChange)];},_unfollowMap:function(){var _18=this._handles;if(_18){dojo.forEach(_18,dojo.disconnect,dojo);this._handles=null;}},_onPanStart:function(){var _19=this.domNode.style;this._panOrigin={left:_19.left,top:_19.top,right:_19.right,bottom:_19.bottom};},_onPan:function(_1a,_1b){var _1c=this._panOrigin,dx=_1b.x,dy=_1b.y,_1d=_1c.left,top=_1c.top,_1e=_1c.right,_1f=_1c.bottom;if(_1d){_1d=(parseFloat(_1d)+dx)+"px";}if(top){top=(parseFloat(top)+dy)+"px";}if(_1e){_1e=(parseFloat(_1e)-dx)+"px";}if(_1f){_1f=(parseFloat(_1f)-dy)+"px";}dojo.style(this.domNode,{left:_1d,top:top,right:_1e,bottom:_1f});},_onZoomStart:function(){this._setVisibility(false);},_onExtentChange:function(_20,_21,_22){if(_22){this._setVisibility(true);this.show(this._targetLocation||this._location);}this._targetLocation=null;},_toggleSize:function(){if(this._maximized){this.restore();}else{this.maximize();}},_setPosition:function(_23){var _24=_23.x,_25=_23.y,_26=this.offsetX||0,_27=this.offsetY||0,_28=0,_29=0,_2a=dojo.position(this.map.container,true),_2b=_2a.w,_2c=_2a.h,_2d="Left",_2e="bottom",_2f=dojo.contentBox(this._positioner),_30=_2f.w/2,_31=_2f.h/2,_32=dojo.style(this._sizers[0],"height")+this._maxHeight+dojo.style(this._sizers[2],"height"),_33=_32/2,_34=0,_35=0,_36=_2b,_37=_2c,_38=_24,_39=_25;var _3a=dojo.getObject("dojo.window.getBox");if(_3a){_3a=_3a();_34=Math.max(_3a.l,_2a.x);_36=Math.min(_3a.l+_3a.w,_2a.x+_2a.w);_35=Math.max(_3a.t,_2a.y);_37=Math.min(_3a.t+_3a.h,_2a.y+_2a.h);_38+=_2a.x;_39+=_2a.y;}if(((_39-_35)>_33)&&((_37-_39)>=_33)){if((_36-_38)>=_2f.w){_2e="";_2d="Left";}else{if((_38-_34)>=_2f.w){_2e="";_2d="Right";}}}if(_2d&&_2e){if(((_38-_34)>_30)&&((_36-_38)>=_30)){if((_39-_35)>=_32){_2d="";_2e="bottom";}else{if((_37-_39)>=_32){_2d="";_2e="top";}}}}if(_2d&&_2e){if(_38<=_36/2){_2d="Left";}else{if(_38<=_36){_2d="Right";}}if(_39<=_37/2){_2e="top";}else{if(_39<=_37){_2e="bottom";}}}var _3b=_2e+_2d;switch(_3b){case "top":case "bottom":_29=14;break;case "Left":case "Right":_28=13;break;case "topLeft":case "topRight":case "bottomLeft":case "bottomRight":_29=45;break;}dojo.style(this.domNode,{left:_24+"px",top:_25+"px",right:null,bottom:null});var _3c={left:null,right:null,top:null,bottom:null};if(_2d){_3c[_2d.toLowerCase()]=(_28+_26)+"px";}else{_3c.left=(-_30)+"px";}if(_2e){_3c[_2e]=(_29+_27)+"px";}else{_3c.top=(-_31)+"px";}dojo.style(this._positioner,_3c);this._showPointer(_3b);},_showPointer:function(_3d){dojo.removeClass(this._pointer,["top","bottom","right","left","topLeft","topRight","bottomRight","bottomLeft","hidden"]);dojo.removeClass(this._outerPointer,["right","left","hidden"]);if(_3d==="Right"||_3d==="Left"){_3d=_3d.toLowerCase();dojo.addClass(this._outerPointer,_3d);}else{dojo.addClass(this._pointer,_3d);}},_setPagerCallbacks:function(_3e,_3f,_40){if(_3e===this&&(!this._pagerScope||this._pagerScope===this)){return;}if(_3e===this._pagerScope){return;}this._pagerScope=_3e;if(_3e===this){_3f=this.selectPrevious;_40=this.selectNext;}var _41=this._eventConnections;dojo.disconnect(_41[1]);dojo.disconnect(_41[2]);if(_3f){_41[1]=dojo.connect(this._prevFeatureButton,"onclick",_3e,_3f);}if(_40){_41[2]=dojo.connect(this._nextFeatureButton,"onclick",_3e,_40);}},_zoomToFeature:function(){var _42=this.features,ptr=this.selectedIndex,map=this.map;if(_42){var _43=_42[ptr].geometry,_44,_45,_46=0,_47;if(_43){switch(_43.type){case "point":_44=_43;break;case "multipoint":_44=_43.getPoint(0);_45=_43.getExtent();break;case "polyline":_44=_43.getPoint(0,0);_45=_43.getExtent();if(map._getFrameWidth()!==-1){dojo.forEach(_43.paths,function(_48){var _49={"paths":[_48,map.spatialReference]},_4a=new esri.geometry.Polyline(_49),_4b=_4a.getExtent(),_4c=Math.abs(_4b.ymax-_4b.ymin),_4d=Math.abs(_4b.xmax-_4b.xmin),_4e=(_4d>_4c)?_4d:_4c;if(_4e>_46){_46=_4e;_47=_4b;}});_47.spatialReference=_45.spatialReference;_45=_47;}break;case "polygon":_44=_43.getPoint(0,0);_45=_43.getExtent();if(map._getFrameWidth()!==-1){dojo.forEach(_43.rings,function(_4f){var _50={"rings":[_4f,map.spatialReference]},_51=new esri.geometry.Polygon(_50),_52=_51.getExtent(),_53=Math.abs(_52.ymax-_52.ymin),_54=Math.abs(_52.xmax-_52.xmin),_55=(_54>_53)?_54:_53;if(_55>_46){_46=_55;_47=_52;}});_47.spatialReference=_45.spatialReference;_45=_47;}break;}}if(!_44){_44=this._location;}if(!_45||!_45.intersects(this._location)){this._location=_44;}if(_45){map.setExtent(_45,true);}else{var _56=map.getNumLevels(),_57=map.getLevel(),_58=_56-1,_59=this.zoomFactor||1;if(_56>0){if(_57===_58){return;}var _5a=_57+_59;if(_5a>_58){_5a=_58;}map._scrollZoomHandler({value:(_5a-_57),mapPoint:_44},true);}else{map._scrollZoomHandler({value:(1/Math.pow(2,_59))*2,mapPoint:_44},true);}}}},_updateUI:function(){var _5b="&nbsp;",ptr=this.selectedIndex,_5c=this.features,_5d=this.deferreds,_5e=this._prevFeatureButton,_5f=this._nextFeatureButton,_60=this._spinner,_61=this._actionList,nls=this._nls;if(_5c&&_5c.length>1){if(nls.NLS_pagingInfo){_5b=esri.substitute({index:(ptr+1),total:_5c.length},nls.NLS_pagingInfo);}if(ptr===0){dojo.addClass(_5e,"hidden");}else{dojo.removeClass(_5e,"hidden");}if(ptr===_5c.length-1){dojo.addClass(_5f,"hidden");}else{dojo.removeClass(_5f,"hidden");}}else{dojo.addClass(_5e,"hidden");dojo.addClass(_5f,"hidden");}this.setTitle(_5b);if(_5d&&_5d.length){if(_5c){dojo.removeClass(_60,"hidden");}else{this.setContent("<div style='text-align: center;'>"+nls.NLS_searching+"...</div>");}}else{dojo.addClass(_60,"hidden");if(!_5c||!_5c.length){this.setContent("<div style='text-align: center;'>"+nls.NLS_noInfo+".</div>");}}if(_5c&&_5c.length){dojo.removeClass(_61,"hidden");}else{dojo.addClass(_61,"hidden");}}});dojo.declare("esri.dijit.PopupTemplate",[esri.PopupInfoTemplate],{chartTheme:"dojox.charting.themes.PlotKit.popup",constructor:function(_62,_63){dojo.mixin(this,_63);this.initialize(_62);this._nls=dojo.mixin({},esri.bundle.widgets.popup);},getTitle:function(_64){return this.info?this.getComponents(_64).title:"";},getContent:function(_65){return this.info?new esri.dijit._PopupRenderer({template:this,graphic:_65,chartTheme:this.chartTheme,_nls:this._nls},dojo.create("div")).domNode:"";}});dojo.declare("esri.dijit._PopupRenderer",[dijit._Widget,dijit._Templated],{templateString:"<div class='esriViewPopup'>"+"<div class='mainSection'>"+"<div class='header' dojoAttachPoint='_title'></div>"+"<div class='hzLine'></div>"+"<div dojoAttachPoint='_description'></div>"+"<div class='break'></div>"+"</div>"+"<div class='attachmentsSection hidden'>"+"<div>${_nls.NLS_attach}:</div>"+"<ul dojoAttachPoint='_attachmentsList'>"+"</ul>"+"<div class='break'></div>"+"</div>"+"<div class='mediaSection hidden'>"+"<div class='header' dojoAttachPoint='_mediaTitle'></div>"+"<div class='hzLine'></div>"+"<div class='caption' dojoAttachPoint='_mediaCaption'></div>"+"<div class='gallery' dojoAttachPoint='_gallery'>"+"<div class='mediaHandle prev' dojoAttachPoint='_prevMedia' dojoAttachEvent='onclick: _goToPrevMedia'></div>"+"<div class='mediaHandle next' dojoAttachPoint='_nextMedia' dojoAttachEvent='onclick: _goToNextMedia'></div>"+"<ul class='summary'>"+"<li class='image mediaCount hidden' dojoAttachPoint='_imageCount'>0</li>"+"<li class='image mediaIcon hidden'></li>"+"<li class='chart mediaCount hidden' dojoAttachPoint='_chartCount'>0</li>"+"<li class='chart mediaIcon hidden'></li>"+"</ul>"+"<div class='frame' dojoAttachPoint='_mediaFrame'></div>"+"</div>"+"</div>"+"<div class='editSummarySection hidden' dojoAttachPoint='_editSummarySection'>"+"<div class='break'></div>"+"<div class='break hidden' dojoAttachPoint='_mediaBreak'></div>"+"<div class='editSummary' dojoAttachPoint='_editSummary'></div>"+"</div>"+"</div>",startup:function(){this.inherited(arguments);var _66=this.template,_67=this.graphic,_68=_66.getComponents(_67),_69=_68.title,_6a=_68.description,_6b=_68.fields,_6c=_68.mediaInfos,_6d=this.domNode,nls=this._nls;this._prevMedia.title=nls.NLS_prevMedia;this._nextMedia.title=nls.NLS_nextMedia;dojo.attr(this._title,"innerHTML",_69);if(!_69){dojo.addClass(this._title,"hidden");}if(!_6a&&_6b){_6a="";dojo.forEach(_6b,function(row){_6a+=("<tr valign='top'>");_6a+=("<td class='attrName'>"+row[0]+"</td>");_6a+=("<td class='attrValue'>"+row[1].replace(/^\s*(https?:\/\/[^\s]+)\s*$/i,"<a target='_blank' href='$1' title='$1'>More info</a>")+"</td>");_6a+=("</tr>");});if(_6a){_6a="<table class='attrTable' cellpadding='0px' cellspacing='0px'>"+_6a+"</table>";}}dojo.attr(this._description,"innerHTML",_6a);if(!_6a){dojo.addClass(this._description,"hidden");}dojo.query("a",this._description).forEach(function(_6e){dojo.attr(_6e,"target","_blank");});if(_69&&_6a){dojo.query(".mainSection .hzLine",_6d).removeClass("hidden");}else{if(_69||_6a){dojo.query(".mainSection .hzLine",_6d).addClass("hidden");}else{dojo.query(".mainSection",_6d).addClass("hidden");}}var dfd=(this._dfd=_66.getAttachments(_67));if(dfd){dfd.addBoth(dojo.hitch(this,this._attListHandler,dfd));dojo.attr(this._attachmentsList,"innerHTML","<li>"+nls.NLS_searching+"...</li>");dojo.query(".attachmentsSection",_6d).removeClass("hidden");}if(_6c&&_6c.length){dojo.query(".mediaSection",_6d).removeClass("hidden");dojo.setSelectable(this._mediaFrame,false);this._mediaInfos=_6c;this._mediaPtr=0;this._updateUI();this._displayMedia();}if(_68.editSummary){dojo.attr(this._editSummary,"innerHTML",_68.editSummary);if(_6c&&_6c.length){dojo.removeClass(this._mediaBreak,"hidden");}dojo.removeClass(this._editSummarySection,"hidden");}},destroy:function(){if(this._dfd){this._dfd.cancel();}this._destroyFrame();this.template=this.graphic=this._nls=this._mediaInfos=this._mediaPtr=this._dfd=null;this.inherited(arguments);},_goToPrevMedia:function(){var ptr=this._mediaPtr-1;if(ptr<0){return;}this._mediaPtr--;this._updateUI();this._displayMedia();},_goToNextMedia:function(){var ptr=this._mediaPtr+1;if(ptr===this._mediaInfos.length){return;}this._mediaPtr++;this._updateUI();this._displayMedia();},_updateUI:function(){var _6f=this._mediaInfos,_70=_6f.length,_71=this.domNode,_72=this._prevMedia,_73=this._nextMedia;if(_70>1){var _74=0,_75=0;dojo.forEach(_6f,function(_76){if(_76.type==="image"){_74++;}else{if(_76.type.indexOf("chart")!==-1){_75++;}}});if(_74){dojo.attr(this._imageCount,"innerHTML",_74);dojo.query(".summary .image",_71).removeClass("hidden");}if(_75){dojo.attr(this._chartCount,"innerHTML",_75);dojo.query(".summary .chart",_71).removeClass("hidden");}}else{dojo.query(".summary",_71).addClass("hidden");dojo.addClass(_72,"hidden");dojo.addClass(_73,"hidden");}var ptr=this._mediaPtr;if(ptr===0){dojo.addClass(_72,"hidden");}else{dojo.removeClass(_72,"hidden");}if(ptr===_70-1){dojo.addClass(_73,"hidden");}else{dojo.removeClass(_73,"hidden");}this._destroyFrame();},_displayMedia:function(){var _77=this._mediaInfos[this._mediaPtr],_78=_77.title,_79=_77.caption,_7a=dojo.query(".mediaSection .hzLine",this.domNode)[0];dojo.attr(this._mediaTitle,"innerHTML",_78);dojo[_78?"removeClass":"addClass"](this._mediaTitle,"hidden");dojo.attr(this._mediaCaption,"innerHTML",_79);dojo[_79?"removeClass":"addClass"](this._mediaCaption,"hidden");dojo[(_78&&_79)?"removeClass":"addClass"](_7a,"hidden");if(_77.type==="image"){this._showImage(_77.value);}else{this._showChart(_77.type,_77.value);}},_showImage:function(_7b){dojo.addClass(this._mediaFrame,"image");var _7c=dojo.style(this._gallery,"height"),_7d="<img src='"+_7b.sourceURL+"' onload='esri.dijit._PopupRenderer.prototype._imageLoaded(this,"+_7c+");' />";if(_7b.linkURL){_7d="<a target='_blank' href='"+_7b.linkURL+"'>"+_7d+"</a>";}dojo.attr(this._mediaFrame,"innerHTML",_7d);},_showChart:function(_7e,_7f){dojo.removeClass(this._mediaFrame,"image");var _80=this._chart=new dojox.charting.Chart2D(dojo.create("div",{"class":"chart"},this._mediaFrame),{margins:{l:4,t:4,r:4,b:4}});var _81=_7f.theme||this.chartTheme||"PlotKit.popup";_80.setTheme(dojo.getObject(_81)||dojo.getObject("dojox.charting.themes."+_81));switch(_7e){case "piechart":_80.addPlot("default",{type:"Pie",labels:false});_80.addSeries("Series A",_7f.fields);break;case "linechart":_80.addPlot("default",{type:"Markers"});_80.addAxis("x",{min:0,majorTicks:false,minorTicks:false,majorLabels:false,minorLabels:false});_80.addAxis("y",{includeZero:true,vertical:true,fixUpper:"minor"});dojo.forEach(_7f.fields,function(_82,idx){_82.x=idx+1;});_80.addSeries("Series A",_7f.fields);break;case "columnchart":_80.addPlot("default",{type:"Columns",gap:3});_80.addAxis("y",{includeZero:true,vertical:true,fixUpper:"minor"});_80.addSeries("Series A",_7f.fields);break;case "barchart":_80.addPlot("default",{type:"Bars",gap:3});_80.addAxis("x",{includeZero:true,fixUpper:"minor",minorLabels:false});_80.addAxis("y",{vertical:true,majorTicks:false,minorTicks:false,majorLabels:false,minorLabels:false});_80.addSeries("Series A",_7f.fields);break;}this._action=new dojox.charting.action2d.Tooltip(_80);_80.render();},_destroyFrame:function(){if(this._chart){this._chart.destroy();this._chart=null;}if(this._action){this._action.destroy();this._action=null;}dojo.attr(this._mediaFrame,"innerHTML","");},_imageLoaded:function(img,_83){var _84=img.height;if(_84<_83){var _85=Math.round((_83-_84)/2);dojo.style(img,"marginTop",_85+"px");}},_attListHandler:function(dfd,_86){if(dfd===this._dfd){this._dfd=null;var _87="";if(!(_86 instanceof Error)&&_86&&_86.length){dojo.forEach(_86,function(_88){_87+=("<li>");_87+=("<a href='"+_88.url+"' target='_blank'>"+(_88.name||"[No name]")+"</a>");_87+=("</li>");});}dojo.attr(this._attachmentsList,"innerHTML",_87||"<li>"+this._nls.NLS_noAttach+"</li>");}}});}