/*
	Copyright (c) 2004-2007, 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/community/licensing.shtml
*/


dojo._xdResourceLoaded({depends:[["provide","dijit._base.popup"],["require","dijit._base.focus"],["require","dijit._base.place"],["require","dijit._base.window"]],defineResource:function(_1){if(!_1._hasResource["dijit._base.popup"]){_1._hasResource["dijit._base.popup"]=true;_1.provide("dijit._base.popup");_1.require("dijit._base.focus");_1.require("dijit._base.place");_1.require("dijit._base.window");dijit.popup=new function(){var _2=[],_3=1000,_4=1;this.open=function(_5){var _6=_5.popup,_7=_5.orient||{"BL":"TL","TL":"BL"},_8=_5.around,id=(_5.around&&_5.around.id)?(_5.around.id+"_dropdown"):("popup_"+_4++);if(!_5.submenu){this.closeAll();}var _a=_1.doc.createElement("div");_a.id=id;_a.className="dijitPopup";_a.style.zIndex=_3+_2.length;if(_5.parent){_a.dijitPopupParent=_5.parent.id;}_1.body().appendChild(_a);_6.domNode.style.display="";_a.appendChild(_6.domNode);var _b=new dijit.BackgroundIframe(_a);var _c=_8?dijit.placeOnScreenAroundElement(_a,_8,_7,_6.orient?_1.hitch(_6,"orient"):null):dijit.placeOnScreen(_a,_5,_7=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"]);var _d=[];_d.push(_1.connect(_a,"onkeypress",this,function(_e){if(_e.keyCode==_1.keys.ESCAPE){_5.onCancel();}}));if(_6.onCancel){_d.push(_1.connect(_6,"onCancel",null,_5.onCancel));}_d.push(_1.connect(_6,_6.onExecute?"onExecute":"onChange",null,function(){if(_2[0]&&_2[0].onExecute){_2[0].onExecute();}}));_2.push({wrapper:_a,iframe:_b,widget:_6,onExecute:_5.onExecute,onCancel:_5.onCancel,onClose:_5.onClose,handlers:_d});if(_6.onOpen){_6.onOpen(_c);}return _c;};this.close=function(){var _f=_2[_2.length-1].widget;if(_f.onClose){_f.onClose();}if(!_2.length){return;}var top=_2.pop();var _11=top.wrapper,_12=top.iframe,_f=top.widget,_13=top.onClose;_1.forEach(top.handlers,_1.disconnect);if(!_f||!_f.domNode){return;}_1.style(_f.domNode,"display","none");_1.body().appendChild(_f.domNode);_12.destroy();_1._destroyElement(_11);if(_13){_13();}};this.closeAll=function(){while(_2.length){this.close();}};this.closeTo=function(_14){while(_2.length&&_2[_2.length-1].widget.id!=_14.id){this.close();}};}();dijit._frames=new function(){var _15=[];this.pop=function(){var _16;if(_15.length){_16=_15.pop();_16.style.display="";}else{if(_1.isIE){var _17="<iframe src='javascript:\"\"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";_16=_1.doc.createElement(_17);}else{var _16=_1.doc.createElement("iframe");_16.src="javascript:\"\"";_16.className="dijitBackgroundIframe";}_16.tabIndex=-1;_1.body().appendChild(_16);}return _16;};this.push=function(_18){_18.style.display="";if(_1.isIE){_18.style.removeExpression("width");_18.style.removeExpression("height");}_15.push(_18);};}();if(_1.isIE&&_1.isIE<7){_1.addOnLoad(function(){var f=dijit._frames;_1.forEach([f.pop()],f.push);});}dijit.BackgroundIframe=function(_1a){if(!_1a.id){throw new Error("no id");}if((_1.isIE&&_1.isIE<7)||(_1.isFF&&_1.isFF<3&&_1.hasClass(_1.body(),"dijit_a11y"))){var _1b=dijit._frames.pop();_1a.appendChild(_1b);if(_1.isIE){_1b.style.setExpression("width","document.getElementById('"+_1a.id+"').offsetWidth");_1b.style.setExpression("height","document.getElementById('"+_1a.id+"').offsetHeight");}this.iframe=_1b;}};_1.extend(dijit.BackgroundIframe,{destroy:function(){if(this.iframe){dijit._frames.push(this.iframe);delete this.iframe;}}});}}});