/*
 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.InfoWindow"],["require","dijit._Widget"],["require","dijit._Templated"],["require","dijit._Container"],["require","esri.InfoWindowBase"],["require","esri.utils"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri.dijit.InfoWindow"]){_4._hasResource["esri.dijit.InfoWindow"]=true;_4.provide("esri.dijit.InfoWindow");_4.require("dijit._Widget");_4.require("dijit._Templated");_4.require("dijit._Container");_4.require("esri.InfoWindowBase");_4.require("esri.utils");_4.declare("esri.dijit.InfoWindow",[_5._Widget,_5._Templated,_5._Container,esri.InfoWindowBase],{isContainer:true,templateString:"<div id=\"${id}.infowindow\" class=\"infowindow\" dojoAttachPoint=\"_infowindow\"\r\n  ><div style=\"position:relative;\"\r\n    ><div class=\"window\" dojoAttachPoint=\"_window\"\r\n      ><div class=\"top\"\r\n        ><div class=\"left\" dojoAttachPoint=\"_topleft\"><div class=\"sprite\"></div></div\r\n    \t\t><div class=\"right\" dojoAttachPoint=\"_topright\"\r\n    \t\t\t><div class=\"sprite\"></div\r\n    \t\t\t><div class=\"user\" dojoAttachPoint=\"_user\"\r\n    \t\t\t  ><div class=\"titlebar\" dojoAttachPoint=\"_titlebar\"\r\n    \t\t\t    ><a class=\"hide\" dojoAttachPoint=\"_hide\" dojoAttachEvent=\"onclick:hide\"><div class=\"sprite\"></div></a\r\n              ><div class=\"title\" dojoAttachPoint=\"_title\">${title}</div\r\n    \t\t\t  ></div\r\n            ><div class=\"border\" dojoAttachPoint=\"_border\"></div\r\n    \t\t\t  ><div class=\"layout content\" dojoAttachPoint=\"_content, containerNode\"\r\n    \t\t\t  ></div\r\n    \t\t\t></div\r\n    \t\t></div\r\n        ><div class=\"bottom\"\r\n          ><div class=\"left\" dojoAttachPoint=\"_bottomleft\"><div class=\"sprite\"></div></div\r\n\t\t      ><div class=\"right\" dojoAttachPoint=\"_bottomright\"><div class=\"sprite\"></div></div\r\n        ></div\r\n      ></div\r\n    ></div\r\n    ><div class=\"pointer\" dojoAttachPoint=\"_pointer\"><div dojoAttachPoint=\"_sprite\" class=\"sprite\"></div></div\r\n  ></div\r\n></div>\r\n",anchor:"upperright",fixedAnchor:null,coords:null,isShowing:true,isContentShowing:true,isTitleBarShowing:true,width:250,height:150,title:"Info Window",startup:function(){if(this._started){return;}this.inherited(arguments);this._ANCHORS=[esri.dijit.InfoWindow.ANCHOR_UPPERRIGHT,esri.dijit.InfoWindow.ANCHOR_LOWERRIGHT,esri.dijit.InfoWindow.ANCHOR_LOWERLEFT,esri.dijit.InfoWindow.ANCHOR_UPPERLEFT];if(_4.isIE<7){var _7=_4.getComputedStyle(this._sprite).backgroundImage.replace(/url\(\"/i,"").replace(/\"\)/,""),_8="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='"+_7+"')";var s=_4.create("div",null,_4.body());_4.style(s,{width:"1px",height:"1px",display:"none",backgroundImage:"none",filter:_8});var t=setTimeout(function(){_4.destroy(s);clearTimeout(t);t=s=null;},100);_4.query(".sprite",this.domNode).forEach(function(n){n.style.backgroundImage="none";n.style.filter=_8;});}this.resize(this.width,this.height);this.hide();},destroy:function(){if(this._destroyed){return;}this.__unregisterMapListeners();this.destroyDijits(this._title);this.destroyDijits(this._content);this._title.innerHTML=this._content.innerHTML="";this.inherited(arguments);},resize:function(_9,_a){if(!_9||!_a){return;}var _b=_4.style;_b(this._topleft,{height:_a+"px",marginLeft:_9+"px"});_b(this._topright,{width:_9+"px",height:_a+"px"});_b(this._user,"width",(_9-8)+"px");_b(this._hide,"marginLeft",(_9-22)+"px");_b(this._title,"width",(_9-25)+"px");_b(this._content,"height",(_a-37)+"px");_b(this._bottomleft,{marginLeft:_9+"px",marginTop:_a+"px"});_b(this._bottomright,{width:(_9-5)+"px",marginTop:_a+"px"});this.width=_9;this.height=_a;if(this.coords){this._adjustPosition(this.coords,this.anchor);}this.onResize(_9,_a);},_adjustPosition:function(_c,_d){var _e=_4.style;_e(this._infowindow,{left:Math.round(_c.x)+"px",top:Math.round(_c.y)+"px"});if(_d===esri.dijit.InfoWindow.ANCHOR_UPPERLEFT){_e(this._window,{left:null,right:(this.width+18)+"px",top:null,bottom:(this.height+50)+"px"});}else{if(_d===esri.dijit.InfoWindow.ANCHOR_UPPERRIGHT){_e(this._window,{left:"6px",right:null,top:null,bottom:(this.height+50)+"px"});}else{if(_d===esri.dijit.InfoWindow.ANCHOR_LOWERRIGHT){_e(this._window,{left:"6px",right:null,top:"43px",bottom:null});}else{if(_d===esri.dijit.InfoWindow.ANCHOR_LOWERLEFT){_e(this._window,{left:null,right:(this.width+18)+"px",top:"43px",bottom:null});}}}}},show:function(_f,_10){if(!_f){return;}if(_f.spatialReference){this.mapCoords=_f;_f=this.coords=this.map.toScreen(_f,true);}else{this.mapCoords=null;this.coords=_f;}var _11=this.map._getFrameWidth();if(_11!==-1){_f.x=_f.x%_11;if(_f.x<0){_f.x+=_11;}if(this.map.width>_11){var _12=(this.map.width-_11)/2;while(_f.x<_12){_f.x+=_11;}}}if(!_10||_4.indexOf(this._ANCHORS,_10)===-1){_10=this.map.getInfoWindowAnchor(_f);}_4.removeClass(this._pointer,this.anchor);_10=(this.anchor=this.fixedAnchor||_10);this._adjustPosition(_f,_10);_4.addClass(this._pointer,_10);esri.show(this.domNode);this.isShowing=true;if(!arguments[2]){this.onShow();}},hide:function(evt){esri.hide(this.domNode);this.isShowing=false;if(!arguments[1]){this.onHide();}},showTitleBar:function(){esri.show(this._titlebar);esri.show(this._border);this.isTitleBarShowing=true;},hideTitleBar:function(){esri.hide(this._titlebar);esri.hide(this._border);this.isTitleBarShowing=false;},showContent:function(){esri.show(this._content);esri.show(this._border);this.isContentShowing=true;},hideContent:function(){esri.hide(this._content);esri.hide(this._border);this.isContentShowing=false;},move:function(_13,_14){if(_14){_13=this.coords.offset(_13.x,_13.y);}else{this.coords=_13;if(this.mapCoords){this.mapCoords=this.map.toMap(_13);}}_4.style(this._infowindow,{left:Math.round(_13.x)+"px",top:Math.round(_13.y)+"px"});},setFixedAnchor:function(_15){if(_15&&_4.indexOf(this._ANCHORS,_15)===-1){return;}this.fixedAnchor=_15;if(this.isShowing){this.show(this.mapCoords||this.coords,_15);}this.onAnchorChange(_15);},setTitle:function(_16){this.destroyDijits(this._title);this.__setValue("_title",_16);return this;},setContent:function(_17){this.destroyDijits(this._content);this.__setValue("_content",_17);return this;},onShow:function(){this.__registerMapListeners();this.startupDijits(this._title);this.startupDijits(this._content);},onHide:function(){this.__unregisterMapListeners();},onResize:function(){},onAnchorChange:function(){}});_4.mixin(esri.dijit.InfoWindow,{ANCHOR_UPPERRIGHT:"upperright",ANCHOR_LOWERRIGHT:"lowerright",ANCHOR_LOWERLEFT:"lowerleft",ANCHOR_UPPERLEFT:"upperleft"});}}};});