/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.mobile.app.AlertDialog"],["require","dijit._WidgetBase"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.mobile.app.AlertDialog"]){_4._hasResource["dojox.mobile.app.AlertDialog"]=true;_4.provide("dojox.mobile.app.AlertDialog");_4.experimental("dojox.mobile.app.AlertDialog");_4.require("dijit._WidgetBase");_4.declare("dojox.mobile.app.AlertDialog",_5._WidgetBase,{title:"",text:"",controller:null,buttons:null,defaultButtonLabel:"OK",onChoose:null,constructor:function(){this.onClick=_4.hitch(this,this.onClick);this._handleSelect=_4.hitch(this,this._handleSelect);},buildRendering:function(){this.domNode=_4.create("div",{"class":"alertDialog"});var _7=_4.create("div",{"class":"alertDialogBody"},this.domNode);_4.create("div",{"class":"alertTitle",innerHTML:this.title||""},_7);_4.create("div",{"class":"alertText",innerHTML:this.text||""},_7);var _8=_4.create("div",{"class":"alertBtns"},_7);if(!this.buttons||this.buttons.length==0){this.buttons=[{label:this.defaultButtonLabel,value:"ok","class":"affirmative"}];}var _9=this;_4.forEach(this.buttons,function(_a){var _b=new _6.mobile.Button({btnClass:_a["class"]||"",label:_a.label});_b._dialogValue=_a.value;_4.place(_b.domNode,_8);_9.connect(_b,"onClick",_9._handleSelect);});var _c=this.controller.getWindowSize();this.mask=_4.create("div",{"class":"dialogUnderlayWrapper",innerHTML:"<div class=\"dialogUnderlay\"></div>",style:{width:_c.w+"px",height:_c.h+"px"}},this.controller.assistant.domNode);this.connect(this.mask,"onclick",function(){_9.onChoose&&_9.onChoose();_9.hide();});},postCreate:function(){this.subscribe("/dojox/mobile/app/goback",this._handleSelect);},_handleSelect:function(_d){var _e;console.log("handleSelect");if(_d&&_d.target){_e=_d.target;while(!_5.byNode(_e)){_e-_e.parentNode;}}if(this.onChoose){this.onChoose(_e?_5.byNode(_e)._dialogValue:undefined);}this.hide();},show:function(){this._doTransition(1);},hide:function(){this._doTransition(-1);},_doTransition:function(_f){var _10;var h=_4.marginBox(this.domNode.firstChild).h;var _11=this.controller.getWindowSize().h;console.log("dialog height = "+h," body height = "+_11);var _12=_11-h;var low=_11;var _13=_4.fx.slideTo({node:this.domNode,duration:400,top:{start:_f<0?_12:low,end:_f<0?low:_12}});var _14=_4[_f<0?"fadeOut":"fadeIn"]({node:this.mask,duration:400});var _10=_4.fx.combine([_13,_14]);var _15=this;_4.connect(_10,"onEnd",this,function(){if(_f<0){_15.domNode.style.display="none";_4.destroy(_15.domNode);_4.destroy(_15.mask);}});_10.play();},destroy:function(){this.inherited(arguments);_4.destroy(this.mask);},onClick:function(){}});}}};});