/*
	determines browser
*/
function dudiBrowser() {
	var agt=navigator.userAgent.toLowerCase();

	// is DOM
	this.DOM = document.getElementById?1:0;

	// is IE
	this.IE = document.all?1:0;

	// is IE
	this.IE5 = this.IE?(document.hasFocus?0:1):0;
	
	// is IE
	this.IE55 = this.IE?(agt.indexOf("msie 5.5")!=-1):0;

	// is IE
	this.IE6 = this.IE?(agt.indexOf("msie 6")!=-1):0;
	
	// is NS
	this.NS = (!this.DOM && !this.IE)?1:0

	// is on mac
	this.MAC = (agt.indexOf("mac")!=-1);
	
	// is on mac safari
	this.SAFARI = (agt.indexOf("safari")!=-1);
	
	// is on win 98
    this.WIN9X = (agt.indexOf("windows 9")!=-1);
    
    // getting height info
    this.height = function () {
    	
    	return  (this.IE5 || this.IE55)?document.body.clientHeight:document.documentElement.clientHeight
    	
	}
	
	
	this.windowHeight = function () {
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myHeight = document.body.clientHeight;
	  }
	 
		 return myHeight;
	}
	
	this.windowSize = 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 [myHeight,myWidth];
	}
	
	this.getPageSizeWithScroll = function (){
		if (window.innerHeight && window.scrollMaxY) {// Firefox
			yWithScroll = window.innerHeight + window.scrollMaxY;
			xWithScroll = window.innerWidth + window.scrollMaxX;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			yWithScroll = document.body.scrollHeight;
			xWithScroll = document.body.scrollWidth;
		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
			yWithScroll = document.body.offsetHeight;
			xWithScroll = document.body.offsetWidth;
	  	}
	  	
	  	if(yWithScroll<this.height()) {
	  		yWithScroll = this.height();
	  	}
		arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
		//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
		return arrayPageSizeWithScroll;
	}
	
	 // getting height info
    this.width = function () {
		return (this.IE5 || this.IE55)?document.body.clientWidth:document.documentElement.clientWidth;
	}
	
	this.getScrollPos = function () {
		
		return (document.all ? document.documentElement.scrollTop : window.pageYOffset);
	}
	
	this.contentSize = function () {
		if (window.innerHeight && window.scrollMaxY) {// Firefox
			yWithScroll = window.innerHeight + window.scrollMaxY;
			xWithScroll = window.innerWidth + window.scrollMaxX;
		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
			yWithScroll = document.body.offsetHeight;
			xWithScroll = document.body.offsetWidth;
	  	}
	  	return [xWithScroll,yWithScroll];
	}

}