/*
	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.ListSelector"],["require","dojox.mobile.app._Widget"],["require","dojo.fx"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.mobile.app.ListSelector"]){_4._hasResource["dojox.mobile.app.ListSelector"]=true;_4.provide("dojox.mobile.app.ListSelector");_4.experimental("dojox.mobile.app.ListSelector");_4.require("dojox.mobile.app._Widget");_4.require("dojo.fx");_4.declare("dojox.mobile.app.ListSelector",_6.mobile.app._Widget,{data:null,controller:null,onChoose:null,destroyOnHide:false,_setDataAttr:function(_7){this.data=_7;if(this.data){this.render();}},postCreate:function(){_4.addClass(this.domNode,"listSelector");var _8=this;this.connect(this.domNode,"onclick",function(_9){if(!_4.hasClass(_9.target,"listSelectorRow")){return;}if(_8.onChoose){_8.onChoose(_8.data[_9.target._idx].value);}_8.hide();});this.connect(this.domNode,"onmousedown",function(_a){if(!_4.hasClass(_a.target,"listSelectorRow")){return;}_4.addClass(_a.target,"listSelectorRow-selected");});this.connect(this.domNode,"onmouseup",function(_b){if(!_4.hasClass(_b.target,"listSelectorRow")){return;}_4.removeClass(_b.target,"listSelectorRow-selected");});this.connect(this.domNode,"onmouseout",function(_c){if(!_4.hasClass(_c.target,"listSelectorRow")){return;}_4.removeClass(_c.target,"listSelectorRow-selected");});var _d=this.controller.getWindowSize();this.mask=_4.create("div",{"class":"dialogUnderlayWrapper",innerHTML:"<div class=\"dialogUnderlay\"></div>"},this.controller.assistant.domNode);this.connect(this.mask,"onclick",function(){_8.onChoose&&_8.onChoose();_8.hide();});},show:function(_e){var _f;var _10=this.controller.getWindowSize();var _11;if(_e){_11=_4._abs(_e);_f=_11;}else{_f.x=_10.w/2;_f.y=200;}console.log("startPos = ",_f);_4.style(this.domNode,{opacity:0,display:"",width:Math.floor(_10.w*0.8)+"px"});var _12=0;_4.query(">",this.domNode).forEach(function(_13){_4.style(_13,{"float":"left"});_12=Math.max(_12,_4.marginBox(_13).w);_4.style(_13,{"float":"none"});});_12=Math.min(_12,Math.round(_10.w*0.8))+_4.style(this.domNode,"paddingLeft")+_4.style(this.domNode,"paddingRight")+1;_4.style(this.domNode,"width",_12+"px");var _14=_4.marginBox(this.domNode).h;var _15=this;var _16=_11?Math.max(30,_11.y-_14-10):this.getScroll().y+30;console.log("fromNodePos = ",_11," targetHeight = ",_14," targetY = "+_16," startPos ",_f);var _17=_4.animateProperty({node:this.domNode,duration:400,properties:{width:{start:1,end:_12},height:{start:1,end:_14},top:{start:_f.y,end:_16},left:{start:_f.x,end:(_10.w/2-_12/2)},opacity:{start:0,end:1},fontSize:{start:1}},onEnd:function(){_4.style(_15.domNode,"width","inherit");}});var _18=_4.fadeIn({node:this.mask,duration:400});_4.fx.combine([_17,_18]).play();},hide:function(){var _19=this;var _1a=_4.animateProperty({node:this.domNode,duration:500,properties:{width:{end:1},height:{end:1},opacity:{end:0},fontSize:{end:1}},onEnd:function(){if(_19.get("destroyOnHide")){_19.destroy();}}});var _1b=_4.fadeOut({node:this.mask,duration:400});_4.fx.combine([_1a,_1b]).play();},render:function(){_4.empty(this.domNode);_4.style(this.domNode,"opacity",0);var row;for(var i=0;i<this.data.length;i++){row=_4.create("div",{"class":"listSelectorRow "+(this.data[i].className||""),innerHTML:this.data[i].label},this.domNode);row._idx=i;if(i==0){_4.addClass(row,"first");}if(i==this.data.length-1){_4.addClass(row,"last");}}},destroy:function(){this.inherited(arguments);_4.destroy(this.mask);}});}}};});