if(typeof(xWindow) == "undefined") xWindow = {};

// ||||||||||||||||||||||||||||||||||||||||||||||||||

xWindow.getWidth = function(){
	var w = 0;
	if(document.documentElement && document.documentElement.clientWidth){// Explorer 6 strict
		w = document.documentElement.clientWidth;
	}else if (document.body && document.body.clientWidth){// Explorer, Gecko
		w = document.body.clientWidth;
	}else{// Netscape 4
		w = window.innerWidth;
    	if(document.height > window.innerHeight) w -= 16;
    }
    return w;
};
xWindow.getHeight = function(){
/*
	var h = 0;
	if(document.documentElement && document.documentElement.clientHeight){// Explorer 6 strict
		h = document.documentElement.clientHeight;
	}else if (document.body && document.body.clientHeight){// Explorer, Gecko
		h = document.body.clientHeight;
	}else{// Netscape 4
		h = window.innerHeight;
    	if(document.width > window.innerWidth) h -= 16;
    }
 */
 	var h = (window.innerHeight) ? window.innerHeight : document.body.offsetHeight;
 	return h;
};

// ||||||||||||||||||||||||||||||||||||||||||||||||||

xWindow.getScrollLeft = function(){
	var x = 0;
	if(window.pageXOffset){// Netscape, Gecko
		x = window.pageXOffset;
	}else if(document.documentElement && document.documentElement.scrollLeft){// Explorer 6 strict
		x = document.documentElement.scrollLeft;
	}else if(document.body && document.body.scrollLeft){// Explorer quirks
		x = document.body.scrollLeft;
	}
	return x;
};
xWindow.getScrollTop = function(){
	var y = 0;
	if(window.pageYOffset){// Netscape, Gecko
		y = window.pageYOffset;
	}else if(document.documentElement && document.documentElement.scrollTop){// Explorer 6 strict
		y = document.documentElement.scrollTop;
	}else if(document.body && document.body.scrollTop){// Explorer quirks
		y = document.body.scrollTop;
	}
	return y;
};

// ||||||||||||||||||||||||||||||||||||||||||||||||||

xWindow.getMouseLeft = function(evt){
	var x = 0;
	if(window.event){// Explorer
		x = window.event.clientX + this.getScrollLeft();
	}else{// Netscape, Gecko
		x = evt.pageX;
	}
	return x;
};
xWindow.getMouseTop = function(evt){
	var y = 0;
	if(window.event){// Explorer
		y = window.event.clientY + this.getScrollTop();
	}else{// Netscape, Gecko
		y = evt.pageY;
	}
	return y;
};