var browser = new function(){
	this.getdocheight = function () {
	    var D = document;
	    return Math.max(
	        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
	        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
	        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
	    );
	}
	this.getwindowxy = function (){
		 var myWidth = 0, myHeight = 0;
		 if( typeof( window.innerWidth ) == 'number' ) {
		   //Non-IE
		   myWidth = window.innerWidth;
		   myHeight = window.innerHeight;
		 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		   //IE 6+ in 'standards compliant mode'
		   myWidth = document.documentElement.clientWidth;
		   myHeight = document.documentElement.clientHeight;
		 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		   //IE 4 compatible
		   myWidth = document.body.clientWidth;
		   myHeight = document.body.clientHeight;
		 }
		 return [myWidth,myHeight];
	}	
	this.getscrollxy = function (){
		  var scrOfX = 0, scrOfY = 0;
		  if( typeof( window.pageYOffset ) == 'number' ) {
		    //Netscape compliant
		    scrOfY = window.pageYOffset;
		    scrOfX = window.pageXOffset;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		    //DOM compliant
		    scrOfY = document.body.scrollTop;
		    scrOfX = document.body.scrollLeft;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		    //IE6 standards compliant mode
		    scrOfY = document.documentElement.scrollTop;
		    scrOfX = document.documentElement.scrollLeft;
		  }
		  return [scrOfX,scrOfY];
	}
	this.setscrolly = function (scrOfY){
		  if( typeof( window.pageYOffset ) == 'number' ) {
		    //Netscape compliant
		    window.pageYOffset = scrOfY;
		  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		    //DOM compliant
		    document.body.scrollTop = scrOfY;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		    //IE6 standards compliant mode
		    document.documentElement.scrollTop = scrOfY;
		  }
	}
	this.getmousexy = function (e) {	
			var posx = 0;	var posy = 0;	
			if (!e) var e = window.event;
			if (e.pageX || e.pageY) 	{		
				posx = e.pageX;		
				posy = e.pageY;	
			}	else if (e.clientX || e.clientY) 	{		
				posx = e.clientX + document.body.scrollLeft	+ document.documentElement.scrollLeft;		
				posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;	
			}	
			return [ posx, posy ];
	}	
	this.geteventtype = function (e) {
			if (!e) var e = window.event;
			alert(e.type);
	}
	this.isrightclick= function (e) {
			var rightclick;
			if (!e) var e = window.event;
			if (e.which) 
				rightclick = (e.which == 3);
			else if (e.button) 
				rightclick = (e.button == 2);
			return rightclick; // true or false
	}
	this.getkeypressed = function (e) {
			var code;
			if (!e) var e = window.event;
			if 
				(e.keyCode) code = e.keyCode;
			else if 
				(e.which) code = e.which;
			var character = String.fromCharCode(code);
			return [character, code];
	}
	this.isie = function() {
			return navigator.userAgent.indexOf("MSIE") != -1;
	}
}
