/*
	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.place"]],defineResource:function(_1){if(!_1._hasResource["dijit._base.place"]){_1._hasResource["dijit._base.place"]=true;_1.provide("dijit._base.place");dijit.getViewport=function(){var _2=_1.global;var _3=_1.doc;var w=0,h=0;if(_1.isMozilla){w=_3.documentElement.clientWidth;h=_2.innerHeight;}else{if(!_1.isOpera&&_2.innerWidth){w=_2.innerWidth;h=_2.innerHeight;}else{if(_1.isIE&&_3.documentElement&&_3.documentElement.clientHeight){w=_3.documentElement.clientWidth;h=_3.documentElement.clientHeight;}else{if(_1.body().clientWidth){w=_1.body().clientWidth;h=_1.body().clientHeight;}}}}var _6=_1._docScroll();return {w:w,h:h,l:_6.x,t:_6.y};};dijit.placeOnScreen=function(_7,_8,_9,_a){var _b=_1.map(_9,function(_c){return {corner:_c,pos:_8};});return dijit._place(_7,_b);};dijit._place=function(_d,_e,_f){var _10=dijit.getViewport();if(!_d.parentNode||String(_d.parentNode.tagName).toLowerCase()!="body"){_1.body().appendChild(_d);}var _11=null;for(var i=0;i<_e.length;i++){var _13=_e[i].corner;var pos=_e[i].pos;if(_f){_f(_13);}var _15=_d.style.display;var _16=_d.style.visibility;_d.style.visibility="hidden";_d.style.display="";var mb=_1.marginBox(_d);_d.style.display=_15;_d.style.visibility=_16;var _18=(_13.charAt(1)=="L"?pos.x:Math.max(_10.l,pos.x-mb.w)),_19=(_13.charAt(0)=="T"?pos.y:Math.max(_10.t,pos.y-mb.h)),_1a=(_13.charAt(1)=="L"?Math.min(_10.l+_10.w,_18+mb.w):pos.x),_1b=(_13.charAt(0)=="T"?Math.min(_10.t+_10.h,_19+mb.h):pos.y),_1c=_1a-_18,_1d=_1b-_19,_1e=(mb.w-_1c)+(mb.h-_1d);if(_11==null||_1e<_11.overflow){_11={corner:_13,aroundCorner:_e[i].aroundCorner,x:_18,y:_19,w:_1c,h:_1d,overflow:_1e};}if(_1e==0){break;}}_d.style.left=_11.x+"px";_d.style.top=_11.y+"px";return _11;};dijit.placeOnScreenAroundElement=function(_1f,_20,_21,_22){_20=_1.byId(_20);var _23=_20.style.display;_20.style.display="";var _24=_20.offsetWidth;var _25=_20.offsetHeight;var _26=_1.coords(_20,true);_20.style.display=_23;var _27=[];for(var _28 in _21){_27.push({aroundCorner:_28,corner:_21[_28],pos:{x:_26.x+(_28.charAt(1)=="L"?0:_24),y:_26.y+(_28.charAt(0)=="T"?0:_25)}});}return dijit._place(_1f,_27,_22);};}}});
