/* Copyright (c) 2004-2008, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing */ /* This is a compiled version of Dojo, built for deployment and not for development. To get an editable version, please visit: http://dojotoolkit.org for documentation and information on getting the source. */ if(!dojo._hasResource["dijit._base.focus"]){dojo._hasResource["dijit._base.focus"]=true;dojo.provide("dijit._base.focus");dojo.mixin(dijit,{_curFocus:null,_prevFocus:null,isCollapsed:function(){var _1=dojo.global;var _2=dojo.doc;if(_2.selection){return !_2.selection.createRange().text;}else{var _3=_1.getSelection();if(dojo.isString(_3)){return !_3;}else{return _3.isCollapsed||!_3.toString();}}},getBookmark:function(){var _4,_5=dojo.doc.selection;if(_5){var _6=_5.createRange();if(_5.type.toUpperCase()=="CONTROL"){if(_6.length){_4=[];var i=0,_8=_6.length;while(i<_8){_4.push(_6.item(i++));}}else{_4=null;}}else{_4=_6.getBookmark();}}else{if(window.getSelection){_5=dojo.global.getSelection();if(_5){_6=_5.getRangeAt(0);_4=_6.cloneRange();}}else{console.warn("No idea how to store the current selection for this browser!");}}return _4;},moveToBookmark:function(_9){var _a=dojo.doc;if(_a.selection){var _b;if(dojo.isArray(_9)){_b=_a.body.createControlRange();dojo.forEach(_9,"range.addElement(item)");}else{_b=_a.selection.createRange();_b.moveToBookmark(_9);}_b.select();}else{var _c=dojo.global.getSelection&&dojo.global.getSelection();if(_c&&_c.removeAllRanges){_c.removeAllRanges();_c.addRange(_9);}else{console.warn("No idea how to restore selection for this browser!");}}},getFocus:function(_d,_e){return {node:_d&&dojo.isDescendant(dijit._curFocus,_d.domNode)?dijit._prevFocus:dijit._curFocus,bookmark:!dojo.withGlobal(_e||dojo.global,dijit.isCollapsed)?dojo.withGlobal(_e||dojo.global,dijit.getBookmark):null,openedForWindow:_e};},focus:function(_f){if(!_f){return;}var _10="node" in _f?_f.node:_f,_11=_f.bookmark,_12=_f.openedForWindow;if(_10){var _13=(_10.tagName.toLowerCase()=="iframe")?_10.contentWindow:_10;if(_13&&_13.focus){try{_13.focus();}catch(e){}}dijit._onFocusNode(_10);}if(_11&&dojo.withGlobal(_12||dojo.global,dijit.isCollapsed)){if(_12){_12.focus();}try{dojo.withGlobal(_12||dojo.global,dijit.moveToBookmark,null,[_11]);}catch(e){}}},_activeStack:[],registerWin:function(_14){if(!_14){_14=window;}dojo.connect(_14.document,"onmousedown",function(evt){dijit._justMouseDowned=true;setTimeout(function(){dijit._justMouseDowned=false;},0);dijit._onTouchNode(evt.target||evt.srcElement);});var _16=_14.document.body||_14.document.getElementsByTagName("body")[0];if(_16){if(dojo.isIE){_16.attachEvent("onactivate",function(evt){if(evt.srcElement.tagName.toLowerCase()!="body"){dijit._onFocusNode(evt.srcElement);}});_16.attachEvent("ondeactivate",function(evt){dijit._onBlurNode(evt.srcElement);});}else{_16.addEventListener("focus",function(evt){dijit._onFocusNode(evt.target);},true);_16.addEventListener("blur",function(evt){dijit._onBlurNode(evt.target);},true);}}_16=null;},_onBlurNode:function(_1b){dijit._prevFocus=dijit._curFocus;dijit._curFocus=null;if(dijit._justMouseDowned){return;}if(dijit._clearActiveWidgetsTimer){clearTimeout(dijit._clearActiveWidgetsTimer);}dijit._clearActiveWidgetsTimer=setTimeout(function(){delete dijit._clearActiveWidgetsTimer;dijit._setStack([]);dijit._prevFocus=null;},100);},_onTouchNode:function(_1c){if(dijit._clearActiveWidgetsTimer){clearTimeout(dijit._clearActiveWidgetsTimer);delete dijit._clearActiveWidgetsTimer;}var _1d=[];try{while(_1c){if(_1c.dijitPopupParent){_1c=dijit.byId(_1c.dijitPopupParent).domNode;}else{if(_1c.tagName&&_1c.tagName.toLowerCase()=="body"){if(_1c===dojo.body()){break;}_1c=dijit.getDocumentWindow(_1c.ownerDocument).frameElement;}else{var id=_1c.getAttribute&&_1c.getAttribute("widgetId");if(id){_1d.unshift(id);}_1c=_1c.parentNode;}}}}catch(e){}dijit._setStack(_1d);},_onFocusNode:function(_1f){if(_1f&&_1f.tagName&&_1f.tagName.toLowerCase()=="body"){return;}dijit._onTouchNode(_1f);if(_1f==dijit._curFocus){return;}if(dijit._curFocus){dijit._prevFocus=dijit._curFocus;}dijit._curFocus=_1f;dojo.publish("focusNode",[_1f]);},_setStack:function(_20){var _21=dijit._activeStack;dijit._activeStack=_20;for(var _22=0;_22=_22;i--){var _24=dijit.byId(_21[i]);if(_24){_24._focused=false;_24._hasBeenBlurred=true;if(_24._onBlur){_24._onBlur();}if(_24._setStateClass){_24._setStateClass();}dojo.publish("widgetBlur",[_24]);}}for(i=_22;i<_20.length;i++){_24=dijit.byId(_20[i]);if(_24){_24._focused=true;if(_24._onFocus){_24._onFocus();}if(_24._setStateClass){_24._setStateClass();}dojo.publish("widgetFocus",[_24]);}}}});dojo.addOnLoad(dijit.registerWin);}if(!dojo._hasResource["dijit._base.manager"]){dojo._hasResource["dijit._base.manager"]=true;dojo.provide("dijit._base.manager");dojo.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};},add:function(_25){if(this._hash[_25.id]){throw new Error("Tried to register widget with id=="+_25.id+" but that id is already registered");}this._hash[_25.id]=_25;},remove:function(id){delete this._hash[id];},forEach:function(_27){for(var id in this._hash){_27(this._hash[id]);}},filter:function(_29){var res=new dijit.WidgetSet();this.forEach(function(_2b){if(_29(_2b)){res.add(_2b);}});return res;},byId:function(id){return this._hash[id];},byClass:function(cls){return this.filter(function(_2e){return _2e.declaredClass==cls;});}});dijit.registry=new dijit.WidgetSet();dijit._widgetTypeCtr={};dijit.getUniqueId=function(_2f){var id;do{id=_2f+"_"+(_2f in dijit._widgetTypeCtr?++dijit._widgetTypeCtr[_2f]:dijit._widgetTypeCtr[_2f]=0);}while(dijit.byId(id));return id;};if(dojo.isIE){dojo.addOnUnload(function(){dijit.registry.forEach(function(_31){_31.destroy();});});}dijit.byId=function(id){return (dojo.isString(id))?dijit.registry.byId(id):id;};dijit.byNode=function(_33){return dijit.registry.byId(_33.getAttribute("widgetId"));};dijit.getEnclosingWidget=function(_34){while(_34){if(_34.getAttribute&&_34.getAttribute("widgetId")){return dijit.registry.byId(_34.getAttribute("widgetId"));}_34=_34.parentNode;}return null;};dijit._tabElements={area:true,button:true,input:true,object:true,select:true,textarea:true};dijit._isElementShown=function(_35){var _36=dojo.style(_35);return (_36.visibility!="hidden")&&(_36.visibility!="collapsed")&&(_36.display!="none");};dijit.isTabNavigable=function(_37){if(dojo.hasAttr(_37,"disabled")){return false;}var _38=dojo.hasAttr(_37,"tabindex");var _39=dojo.attr(_37,"tabindex");if(_38&&_39>=0){return true;}var _3a=_37.nodeName.toLowerCase();if(((_3a=="a"&&dojo.hasAttr(_37,"href"))||dijit._tabElements[_3a])&&(!_38||_39>=0)){return true;}return false;};dijit._getTabNavigable=function(_3b){var _3c,_3d,_3e,_3f,_40,_41;var _42=function(_43){dojo.query("> *",_43).forEach(function(_44){var _45=dijit._isElementShown(_44);if(_45&&dijit.isTabNavigable(_44)){var _46=dojo.attr(_44,"tabindex");if(!dojo.hasAttr(_44,"tabindex")||_46==0){if(!_3c){_3c=_44;}_3d=_44;}else{if(_46>0){if(!_3e||_46<_3f){_3f=_46;_3e=_44;}if(!_40||_46>=_41){_41=_46;_40=_44;}}}}if(_45){_42(_44);}});};if(dijit._isElementShown(_3b)){_42(_3b);}return {first:_3c,last:_3d,lowest:_3e,highest:_40};};dijit.getFirstInTabbingOrder=function(_47){var _48=dijit._getTabNavigable(dojo.byId(_47));return _48.lowest?_48.lowest:_48.first;};dijit.getLastInTabbingOrder=function(_49){var _4a=dijit._getTabNavigable(dojo.byId(_49));return _4a.last?_4a.last:_4a.highest;};}if(!dojo._hasResource["dijit._base.place"]){dojo._hasResource["dijit._base.place"]=true;dojo.provide("dijit._base.place");dijit.getViewport=function(){var _4b=dojo.global;var _4c=dojo.doc;var w=0,h=0;var de=_4c.documentElement;var dew=de.clientWidth,deh=de.clientHeight;if(dojo.isMozilla){var _52,_53,_54,_55;var dbw=_4c.body.clientWidth;if(dbw>dew){_52=dew;_54=dbw;}else{_54=dew;_52=dbw;}var dbh=_4c.body.clientHeight;if(dbh>deh){_53=deh;_55=dbh;}else{_55=deh;_53=dbh;}w=(_54>_4b.innerWidth)?_52:_54;h=(_55>_4b.innerHeight)?_53:_55;}else{if(!dojo.isOpera&&_4b.innerWidth){w=_4b.innerWidth;h=_4b.innerHeight;}else{if(dojo.isIE&&de&&deh){w=dew;h=deh;}else{if(dojo.body().clientWidth){w=dojo.body().clientWidth;h=dojo.body().clientHeight;}}}}var _58=dojo._docScroll();return {w:w,h:h,l:_58.x,t:_58.y};};dijit.placeOnScreen=function(_59,pos,_5b,_5c){var _5d=dojo.map(_5b,function(_5e){return {corner:_5e,pos:pos};});return dijit._place(_59,_5d);};dijit._place=function(_5f,_60,_61){var _62=dijit.getViewport();if(!_5f.parentNode||String(_5f.parentNode.tagName).toLowerCase()!="body"){dojo.body().appendChild(_5f);}var _63=null;dojo.some(_60,function(_64){var _65=_64.corner;var pos=_64.pos;if(_61){_61(_5f,_64.aroundCorner,_65);}var _67=_5f.style;var _68=_67.display;var _69=_67.visibility;_67.visibility="hidden";_67.display="";var mb=dojo.marginBox(_5f);_67.display=_68;_67.visibility=_69;var _6b=(_65.charAt(1)=="L"?pos.x:Math.max(_62.l,pos.x-mb.w)),_6c=(_65.charAt(0)=="T"?pos.y:Math.max(_62.t,pos.y-mb.h)),_6d=(_65.charAt(1)=="L"?Math.min(_62.l+_62.w,_6b+mb.w):pos.x),_6e=(_65.charAt(0)=="T"?Math.min(_62.t+_62.h,_6c+mb.h):pos.y),_6f=_6d-_6b,_70=_6e-_6c,_71=(mb.w-_6f)+(mb.h-_70);if(_63==null||_71<_63.overflow){_63={corner:_65,aroundCorner:_64.aroundCorner,x:_6b,y:_6c,w:_6f,h:_70,overflow:_71};}return !_71;});_5f.style.left=_63.x+"px";_5f.style.top=_63.y+"px";if(_63.overflow&&_61){_61(_5f,_63.aroundCorner,_63.corner);}return _63;};dijit.placeOnScreenAroundElement=function(_72,_73,_74,_75){_73=dojo.byId(_73);var _76=_73.style.display;_73.style.display="";var _77=_73.offsetWidth;var _78=_73.offsetHeight;var _79=dojo.coords(_73,true);_73.style.display=_76;var _7a=[];for(var _7b in _74){_7a.push({aroundCorner:_7b,corner:_74[_7b],pos:{x:_79.x+(_7b.charAt(1)=="L"?0:_77),y:_79.y+(_7b.charAt(0)=="T"?0:_78)}});}return dijit._place(_72,_7a,_75);};}if(!dojo._hasResource["dijit._base.window"]){dojo._hasResource["dijit._base.window"]=true;dojo.provide("dijit._base.window");dijit.getDocumentWindow=function(doc){if(dojo.isSafari&&!doc._parentWindow){var fix=function(win){win.document._parentWindow=win;for(var i=0;i0&&_81[pi].parent===_81[pi-1].widget;pi--){}return _81[pi];};_8f.push(dojo.connect(_8b,"onkeypress",this,function(evt){if(evt.keyCode==dojo.keys.ESCAPE&&_86.onCancel){dojo.stopEvent(evt);_86.onCancel();}else{if(evt.keyCode==dojo.keys.TAB){dojo.stopEvent(evt);var _93=_90();if(_93&&_93.onCancel){_93.onCancel();}}}}));if(_87.onCancel){_8f.push(dojo.connect(_87,"onCancel",null,_86.onCancel));}_8f.push(dojo.connect(_87,_87.onExecute?"onExecute":"onChange",null,function(){var _94=_90();if(_94&&_94.onExecute){_94.onExecute();}}));_81.push({wrapper:_8b,iframe:_8d,widget:_87,parent:_86.parent,onExecute:_86.onExecute,onCancel:_86.onCancel,onClose:_86.onClose,handlers:_8f});if(_87.onOpen){_87.onOpen(_8e);}return _8e;};this.close=function(_95){while(dojo.some(_81,function(_96){return _96.widget==_95;})){var top=_81.pop(),_98=top.wrapper,_99=top.iframe,_9a=top.widget,_9b=top.onClose;if(_9a.onClose){_9a.onClose();}dojo.forEach(top.handlers,dojo.disconnect);if(!_9a||!_9a.domNode){return;}this.prepare(_9a.domNode);_99.destroy();dojo._destroyElement(_98);if(_9b){_9b();}}};}();dijit._frames=new function(){var _9c=[];this.pop=function(){var _9d;if(_9c.length){_9d=_9c.pop();_9d.style.display="";}else{if(dojo.isIE){var _9e="