/*
	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.TabBar"],["require","dojox.mobile"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.mobile.TabBar"]){_4._hasResource["dojox.mobile.TabBar"]=true;_4.provide("dojox.mobile.TabBar");_4.require("dojox.mobile");_4.declare("dojox.mobile.TabBar",_5._WidgetBase,{iconBase:"",iconPos:"",barType:"tabBar",inHeading:false,_fixedButtonWidth:76,_fixedButtonMargin:17,_largeScreenWidth:500,buildRendering:function(){this._clsName=this.barType=="segmentedControl"?"mblTabButton":"mblTabBarButton";this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("H1");this.domNode.className=this.barType=="segmentedControl"?"mblTabPanelHeader":"mblTabBar";},postCreate:function(){if(_4.global.onorientationchange!==undefined){this.connect(_4.global,"onorientationchange","onResize");}else{this.connect(_4.global,"onresize","onResize");}},startup:function(){var _7=this;setTimeout(function(){_7.onResize();},0);},onResize:function(){var i;var w=_4.marginBox(this.domNode.parentNode).w;var bw=this._fixedButtonWidth;var bm=this._fixedButtonMargin;var _8=this.containerNode.childNodes;var _9=[];for(i=0;i<_8.length;i++){var c=_8[i];if(c.nodeType!=1){continue;}if(_4.hasClass(c,this._clsName)){_9.push(c);}}var _a;if(this.barType=="segmentedControl"){_a=w;var _b=0;for(i=0;i<_9.length;i++){_a-=_4.marginBox(_9[i]).w;_9[i].style.marginTop="3px";_b+=_9[i].offsetWidth;}_a=Math.floor(_a/2);var _c=_5.getEnclosingWidget(this.domNode.parentNode);var _d=this.inHeading||_c instanceof _6.mobile.Heading;this.containerNode.style.padding="3px 0px 0px "+(_d?0:_a)+"px";if(_d){_4.style(this.domNode,{background:"none",border:"none",width:_b+2+"px"});}}else{_a=Math.floor((w-(bw+bm*2)*_9.length)/2);if(w<this._largeScreenWidth||_a<0){for(i=0;i<_9.length;i++){_9[i].style.width=Math.round(98/_9.length)+"%";_9[i].style.margin="0px";}this.containerNode.style.padding="0px 0px 0px 1%";}else{for(i=0;i<_9.length;i++){_9[i].style.width=bw+"px";_9[i].style.margin="0 "+bm+"px";}this.containerNode.style.padding="0px 0px 0px "+_a+"px";}}}});_4.declare("dojox.mobile.TabBarButton",_6.mobile.AbstractItem,{icon1:"",icon2:"",iconPos1:"",iconPos2:"",selected:false,transition:"none",tag:"LI",selectOne:true,inheritParams:function(){var _e=this.getParentWidget();this.parent=_e;if(_e){if(!this.transition){this.transition=_e.transition;}if(!this.icon1){this.icon1=_e.iconBase;}if(!this.iconPos1){this.iconPos1=_e.iconPos;}if(!this.icon2){this.icon2=_e.iconBase||this.icon1;}if(!this.iconPos2){this.iconPos2=_e.iconPos||this.iconPos1;}}},buildRendering:function(){this.inheritParams();this.anchorNode=_4.create("A",{className:"mblTabBarButtonAnchor"});var a=this.anchorNode;this.connect(a,"onclick","onClick");var _f=_4.create("DIV",{className:"mblTabBarButtonDiv"},a);var _10=_4.create("DIV",{className:"mblTabBarButtonDiv mblTabBarButtonDivInner"},_f);this.img1=_4.create("IMG",{className:"mblTabBarButtonIcon",src:this.icon1},_10);this.img1.style.visibility=this.selected?"hidden":"";_6.mobile.setupIcon(this.img1,this.iconPos1);this.img1.onload=function(){this.style.width=this.width+"px";this.style.height=this.height+"px";};this.img2=_4.create("IMG",{className:"mblTabBarButtonIcon",src:this.icon2},_10);this.img2.style.visibility=this.selected?"":"hidden";_6.mobile.setupIcon(this.img2,this.iconPos2);this.img2.onload=function(){this.style.width=this.width+"px";this.style.height=this.height+"px";};this.box=_4.create("DIV",{className:"mblTabBarButtonTextBox"},a);var box=this.box;var r=this.srcNodeRef;if(r){for(var i=0,len=r.childNodes.length;i<len;i++){box.appendChild(r.firstChild);}}if(this.label){box.appendChild(_4.doc.createTextNode(this.label));}this.domNode=this.srcNodeRef||_4.create(this.tag);this.containerNode=this.domNode;var _11=this.parent?this.parent._clsName:"mblTabBarButton";_4.addClass(this.domNode,_11+(this.selected?" mblTabButtonSelected":""));this.domNode.appendChild(a);this.createDomButton(this.domNode,a);},startup:function(){var _12=this.getParentWidget();this.parent=_12;if(_12&&_12.barType=="segmentedControl"){_4.removeClass(this.domNode,"mblTabBarButton");_4.addClass(this.domNode,_12._clsName);this.box.className="";}},select:function(_13){if(_13){this.selected=false;_4.removeClass(this.domNode,"mblTabButtonSelected");}else{this.selected=true;_4.addClass(this.domNode,"mblTabButtonSelected");for(var i=0,c=this.domNode.parentNode.childNodes;i<c.length;i++){if(c[i].nodeType!=1){continue;}var w=_5.byNode(c[i]);if(w&&w!=this){w.select(true);}}}this.img1.style.visibility=this.selected?"hidden":"";this.img2.style.visibility=this.selected?"":"hidden";},onClick:function(e){this.defaultClickAction();}});}}};});