/*
	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/book/dojo-book-0-9/introduction/licensing
*/


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