/**
 * @author Mark Cassar
 * @version 1.0.0 
 * @lastmodified 19/03/07
 */

if (!com) var com = new Object();
if (!com.CS) com.CS = new Object();
if (!com.CS.General) com.CS.General = new Object();
if (!com.CS.General.Window) com.CS.General.Window = new Object();

//REQUIREMENTS
if (!Class) throw new Error("com.CS.General.Window: Please include Class com.CS.defineClass");
//------------

com.CS.General.Window = Class({
	name: "Window",
	statics: {
		getX : function() {
			if (window.screenLeft) return window.screenLeft; //IE and others 
			if (window.screenX) return window.screenX; //Firefox and others
			return 0;
		},
		getY : function() {
			if (window.screenTop) return window.screenTop; //IE and others
			if (window.screenY) return window.screenY; //Firefox and others
			return 0;
		},
		
		getDocHeight : function() {
		    return document.height;
		},
		
		getDocWidth : function() {
		    return document.width;
		},
		/**
		 * This is the get width
		 */
		getWidth : function() {
		    
			if (document.documentElement && document.documentElement.clientWidth) return document.documentElement.clientWidth; // IE6 with doctype
			
			if (window.innerWidth) return window.innerWidth; //All but IE
			if (document.body.clientWidth) return document.body.clientWidth; //	IE other
			return 0;
		},
		getHeight : function() {
			if (window.innerHeight) return window.innerHeight; //All but IE
			if (document.documentElement && document.documentElement.clientHeight) return document.documentElement.clientHeight; // IE6 with doctype
			if (document.body.clientHeight) return document.body.clientHeight; // IE other
			return 0;
		},

		getScrollX : function() {
			
			if (window.pageXOffset) return window.pageXOffset; //All but IE
			
			if (document.documentElement && document.documentElement.scrollLeft) return document.documentElement.scrollLeft; // IE6 with doctype
			
			if (document.body.scrollLeft) return document.body.scrollLeft; //	IE other
			return 0;
		},
		getScrollY : function() {
			if (window.pageYOffset) return window.pageYOffset; //All but IE
			if (document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop; // IE6 with doctype
			if (document.body.scrollTop) return document.body.scrollTop; //	IE other
			return 0;
		}
	}
});

