/* Copyright Richard Cornford 2004 */
function clear(){
  document.msg.clear;	
}
var finalizeMe = (function(){
	var global = this,base,safe = false,svType = (global.addEventListener && 2)||(global.attachEvent && 3)|| 0;
	function addFnc(next, f){function t(ev){if(next)next(ev);f(ev);};t.addItem = function(d){if(f != d.getFunc()){if(next){next.addItem(d);}else{next = d;}}return this;};t.remove = function(d){if(f == d){f = null;return next;}else if(next){next = next.remove(d);}return this;};t.getFunc = function(){return f;};t.finalize = function(){if(next)next = next.finalize();return (f = null);};return t;};
	function addFunction(f){if(base){base = base.addItem(addFnc(null, f));}else{base = addFnc(null, f);}};
	function ulQue(f){addFunction(f);if(!safe){switch(svType){case 2:global.addEventListener("unload", base, false);safe = true;break;case 3:global.attachEvent("onunload", base);safe = true;break;default:if(global.onunload != base){if(global.onunload)addFunction(global.onunload);global.onunload = base;}break;}}};
	ulQue.remove = function(f){if(base)base.remove(f);};
	function finalize(){if(base){base.finalize();switch(svType){case 3:global.detachEvent("onunload", base);break;case 2:global.removeEventListener("unload", base, false);break;default:global.onunload = null;break;}base = null;}safe = false;};
	ulQue(finalize);return ulQue;
})();


var InitializeMe = (function(){
	var global = this,base = null,safe = false;
	var listenerType = (global.addEventListener && 2)||(global.attachEvent && 3)|| 0;
	function getStackFunc(next, funcRef, arg1,arg2,arg3,arg4){function l(ev){funcRef((ev?ev:global.event), arg1,arg2,arg3,arg4);if(next)next = next(ev);return (funcRef = null);};l.addItem = function(d){if(next){next.addItem(d);}else{next = d;}};return l;};
	return (function(funcRef, arg1,arg2,arg3,arg4){if(base){base.addItem(getStackFunc(null, funcRef, arg1,arg2,arg3,arg4));}else{base = getStackFunc(null, funcRef, arg1,arg2,arg3,arg4);}if(!safe){switch(listenerType){case 2:global.addEventListener("load", base, false);safe = true;break;case 3:global.attachEvent("onload", base);safe = true;break;default:if(global.onload != base){if(global.onload){base.addItem(getStackFunc(null, global.onload));}global.onload = base;}break;}}});
})();

var queryStrings = (function(out){
    if(typeof location != 'undefined'){
        var temp = location.search||location.href||'';
        var nvp, ofSet;
        if((ofSet = temp.indexOf('?')) > -1){
            temp = temp.split("#")[0];
            temp = temp.substring((ofSet+1), temp.length);
            var workAr = temp.split('&');
            for(var c = workAr.length;c--;){
                nvp = workAr[c].split('=');
                if(nvp.length > 1){out[nvp[0]] = nvp[1];}
            }
        }
    }
    return out;
})({});

var TimedQue = (function(){
	var base, timer;
	var interval = 60;
	var newFncs = null;
	function addFnc(next, f){function t(){next = next&&next();if(f()){return t;}else{f = null;return next;}}t.addItem = function(d){if(next){next.addItem(d);}else{next = d;}return this;};t.finalize = function(){return ((next)&&(next = next.finalize())||(f = null));};return t;}
	function tmQue(fc){if(newFncs){newFncs = newFncs.addItem(addFnc(null, fc));}else{newFncs = addFnc(null, fc);}if(!timer){timer = setTimeout(tmQue.act, interval);}}
	tmQue.act = function(){var fn = newFncs, strt = new Date().getTime();if(fn){newFncs = null;if(base){base.addItem(fn);}else{base = fn;}}base = base&&base();if(base||newFncs){var t = interval - (new Date().getTime() - strt);timer = setTimeout(tmQue.act, ((t > 0)?t:1));}else{timer = null;}};
	tmQue.act.toString = function(){return 'TimedQue.act()';};
	tmQue.finalize = function(){timer = timer&&clearTimeout(timer);base = base&&base.finalize();newFncs = [];};
	return tmQue;
})();

function compatModeTest(obj){
	if((document.compatMode)&&(document.compatMode.indexOf('CSS') != -1)&&(document.documentElement)){return document.documentElement;}else if(document.body){return document.body;}else{return obj;}
}

function MoveFollow(){
	var global = this;
	var theOne = {
		getPageX:function(){return (readScroll.scrollLeft|0) - (readScroll.clientLeft|0) + x;},
		getPageY:function(){return (readScroll.scrollTop|0) - (readScroll.clientTop|0) + y;},
		getTarget:function(){return lastTarget;},
		upDate:function(ev){mm(ev);}
	};
	var x = 0, y = 0;
	var lastTarget = null;
	var readScroll = {scrollTop:0,scrollLeft:0,clientLeft:0,clientTop:0};
	var posReadX = 'pageX';
	var posReadY = 'pageY';
	function mm(e){e = e||global.event;x = e[posReadX];y = e[posReadY];lastTarget = e.target||e.srcElement;}
	function initEvent(ev){ev = ev||global.event;if(ev){if(typeof ev.pageX != 'number'){posReadX = 'clientX';posReadY = 'clientY';if(!global.opera){readScroll = compatModeTest(readScroll);}} setUpOnMouse(mm);mm(ev);}else{setUpOnMouse(initEvent);}}
    function setUpOnMouse(f){if(document.onmousemove != f){document.onmousemove = f;}}
	initEvent();
	return (MoveFollow = function(){return theOne;})();
};

var getElementWithId = (function(){if(document.getElementById){return (function(id){return document.getElementById(id);});}else if(document.all){return (function(id){return document.all[id];});}return (function(id){return null;});})();

function getSimpleExtPxIn(el){
	var temp, temp2, tick = 0, getBorders = retFalse, doCompStyle = retFalse,defaultView,objList = [];
	function retFalse(){return false;}
	retFalse.elTest = retFalse;
	retFalse.iY = retFalse.iX = retFalse.y = retFalse.x = retFalse.w = retFalse.h = retFalse.bb = retFalse.bt = retFalse.bl = retFalse.br = 0;
	function retThis(){return retThis;}
	function gCompStyleBorders(p, el){doCompStyle(p, defaultView.getComputedStyle(el, '' ));}
	function doComputedStyleFloat(p, cs){p.bt = (cs.getPropertyCSSValue('border-top-width').getFloatValue(5));p.bl = (cs.getPropertyCSSValue('border-left-width').getFloatValue(5));p.br = (cs.getPropertyCSSValue('border-right-width').getFloatValue(5));p.bb = (cs.getPropertyCSSValue('border-bottom-width').getFloatValue(5));}
	function doComputedStyleValue(p, cs){p.bt = Math.ceil(parseFloat(s.getPropertyValue('border-top-width')))|0;p.bl = Math.ceil(parseFloat(s.getPropertyValue('border-left-width')))|0;p.br = Math.ceil(parseFloat(s.getPropertyValue('border-right-width')))|0;p.bb = Math.ceil(parseFloat(s.getPropertyValue('border-bottom-width')))|0;}
	function gClientBorders(p, el){if(el.clientWidth||el.clientHeight){p.bb = (el.offsetHeight - (el.clientHeight + (p.bt = el.clientTop|0)))|0;p.br = (el.offsetWidth - (el.clientWidth + (p.bl = el.clientLeft|0)))|0;}}
	function getInterfaceObj(el){var lastTick = NaN;var offsetParent = getSimpleExtPxInFn(el.offsetParent)||retFalse;function p(doTick){if(doTick){tick = (1+tick)%0xEFFFFFFF;}if(tick != lastTick){lastTick = tick;offsetParent();getBorders(p, el);p.iY = (p.y = (offsetParent.iY + (el.offsetTop|0))) + p.bt;p.iX = (p.x = (offsetParent.iX + (el.offsetLeft|0))) + p.bl;p.w = el.offsetWidth|0;p.h = el.offsetHeight|0;}return p;}p.elTest = function(elmnt){return (elmnt == el);};p.iY = p.iX = p.w = p.h = p.y = p.x = p.bb = p.bt = p.bl = p.br = 0;return (objList[objList.length] = p);}
	function getSimpleExtPxInFn(el){if((!el)||(el == document)){return retFalse;}for(var c = objList.length;c--;){if(objList[c].elTest(el)){return objList[c];}}return getInterfaceObj(el);}
	function setSpecialObj(el){var lastTick = NaN;function p(doTick){if(doTick){tick = (1+tick)%0xEFFFFFFF;}return p;}p.elTest = function(elmnt){return (elmnt == el);};p.iY = p.iX = p.w = p.h = p.y = p.x = p.bb = p.bt = p.bl = p.br = 0;objList[objList.length] = p;}
	if((typeof el.offsetParent != 'undefined')&&(typeof el.offsetTop == 'number')&&(typeof el.offsetWidth == 'number')){if((typeof el.clientTop == 'number')&&(typeof el.clientWidth == 'number')){getBorders = gClientBorders;}else if((defaultView = document.defaultView)&&defaultView.getComputedStyle &&(temp = defaultView.getComputedStyle(el, '' ))&&(((temp.getPropertyCSSValue)&&(temp2 = temp.getPropertyCSSValue('border-top-width'))&&(temp2.getFloatValue)&&(doCompStyle = doComputedStyleFloat))||((temp.getPropertyValue)&&(doCompStyle = doComputedStyleValue)))){getBorders = gCompStyleBorders;temp2 = temp = null;}if(document.documentElement){setSpecialObj(document.documentElement);}if(document.body){setSpecialObj(document.body);}return (getSimpleExtPxIn = getSimpleExtPxInFn)(el);}else{retThis.elTest = retFalse;retThis.iY = retThis.iX = retThis.y = retThis.x = retThis.w = retThis.h = retThis.bb = retThis.bt = retThis.bl = retThis.br = NaN;return (getSimpleExtPxIn = retThis);}
}

function getWindowState(){
	var global = this,readScroll = {scrollLeft:NaN,scrollTop:NaN},readSizeC = {clientWidth:NaN,clientHeight:NaN},readSizeI = {innerWidth:NaN,innerHeight:NaN},readScrollX = 'scrollLeft',readScrollY = 'scrollTop';
	var theOne = {
		getScrollX:function(){return readScroll[readScrollX]|0;},
		getScrollY:function(){return readScroll[readScrollY]|0;},
		getWidth:getWidthC,
		getHeight:getHeightC
	};
	function getWidthI(){return readSizeI.innerWidth;}
	function getWidthC(){return readSizeC.clientWidth|0;}
	function getHeightI(){return readSizeI.innerHeight;}
	function getHeightC(){return readSizeC.clientHeight|0;}
	function getHeightSmart(){return retSmaller(getHeightI(), getHeightC());}
	function getWidthSmart(){return retSmaller(getWidthI(), getWidthC());}
	function setInnerWH(){theOne.getWidth = getWidthI;theOne.getHeight = getHeightI;}
	function retSmaller(inr, other){if(other > inr){setInnerWH();return inr;}else{return other;}}
	function main(){return theOne;}
	function rankObj(testObj){var dv,dhN;if(testObj&&(typeof testObj.clientWidth == 'number')&&(typeof testObj.clientHeight == 'number')){if(((dv = global.innerHeight - testObj.clientHeight) >= 0)&&((dh = global.innerWidth - testObj.clientWidth) >= 0)){if(dh == dv){return 0;}else if((dh&&!dv)||(dv&&!dh)){return (dh+dv);}}}return NaN;}
	if((typeof global.innerHeight == 'number')&&(typeof global.innerWidth == 'number')){readSizeI = global;var bodyRank = rankObj(document.body),rankDocEl = rankObj(document.documentElement),selEl = null;if(!isNaN(bodyRank)){if(!isNaN(rankDocEl)){if(bodyRank < rankDocEl){selEl = document.body;}else if(bodyRank > rankDocEl){selEl = document.documentElement;}else{selEl = compatModeTest(document.body);}}else{selEl = document.body;}}else if(!isNaN(rankDocEl)){selEl = document.documentElement;}if(selEl){readSizeC = selEl;theOne.getWidth = getWidthSmart;theOne.getHeight = getHeightSmart;}else{setInnerWH();}}else{readSizeC = compatModeTest(readSizeC);}
	if((typeof global.pageYOffset == 'number')&&(typeof global.pageXOffset == 'number')){readScroll = global;readScrollY = 'pageYOffset';readScrollX = 'pageXOffset';}else{readScroll = compatModeTest(readScroll);}
	return (getWindowState = main)();
}

function associateObjWithEvent(obj, methodName){return (function(e){e = e||window.event;return obj[methodName](e, this);});}

var WindowMngr = (function(){
	var global = this,windows = {},windowState = null;
	var currentDrag = null,moveFollow = null,modalUp = null;
	var finalX,finalY;
	var overrideStyles = {
		margin:[{keys:['margin','marginBottom','marginLeft','marginRight','marginTop'],value:'0px'}],
		padding:[{keys:['padding','paddingBottom','paddingLeft','paddingRight','paddingTop'],value:'0px'}],
		border:[
			{keys:['border','borderBottom','borderLeft','borderRight','borderTop'],value:'0px none #FFFFFF'},
			{keys:['borderWidth','borderLeftWidth','borderRightWidth','borderBottomWidth','borderTopWidth'],value:'0px'},
			{keys:['borderStyle','borderRightStyle','borderLeftStyle','borderBottomStyle','borderTopStyle'],value:'none'}
		],
		overflow:[{keys:['overflow'],value:'hidden'}],
		positionRel:[{keys:['position'],value:'relative'}],
		positionAbs:[{keys:['position'],value:'absolute'}],
		top:[{keys:['top'],value:'0px'}],
		left:[{keys:['left'],value:'0px'}],
		visibility:[{keys:['visibility'],value:'hidden'}],
		whiteSpace:[{keys:['whiteSpace'],value:'nowrap'}]
	};
	function setStyleProps(styleObj){
		var data, dArray;
		for(var c = 1;c < arguments.length;c++){
			if((data = overrideStyles[arguments[c]])){
				for(var d = data.length;d--;){
					dArray = data[d].keys;
					for(var e = dArray.length;e--;){
						styleObj[dArray[e]] = data[d].value;
					}
				}
			}
		}
		return true;
	}
	function setClass(el,val){
		if(el.setAttribute){el.setAttribute('class',val);}
		return (el.className = val);
	}
	function addConstants(obj){
		obj.DIALOG = 0x000001;			  // 0x000001 : DIALOG; always opens in the centre of the viewport.
		obj.DRAGABLE = 0x000002;		  // 0x000002 : DRAGABLE; can be dragged using the title.
		obj.CLOSEABLE = 0x000004;		  // 0x000004 : CLOSEABLE; has a close button.
		obj.MODAL = 0x000008;			  // 0x000008 : MODAL; window is modal, no other window manager activities happen while a modal window is open
		obj.HIDE_IF_COVERED = 0x000010;	  // 0x000010 : HIDE_IF_COVERED : the inner DIV is hidden if it is overlapped by another window frame.
		obj.RESIZEABLE = 0x000020;		  // 0x000020 : RESIZEABLE : Has corner resize widget.
		obj.VERTICAL_SCROLL = 0x000040;	  // 0x000040 : VERTICAL_SCROLL : has vertical scroll bar.
		obj.HORIZONTAL_SCROLL =	0x000080; // 0x000080 : HORIZONTAL_SCROLL : has horizontal scroll bar.
		obj.NO_WIDTH_ADJUST =	0x000100; // 0x000100 : NO_WIDTH_ADJUST : does not adjust the width of the innermost DIV.
		return obj;
	}
	function getNewFIFCFncStac(fnc){
		function getNewFnc(f, next){function t(a){next = next&&next(a);return (f(a))?t:next;}return t;}
		var base = getNewFnc(fnc, null);
		fnc = function(a){base = base&&base(a);};
		fnc.addItem = function(d){base = getNewFnc(d, base);};
		return fnc;
	}
	function endDrag(){
		if(currentDrag)currentDrag.changing = false;
		currentDrag = null;
		finalX = moveFollow.getPageX();
		finalY = moveFollow.getPageY();
		return true;
	}
	function getHitTestFunction(obj, winPixels){
		return (function(minX, maxX, minY, maxY){var x,y;return !((!obj.visibile)||((minX > ((x = winPixels().x)+winPixels.w-1))||(maxX < x)||(minY > ((y = winPixels.y)+winPixels.h-1))||(maxY < y)));});
	}
	function retTrue(){return true;}
	function retFalse(){return false;}
	var getZStackInterface = (function(){
		var base, top, maxZindex = 1000;
		function ms(){if((top)&&(top.previous)){top.previous.onStartOfMove();}}
		function me(){if(base){base.onEndOfMove();}}
		return (function(callback_SetZ, callback_moveStart,callback_notCovered,callback_testIsCovered,callback_testCovers){
			function z(newIndex){
				callback_SetZ(newIndex);
				if(z.previous){z.previous((((newIndex -= 10) > 0)?newIndex:0));}
			}
			z.previous = (z.next = null);
			z.moveFirst = function(){if(top != this){if(this.previous){this.previous.next = this.next;}else if(this.next){base = this.next;}if(this.next){this.next.previous = this.previous;}this.previous = top;this.next = null;top.next = this;top = this;base.onEndOfMove();}top(maxZindex);};
			z.moveLast = function(){if(base != this){if(this.next){this.next.previous = this.previous;}else if(this.previous){top = this.previous;}if(this.previous){this.previous.next = this.next;}if(base){this.next = base;base.previous = this;}this.previous = null;base = this;}base(0);};
			z.startOfMove = ms;
			z.endOfMove = me;
			z.onStartOfMove = function(){callback_moveStart();if(this.previous){this.previous.onStartOfMove();}};
			z.onEndOfMove = function(){if((this.next)&&(callback_testIsCovered(this.next))){callback_moveStart();}else{callback_notCovered();}if(this.next)this.next.onEndOfMove();};
			z.testCovers = function(minX, maxX, minY, maxY){return callback_testCovers(minX, maxX, minY, maxY)||(this.next&&this.next.testCovers(minX, maxX, minY, maxY));};
			z.moveLast();
			if(!top){top = base;}
			return z;
		});
	})();
	var headerPattern = /^h[0-9]$/i;
	var divPattern = /^DIV$/i;
	var linkPattern = /^A$/i;
	function verifyElementType(node, testRegEx){
		return ((node)&&(node.nodeType == 1)&&((node.nodeName)?(testRegEx.test(node.nodeName)):(testRegEx.test(node.tagName))));
	}
	function getFirstContained(parent, pattern){
		var childNodes = parent.childNodes;
		for(var c = 0;c < childNodes.length;c++){ //first child
			if(verifyElementType((node = childNodes[c]), pattern)){return node;}
		}
		return null;
	}
	function getContainedLinks(parent){
		return parent.getElementsByTagName('A');
	}
	function augmentDragable(self){
		var dxStart, dyStart
		function finalize(){self = null;}
		function doDrag(){
			if(self.changing){
				finalX = moveFollow.getPageX();
				finalY = moveFollow.getPageY();
			}
			self.currentX = (finalX - dxStart);
			self.currentY = (finalY - dyStart);
			self.position();
			self.afterChange();
			return self.changing;
		}
		function dragBarDown(e){
			if(!modalUp||(modalUp == self)){
				self.zInterface.moveFirst();
				if(currentDrag&&(currentDrag != self)){currentDrag.changing = false;}
				if(!self.changing){
					currentDrag = self;
					self.changing = true;
					moveFollow.upDate(e);
					dxStart = moveFollow.getPageX() - self.currentX;
					dyStart = moveFollow.getPageY() - self.currentY;
					self.zInterface.startOfMove();
					TimedQue(doDrag);
					document.onselectstart = retFalse;
					document.onmouseup = endDrag;
				}else{
					self.changing = false;
				}
			}
			return true;
		}
		self.init.addItem(function(e){
			if(!self.abort){
				self.finalize.addItem(finalize);
				self.titleDivStyle.cursor = 'move';
				self.titleDiv.onmousedown = dragBarDown;
			}
		});
	}
	function augmentVScroll(self){
		var dScrollVStart,dyStart,dScrollVMul;
		var scrollBoxStyle,scrollBoxDiv,scrollBarStyle,scrollBarDiv,scrollBarDim;
		function finalize(){
			if(scrollBarDiv){scrollBarDiv.onclick = null;}
			if(scrollBoxDiv){scrollBoxDiv.onmousedown = null;}
			self = scrollBoxStyle = scrollBoxDiv = scrollBarStyle = scrollBarDiv = scrollBarDim = null
		}
		function doVScroll(){
			if(self.changing){finalY = moveFollow.getPageY();}
			self.currentVScroll = ((dScrollVStart + ((dyStart - finalY)/dScrollVMul))|0);
			self.position();
			self.afterChange();
			return self.changing;
		}
		function vScrollBoxDown(e){
			var contH;
			if(!modalUp||(modalUp == self)){
				self.zInterface.moveFirst();
				if(currentDrag&&(currentDrag != self)){currentDrag.changing = false;}
				if(!self.changing){
					moveFollow.upDate(e);
					dScrollVMul = self.currentHeight/self.innerMostContPixels().h;
					if(dScrollVMul < 1){
						currentDrag = self;
						self.changing = true;
						dScrollVStart = self.currentVScroll;
						dyStart = moveFollow.getPageY();
						TimedQue(doVScroll);
						document.onselectstart = retFalse;
						document.onmouseup = endDrag;
					}
				}else{
					self.changing = false;
				}
			}
			return false;
		}
		function vScrollClick(e){
			var contH, ratio, pageOff;
			if(!modalUp||(modalUp == self)){
				self.zInterface.moveFirst();
				if(currentDrag&&(currentDrag != self)){currentDrag.changing = false;}
				if(!self.changing){
					moveFollow.upDate(e);
					if(scrollBarDiv == moveFollow.getTarget()){
						contH = self.currentHeight;
						if(((ratio = contH/self.innerMostContPixels().h)*contH) < contH){
							pageOff = -1*((moveFollow.getPageY() - (self.winPixels().iY+self.titlePixels().h))/ratio);
							if(pageOff > self.currentVScroll){ //scroll up
								self.currentVScroll +=  contH;
								self.position();
							}else if(pageOff < (self.currentVScroll - contH)){ //scroll down
								self.currentVScroll -=  contH;
								self.position();
							}
						}
					}
				}else{
					self.changing = false;
				}
			}
		}
		function position(){
			var ratio = self.currentHeight/self.innerMostContPixels().h;
			var boxTop = -1*(self.currentVScroll*ratio)|0;
			var boxH = (self.currentHeight*ratio)|0;
			if(boxH < 6){boxH = 6;}
			if(boxH >= self.currentHeight){
				boxH = self.currentHeight;
				boxTop = 0;
				scrollBoxStyle.visibility = 'hidden';
			}else{
				scrollBoxStyle.visibility = '';
				if((boxH+boxTop) > self.currentHeight){
					boxTop = (self.currentHeight - boxH)
				}
			}
			scrollBarStyle.left = (self.currentWidth) + 'px';
			scrollBarStyle.top = self.titlePixels().h + 'px';
			scrollBarStyle.height = self.currentHeight + 'px';
			scrollBoxStyle.top = boxTop + 'px';
			scrollBoxStyle.left = '0px';
			scrollBoxStyle.height = boxH + 'px';
			return true;
		}
		function open(){
			scrollBarStyle.visibility = '';
			return true;
		}
		function close(){
			scrollBarStyle.visibility = 'hidden';
			return true;
		}
		function setZindex(zIndex){
			scrollBarStyle.zIndex = (zIndex+3);
			scrollBoxStyle.zIndex = (zIndex+4);
			return true;
		}
		function checkVScroll(){
			self.checkVScroll();
			return true;
		}
		self.init.addItem(function(e){
			if(!self.abort){
				scrollBarDiv = document.createElement('DIV')
				if(scrollBarDiv&&(scrollBoxDiv = document.createElement('DIV'))&&(scrollBoxStyle = scrollBoxDiv.style)&&(scrollBarStyle = scrollBarDiv.style)&&(setClass(scrollBarDiv,'windowVScrollBar'))&&(setClass(scrollBoxDiv,'windowVScrollBox'))&&(setStyleProps(scrollBarStyle, 'positionAbs', 'overflow', 'margin', 'top'))&&(setStyleProps(scrollBoxStyle, 'positionAbs', 'overflow', 'margin', 'top'))&&(scrollBarDiv.appendChild(scrollBoxDiv))&&(self.windDiv.appendChild(scrollBarDiv))){
					scrollBoxDiv.onmousedown = vScrollBoxDown;
					scrollBarDim = getSimpleExtPxIn(scrollBarDiv);
					scrollBarDiv.onclick = vScrollClick;
					self.open.addItem(open);
					self.close.addItem(close);
					self.checkScroll.addItem(checkVScroll);
					self.setZindex.addItem(setZindex);
					self.finalize.addItem(finalize);
					self.position.addItem(position);
					self.vScrollWidth = function(){return scrollBarDim().w;};
					self.vScrollHeight = function(){return scrollBarDim().h;};
				}else{
					self.abort = true;
				}
			}
		});
		return true;
	}
	function augmentHScroll(self){
		var dScrollVStart,dxStart,dScrollVMul
		var scrollBoxStyle,scrollBoxDiv,scrollBarStyle,scrollBarDiv,scrollBarDim;
		var count = 0;
		function finalize(){
			if(scrollBarDiv){scrollBarDiv.onclick = null;}
			if(scrollBoxDiv){scrollBoxDiv.onmousedown = null;}
			self = scrollBoxStyle = scrollBoxDiv = scrollBarStyle = scrollBarDiv = scrollBarDim = null;
		}
		function doHScroll(){
			if(self.changing){finalX = moveFollow.getPageX();}
			self.currentHScroll = ((dScrollVStart + ((dxStart - finalX)/dScrollVMul))|0);
			self.position();
			self.afterChange();
			return self.changing;
		}
		function hScrollBoxDown(e){
			if(!modalUp||(modalUp == self)){
				self.zInterface.moveFirst();
				if(currentDrag&&(currentDrag != self)){currentDrag.changing = false;}
				if(!self.changing){
					moveFollow.upDate(e);
					dScrollVMul = ((self.currentWidth + self.vScrollWidth()) - Math.max(self.vScrollWidth(), self.sizeWidth()))/self.innerMostContPixels().w;
					if(dScrollVMul < 1){
						currentDrag = self;
						self.changing = true;
						dScrollVStart = self.currentHScroll;
						dxStart = moveFollow.getPageX();
						TimedQue(doHScroll);
						document.onselectstart = retFalse;
						document.onmouseup = endDrag;
					}
				}else{
					self.changing = false;
				}
			}
			return false;
		}
		function hScrollClick(e){
			var contW, ratiot, pageOff;
			if(!modalUp||(modalUp == self)){
				self.zInterface.moveFirst();
				if(currentDrag&&(currentDrag != self)){currentDrag.changing = false;}
				if(!self.changing){
					moveFollow.upDate(e);
					if(scrollBarDiv == moveFollow.getTarget()){
						contW = self.currentWidth;
						if(((ratio = contW/self.innerMostContPixels().w)*contW) < contW){
							pageOff = -1*((moveFollow.getPageX() - self.winPixels().iX)/ratio);
							if(pageOff > (self.currentHScroll)){
								self.currentHScroll += contW;
								self.position();
							}else if(pageOff < ((self.currentHScroll) - contW)){
								self.currentHScroll -= contW;
								self.position();
							}
						}
					}
				}else{
					self.changing = false;
				}
			}
		}
		function position(){
			var barW = ((self.currentWidth + self.vScrollWidth()) - Math.max(self.vScrollWidth(), self.sizeWidth()));
			var barTop = ((self.currentHeight + self.titlePixels().h + Math.max(self.hScrollHeight(), self.sizeHeight())) - self.hScrollHeight());
			var ratio = self.currentWidth/self.innerMostContPixels().w;
			var boxLeft = -1*(self.currentHScroll*ratio)|0;
			var boxW = (barW*ratio)|0;
			if(boxW >= barW){
				boxW = barW;
				boxLeft = 0;
				scrollBoxStyle.visibility = 'hidden';
			}else{
				scrollBoxStyle.visibility = '';
				if((boxW+boxLeft) > barW){
					boxLeft = (barW - boxW)
				}
			}
			scrollBoxStyle.left = boxLeft + 'px';
			scrollBarStyle.top = barTop + 'px';
			scrollBoxStyle.top = '0px';
			scrollBarStyle.left = '0px';
			scrollBarStyle.width = barW + 'px';
			scrollBoxStyle.width = boxW + 'px';
			return true;
		}
		function open(){
			scrollBarStyle.visibility = '';
			return true;
		}
		function close(){
			scrollBarStyle.visibility = 'hidden';
			return true;
		}
		function setZindex(zIndex){
			scrollBarStyle.zIndex = (zIndex+3);
			scrollBoxStyle.zIndex = (zIndex+4);
			return true;
		}
		function checkHScroll(){
			self.checkHScroll();
			return true;
		}
		self.init.addItem(function(e){
			if(!self.abort){
				scrollBarDiv = document.createElement('DIV')
				if(scrollBarDiv&&(scrollBoxDiv = document.createElement('DIV'))&&
				  (setClass(scrollBarDiv, 'windowHScrollBar'))&&
				  (setClass(scrollBoxDiv, 'windowHScrollBox'))&&
				  (scrollBoxStyle = scrollBoxDiv.style)&&
				  (scrollBarStyle = scrollBarDiv.style)&&
				  (setStyleProps(scrollBarStyle, 'positionAbs', 'overflow', 'margin', 'top', 'left'))&&
				  (setStyleProps(scrollBoxStyle, 'positionAbs', 'overflow', 'margin', 'top', 'left'))&&
				  (scrollBarDiv.appendChild(scrollBoxDiv))&&
				  (self.windDiv.appendChild(scrollBarDiv))){
					scrollBoxDiv.onmousedown = hScrollBoxDown;
					scrollBarDim = getSimpleExtPxIn(scrollBarDiv);
					scrollBarDiv.onclick = hScrollClick;
					self.open.addItem(open);
					self.close.addItem(close);
					self.checkScroll.addItem(checkHScroll);
					self.setZindex.addItem(setZindex);
					self.finalize.addItem(finalize);
					self.position.addItem(position);
					self.hScrollWidth = function(){return scrollBarDim().w;};
					self.hScrollHeight = function(){return scrollBarDim().h;};
				}else{
					self.abort = true;
				}
			}
		});
		return true;
	}
	function augmentResizeable(self){
		var dxStart, dyStart;
		var sizeDiv,sizeDivStyle, sizeDivPixels;
		var minWidth, windowWidthStart,windowHeightStart;
		var count = 0
		function finalize(){
			if(sizeDiv){sizeDiv.onmousedown = null;}
			self = sizeDiv = sizeDivStyle = sizeDivPixels = null;
		}
		function doSize(){
			if(self.changing){
				finalX = moveFollow.getPageX();
				finalY = moveFollow.getPageY();
			}
			var wW = windowWidthStart+(finalX - dxStart)
			var wH = windowHeightStart+(finalY - dyStart)
			if(wW < minWidth){wW = minWidth;}
			if(wH < 14){wH = 14;}
			self.currentWidth = wW;
			self.currentHeight = wH;
			self.winPixels(true);
			self.position();
			self.afterChange();
			return self.changing;
		}
		function sizeBoxDown(e){
			var winBordrs;
			if(!modalUp||(modalUp == self)){
				self.zInterface.moveFirst();
				if(currentDrag&&(currentDrag != self)){currentDrag.changing = false;}
				if(!self.changing){
					currentDrag = self;
					self.changing = true;
					moveFollow.upDate(e);
					windowWidthStart = self.currentWidth;
					windowHeightStart = self.currentHeight;
					minWidth = (self.titleTextPixels().w + (self.closeWidth()<<1) + (self.winPixels.bl+self.winPixels.br));
					dxStart = moveFollow.getPageX();
					dyStart = moveFollow.getPageY();
					self.zInterface.startOfMove();
					TimedQue(doSize);
					document.onselectstart = retFalse;
					document.onmouseup = endDrag;
				}else{
					self.changing = false;
				}
			}
			return false
		}
		function position(){
			sizeDivStyle.top = (self.titlePixels().h+self.currentHeight) +'px';
			sizeDivStyle.left = ((self.currentWidth+self.vScrollWidth()) - sizeDivPixels.w) +'px';
			return true;
		}
		function open(){
			sizeDivStyle.visibility = '';
			return true;
		}
		function close(){
			sizeDivStyle.visibility = 'hidden';
			return true;
		}
		function setZindex(zIndex){
			sizeDivStyle.zIndex = (zIndex+2);
			return true;
		}
		self.init.addItem(function(e){
			if(!self.abort){
				sizeDiv = document.createElement('DIV');
				if(sizeDiv&&(setClass(sizeDiv, 'windowDivSize'))&&(sizeDivStyle = sizeDiv.style)&&(setStyleProps(sizeDivStyle, 'positionAbs', 'overflow', 'margin'))&&(sizeDivStyle.cursor = 'se-resize')&&(self.windDiv.appendChild(sizeDiv))){
					sizeDivPixels = getSimpleExtPxIn(sizeDiv);
					sizeDiv.onmousedown = sizeBoxDown;
					self.open.addItem(open);
					self.close.addItem(close);
					self.setZindex.addItem(setZindex);
					self.finalize.addItem(finalize);
					self.position.addItem(position);
					self.sizeWidth = function(){return sizeDivPixels().w;};
					self.sizeHeight = function(){return sizeDivPixels().h;};
				}else{
					self.abort = true;
				}
			}
		});
		return true;
	}
	function augmentModal(self){
		self.open.addItem(function(){
			modalUp = self;
			return true;
		});
		self.close.addItem(function(){
			modalUp = null;
			return true;
		});
	}
	function augmentCloseable(self){
		var closeDiv,closeInnerDiv,closeDivStyle, closeDivPixels;
		var closeWidth, titleWidth = NaN;
		function finalize(){
			if(closeDiv){closeDiv.onmousedown = null;}
			self = closeDiv = closeInnerDiv = closeDivStyle = closeDivPixels = null;
		}
		function position(){
			closeDivStyle.top = self.titlePixels().bt+'px';
			closeDivStyle.left = ((self.currentWidth + self.vScrollWidth()) - (1 + closeDivPixels().w + self.titlePixels().br))+'px';
			closeDivStyle.width = closeDivPixels().w+'px'
			return true;
		}
		function open(){
			closeDivStyle.visibility = '';
			return true;
		}
		function close(){
			closeDivStyle.visibility = 'hidden';		
			return true;
		}
		function setZindex(zIndex){
			closeDivStyle.zIndex = (zIndex+1);
			return true;
		}
		self.init.addItem(function(e){
			var txtNd;
			if(!self.abort){
				closeDiv = document.createElement('DIV')
				if((closeDiv = document.createElement('DIV'))&&(closeInnerDiv = document.createElement('DIV'))&&(txtNd = document.createTextNode('X'))&&(closeInnerDiv.appendChild(txtNd))&&(setClass(closeInnerDiv, 'windowClose'))&&(closeDivStyle = closeDiv.style)&&(setStyleProps(closeDivStyle, 'positionAbs','margin', 'padding'))&&(setStyleProps(closeInnerDiv.style, 'positionRel', 'margin','top', 'left'))&&(closeDivStyle.cursor = 'pointer')&&(closeDiv.appendChild(closeInnerDiv))&&(self.windDiv.appendChild(closeDiv))){
					closeDivPixels = getSimpleExtPxIn(closeInnerDiv);
					closeDiv.onclick = self.close;
					self.open.addItem(open);
					self.close.addItem(close);
					self.finalize.addItem(finalize);
					self.setZindex.addItem(setZindex);
					self.position.addItem(position);
					self.closeWidth = function(){
						return closeDivPixels().w;
					};
				}else{
					self.abort = true;
				}
			}
		});
	}
	function StdWindow(uniqueID, flags, output){
		var vScroll = false, hScroll = false, reSize = false, self = this, originalParent;
		this.windDiv = getElementWithId(uniqueID);
		if(this.windDiv&&(this.windDivStyle = this.windDiv.style)&&
		   (this.titleDiv = getFirstContained(this.windDiv, headerPattern))&&
		   (this.titleDivStyle = this.titleDiv.style)&&
		   (this.contDiv = getFirstContained(this.windDiv, divPattern))&&
		   (this.contDivStyle = this.contDiv.style)&&
		   (this.innerContDiv = getFirstContained(this.contDiv, divPattern))&&
		   (this.innerContDivStyle = this.innerContDiv.style)&&
		   (this.innerMostContDiv = getFirstContained(this.innerContDiv, divPattern))&&
		   (this.innerMostContDivStyle = this.innerMostContDiv.style)&&
		   (this.titleTextEl = getFirstContained(this.titleDiv, linkPattern))&&
		   (this.titleTextElStyle = this.titleTextEl.style)){
			this.finalize = getNewFIFCFncStac(function(){
				self.finalieProto();
				self = null;
			});
			main.finalize.addItem(this.finalize);
			this.open = getNewFIFCFncStac(function(){
				self.windDivStyle.visibility = 'visible';
				self.visibile = true;
				self.winPixels(true);
				self.position();
				self.zInterface.moveFirst();
				self.zInterface.endOfMove();
				return true;
			});
			this.close = getNewFIFCFncStac(function(){
				self.windDivStyle.visibility = 'hidden';
				self.visibile = false;
				self.zInterface.moveLast();
				self.zInterface.endOfMove();
				return true;
			});
			this.init = getNewFIFCFncStac(function(){
				if((originalParent = self.windDiv.parentNode)&&
				   (document.body.appendChild(self.windDiv))&&
				   (setClass(self.windDiv, 'windowDiv'))&&
				   (setStyleProps(self.windDivStyle, 'overflow', 'positionAbs', 'padding', 'margin', 'top', 'left'))&&
				   (setClass(self.titleDiv, 'windowBar'))&&
				   (setStyleProps(self.contDivStyle, 'positionRel', 'overflow', 'padding', 'margin', 'border', 'top', 'left'))&&
				   (setStyleProps(self.innerContDivStyle, 'positionAbs', 'overflow', 'padding', 'margin', 'border', 'top', 'left'))&&
				   (setStyleProps(self.innerMostContDivStyle, 'positionRel', 'overflow', 'padding', 'margin', 'border', 'top', 'left'))&&
				   (setStyleProps(self.titleDivStyle, 'positionRel', 'margin', 'overflow', 'top', 'left'))&&
				   (setStyleProps(self.titleTextElStyle, 'whiteSpace'))&&
				   (setClass(self.innerMostContDiv, 'windowInnerMost'))&&
				   (!isNaN((self.winPixels = getSimpleExtPxIn(self.windDiv)).w))&&
				   (!isNaN((self.innerMostContPixels = getSimpleExtPxIn(self.innerMostContDiv)).w))&&
				   (!isNaN((self.contPixels = getSimpleExtPxIn(self.contDiv)).w))&&
				   (!isNaN((self.titleTextPixels = getSimpleExtPxIn(self.titleTextEl)).w))&&
				   (!isNaN((self.titlePixels = getSimpleExtPxIn(self.titleDiv)).w))&&
				   (self.winPixels(true).x == 0) //CSS not working so abort.
				){
					if(flags&WindowMngr.HIDE_IF_COVERED){
						self.onMoveStart = (function(){if(self.visibile){self.contDivStyle.visibility = 'hidden';}});
						self.onNotCovered = (function(){self.contDivStyle.visibility = '';});
						self.isCovered = (function(fncObj){var x,y;return self.visibile&&fncObj.testCovers((x = (self.contPixels().x)),(self.contPixels.w+x-1),(y = (self.contPixels.y)),(self.contPixels.h+y-1));});
					}else{
						self.onMoveStart = retTrue;
						self.onNotCovered = retTrue;
						self.isCovered = retFalse;
					}
					if(!(flags&WindowMngr.MODAL)){self.hitTest = (getHitTestFunction(self, self.winPixels));}
					self.innerContDiv.onmousedown = associateObjWithEvent(self, 'contentDown');
					self.windDiv.onmousedown = associateObjWithEvent(self, 'windowDown');
					self.zInterface = getZStackInterface(self.setZindex,self.onMoveStart,self.onNotCovered,self.isCovered,self.hitTest);
				}else{
					self.abort = true;
				}
			});
			this.setZindex = getNewFIFCFncStac(function(zIndex){
				self.windDivStyle.zIndex = zIndex;
				return true;
			});
			this.position = getNewFIFCFncStac(function(){
				var tempVal;
				self.currentVScroll = (self.currentHScroll = 0);
				self.currentWidth = self.innerMostContPixels(true).w;
				self.currentHeight = self.innerMostContPixels.h;
				if(self.currentWidth < (tempVal = (self.titleTextPixels().w + (self.closeWidth()<<1) - self.vScrollWidth()))){
					self.currentWidth = tempVal;
				}else if((hScroll||reSize)&&(self.currentWidth > (tempVal = (windowState.getWidth() - (4+self.vScrollWidth()+self.winPixels().bl+self.winPixels.br)))           )){
					self.currentWidth = tempVal
				}
				if(self.currentHeight < 14){
					self.currentHeight = 14;
				}else if((vScroll||reSize)&&(self.currentHeight > (tempVal = (windowState.getHeight() - (4+Math.max(self.hScrollHeight(), self.sizeHeight())+self.winPixels.bt+self.winPixels.bb+self.titlePixels().h))        )      )){
					self.currentHeight = tempVal
				}
				return false;
			});
			this.position.addItem(function(){
				if(self.sizeInner){setClass(self.innerMostContDiv, 'windInnerMostFreeSize');}
				return false;
			});
			this.position.addItem(function(){
				return self.initialWindowPos();
			});
			this.position.addItem(function(){
				self.doPosSize();
				return true;
			});
			this.checkScroll = getNewFIFCFncStac(retFalse);
			if(flags&WindowMngr.RESIZEABLE){
				reSize = augmentResizeable(this);
			}
			if(flags&WindowMngr.DIALOG){
				self.isDialog = true;
			}
			if(flags&WindowMngr.DRAGABLE){
				augmentDragable(this);
			}
			if(flags&WindowMngr.MODAL){
				this.hitTest = retTrue; //modal always covers all.
				augmentModal(this);
			}
			if(flags&WindowMngr.VERTICAL_SCROLL){
				vScroll = augmentVScroll(this);
			}
			if(flags&WindowMngr.HORIZONTAL_SCROLL){
				hScroll = augmentHScroll(this);
			}
			if(flags&WindowMngr.CLOSEABLE){
				augmentCloseable(this);
			}
			if(flags&WindowMngr.NO_WIDTH_ADJUST){
				this.sizeInner = false;
			}
			this.init.addItem(function(){
				if(self.abort){
					self.windDivStyle.position = self.windDivStyle.visibility = '';
					originalParent.appendChild(self.windDiv); //put it back
				}else{
					self.configured = true;
				}
			});
			this.windDivStyle.visibility = 'hidden';
			this.visibile = false;
			InitializeMe(this.init);
			if(output){document.write(output);}
		}else{
			this.abort = true;
		}
	}
	StdWindow.prototype.visibile = StdWindow.prototype.sizeInner = true;
	StdWindow.prototype.hScrollWidth = StdWindow.prototype.hScrollHeight = StdWindow.prototype.vScrollWidth = StdWindow.prototype.vScrollHeight = StdWindow.prototype.closeWidth = StdWindow.prototype.sizeWidth = StdWindow.prototype.sizeHeight = function(){return 0;};
	StdWindow.prototype.isDialog = StdWindow.prototype.changing = StdWindow.prototype.configured = StdWindow.prototype.abort = false;
	StdWindow.prototype.contentDown = function(){this.changing = false;};
	StdWindow.prototype.checkVScroll = function(){
		var testScroll;
		if(this.currentVScroll < (testScroll = ((this.innerMostContPixels().h - this.currentHeight)*-1))){
			this.currentVScroll = testScroll;
		}
		if(this.currentVScroll > 0){
			this.currentVScroll = 0;
		}
	};
	StdWindow.prototype.finalieProto = function(){
		if(this.titleDiv){this.titleDiv.onmousedown = null;}
		if(this.innerContDiv){this.innerContDiv.onmousedown = null;}
		if(this.windDiv){this.windDiv.onmousedown = null;}
		this.zInterface = this.setZindex = this.checkScroll = this.position = this.finalize = this.open = this.closee = this.over = this.setZindex = this.onMoveStart = this.onNotCovered = this.isCovered = this.hitTest = null;
		this.windDiv = this.titleDiv = this.titleDivStyle = this.contDiv = this.contDivStyle = this.innerContDiv = this.innerContDivStyle = this.innerMostContDiv = this.innerMostContDivStyle = this.titleTextEl = this.titleTextElStyle = this.winPixels = this.innerMostContPixels = this.contPixels = this.titleTextPixels = this.titlePixels = null
	}
	StdWindow.prototype.checkHScroll = function(){
		var testScroll;
		if(this.currentHScroll < (testScroll = ((this.innerMostContPixels().w - this.currentWidth)*-1))){
			this.currentHScroll = testScroll;
		}
		if(this.currentHScroll > 0){
			this.currentHScroll = 0;
		}
	};

	StdWindow.prototype.doPosSize = function(){
		var w,h;
		if(this.currentY < 0){this.currentY = 0;}
		if(this.currentX < 0){this.currentX = 0;}
		this.checkScroll();
		this.windDivStyle.left = this.currentX + 'px';
		this.windDivStyle.top = this.currentY + 'px';
		this.innerContDivStyle.top = this.currentVScroll + 'px';
		this.innerContDivStyle.left =  this.currentHScroll + 'px';
		this.innerContDivStyle.width = ((w = this.currentWidth)+(-1*this.currentHScroll)) + 'px';
		this.innerContDivStyle.height = ((h = this.currentHeight)+(-1*this.currentVScroll)) + 'px';
		this.contDivStyle.width =  w + 'px';
		this.contDivStyle.height = h + 'px';
		this.titleDivStyle.width = (w += this.vScrollWidth()) + 'px';
		this.windDivStyle.width = w + 'px';
		this.windDivStyle.height = (h + Math.max(this.hScrollHeight(), this.sizeHeight()) + this.titlePixels().h)  + 'px';
		this.winPixels(true);
	};

	StdWindow.prototype.initialWindowPos = function(){
		if(!this.changing){
			this.currentX = (((windowState.getWidth() - (1+this.currentWidth+this.vScrollWidth()+this.winPixels().bl+this.winPixels.br))>>1)+windowState.getScrollX());
			this.currentY = (((windowState.getHeight() - (1+this.currentHeight+Math.max(this.hScrollHeight(), this.sizeHeight())+this.winPixels.bt+this.winPixels.bb+this.titlePixels().h))>>1)+windowState.getScrollY());
		}
		return this.isDialog;
	};
	StdWindow.prototype.windowDown = function(){
		if((currentDrag != this)&&(!modalUp||(modalUp == this))){
			this.zInterface.moveFirst();
			if(currentDrag)currentDrag.changing = false;
		}
	};
	StdWindow.prototype.afterChange = function(){
		if(!this.changing){
			this.zInterface.endOfMove();
			if(!currentDrag){
				document.onselectstart = (document.onmouseup = retTrue);
			}else if(currentDrag == this){
				currentDrag = null;
			}
		}
	};
	StdWindow.prototype.over = function(uniqueID){
		var wObj = windows[uniqueID];
		this.zInterface.moveFirst();
		if(!this.visibile){
			if(wObj&&(wObj.configured)&&(!wObj.abort)){
				if(!modalUp){ //modal windows cannot use over.
					this.position();
					this.currentX = wObj.winPixels(true).iX+2;
					this.currentY = wObj.winPixels.iY+2+wObj.titlePixels().h;
				}
			}
		this.open();
		}
	};
	function finalize(){moveFollow = windowState = null;}
	function gateway(uniqueID, flags, output){
		var el;
		if((el = getElementWithId(uniqueID))&&(document.body)&&(document.write)&&(el.appendChild)&&(el.removeChild)&&(el.parentNode)&&(el.style)&&(typeof el.style.cursor == 'string')&&(typeof el.style.position == 'string')&&(typeof el.style.visibility == 'string')&&(typeof el.style.top == 'string')&&(typeof el.offsetWidth == 'number')&&(el.childNodes)&&(typeof el.nodeName == 'string'||typeof el.tagName == 'string')&&(typeof el.nodeType == 'number')&&(el.getElementsByTagName)&&(windowState = getWindowState())&&(moveFollow = MoveFollow())&&(!isNaN(windowState.getWidth()))){
			main.finalize = getNewFIFCFncStac(finalize);
			finalizeMe(main.finalize);
			return (global.WindowMngr = addConstants(main))(uniqueID, flags, output);

		}else{
			return (global.WindowMngr = addConstants(retTrue))();
		}
	}
	function main(uniqueID, methodName, a1,a2,a3,a4,a5,a6){
		var wObj = windows[uniqueID];
		if(!wObj){
			wObj = windows[uniqueID] = new StdWindow(uniqueID, methodName, a1);
			return false;
		}else if(wObj){
			if((wObj.configured)&&(!wObj.abort)){
				if(!modalUp||(wObj == modalUp)){
					if((methodName)&&(wObj[methodName])){
						wObj[methodName](a1,a2,a3,a4,a5,a6);
					}else if(wObj.open){
						wObj.open();
					}else{
						return true;
					}
				}
				return false;
			}else{
				return wObj.abort;
			}
		}
		return true;
	}
	if((!global.queryStrings||!queryStrings['noWindows'])&&
	   global.setTimeout&&document&&
	   document.createElement&&document.createTextNode
	){
		return addConstants(gateway);
	}else{
		return addConstants(retTrue);
	}
})();