/*
 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
 */

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