/*
 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
 */
//>>built
define("esri/dijit/InfoWindowLite",["dojo/_base/declare","dojo/_base/lang","dojo/_base/connect","dojo/_base/array","dojo/_base/html","dojo/has","dojo/dom","dojo/dom-class","dojo/dom-construct","dojo/dom-geometry","dojo/dom-style","dijit/registry","esri/kernel","esri/domUtils","esri/InfoWindowBase"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f){var IWL=_1([_f],{declaredClass:"esri.dijit.InfoWindowLite",constructor:function(_10,_11){_2.mixin(this,_10);var _12=(this.domNode=_7.byId(_11));_12.id=this.id||_c.getUniqueId(this.declaredClass);_8.add(_12,"simpleInfoWindow");this._title=_9.create("div",{"class":"title"},_12);this._content=_9.create("div",{"class":"content"},_12);this._close=_9.create("div",{"class":"close"},_12);},domNode:null,anchor:"upperright",fixedAnchor:null,coords:null,isShowing:true,width:250,height:150,title:"Info Window",_bufferWidth:10,_bufferHeight:10,startup:function(){this._anchors=[IWL.ANCHOR_UPPERRIGHT,IWL.ANCHOR_LOWERRIGHT,IWL.ANCHOR_LOWERLEFT,IWL.ANCHOR_UPPERLEFT];this.resize(this.width,this.height);this.hide();this._closeConnect=_3.connect(this._close,"onclick",this,this.hide);},destroy:function(){if(this.isShowing){this.hide();}this.destroyDijits(this._title);this.destroyDijits(this._content);_3.disconnect(this._closeConnect);_9.destroy(this.domNode);this.domNode=this._title=this._content=this._anchors=this._closeConnect=null;},setTitle:function(_13){if(!_13){_8.add(this._title,"empty");}else{_8.remove(this._title,"empty");}this.destroyDijits(this._title);this.__setValue("_title",_13);return this;},setContent:function(_14){if(!_14){_8.add(this._title,"empty");}else{_8.remove(this._title,"empty");}this.destroyDijits(this._content);this.__setValue("_content",_14);return this;},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);},show:function(_16,_17){if(!_16){return;}if(_16.spatialReference){this.mapCoords=_16;_16=this.coords=this.map.toScreen(_16,true);}else{this.mapCoords=null;this.coords=_16;}if(!_17||_4.indexOf(this._anchors,_17)===-1){_17=this._getAnchor(_16);}_17=(this.anchor=this.fixedAnchor||_17);_e.show(this.domNode);this._adjustContentArea();this._adjustPosition(_16,_17);this.isShowing=true;if(!arguments[2]){this.onShow();}},hide:function(){_e.hide(this.domNode);this.isShowing=false;if(!arguments[1]){this.onHide();}},move:function(_18,_19){if(_19){_18=this.coords.offset(_18.x,_18.y);}else{this.coords=_18;if(this.mapCoords){this.mapCoords=this.map.toMap(_18);}}this._adjustPosition(_18,this.anchor);},resize:function(_1a,_1b){this.width=_1a;this.height=_1b;_b.set(this.domNode,{width:_1a+"px",height:_1b+"px"});_b.set(this._close,{left:(_1a-2)+"px",top:"-12px"});this._adjustContentArea();if(this.coords){this._adjustPosition(this.coords,this.anchor);}this.onResize(_1a,_1b);},onShow:function(){this.__registerMapListeners();this.startupDijits(this._title);this.startupDijits(this._content);},onHide:function(){this.__unregisterMapListeners();},onResize:function(){},onAnchorChange:function(){},setMap:function(map){this.inherited(arguments);_9.place(this.domNode,map.root);},_adjustContentArea:function(){var box=_a.getContentBox(this.domNode);var _1c=_5.coords(this._title);var _1d=_5.coords(this._content);var _1e=_a.getContentBox(this._content);var _1f=_1d.h-_1e.h;_b.set(this._content,{height:(box.h-_1c.h-_1f)+"px"});},_getAnchor:function(pt){var map=this.map;return (map&&pt)?(((pt.y<(map.height/2))?"lower":"upper")+((pt.x<(map.width/2))?"right":"left")):"upperright";},_adjustPosition:function(_20,_21){var _22=Math.round(_20.x),_23=Math.round(_20.y);var _24=this._bufferWidth,_25=this._bufferHeight;var _26=_5.coords(this.domNode);switch(_21){case IWL.ANCHOR_UPPERLEFT:_22-=(_26.w+_24);_23-=(_26.h+_25);break;case IWL.ANCHOR_UPPERRIGHT:_22+=_24;_23-=(_26.h+_25);break;case IWL.ANCHOR_LOWERRIGHT:_22+=_24;_23+=_25;break;case IWL.ANCHOR_LOWERLEFT:_22-=(_26.w+_24);_23+=_25;break;}_b.set(this.domNode,{left:_22+"px",top:_23+"px"});}});_2.mixin(IWL,{ANCHOR_UPPERRIGHT:"upperright",ANCHOR_LOWERRIGHT:"lowerright",ANCHOR_LOWERLEFT:"lowerleft",ANCHOR_UPPERLEFT:"upperleft"});if(_6("extend-esri")){_2.setObject("dijit.InfoWindowLite",IWL,_d);}return IWL;});