var Helper = {
	windowWidth:0,
	windowHeight:0,
	hideSelects:function(){
		var sel = document.body.getElementsByTagName('select');
		for(var i=0;i<sel.length;i++){
			sel[i].style.visibility = 'hidden';
		}
	},
	showSelects:function(){
		var sel = document.body.getElementsByTagName('select');
		for(var i=0;i<sel.length;i++){
			sel[i].style.visibility = 'visible';
		}
	},
	openOverlay:function(){
		if($el('overlay')) document.body.removeChild($el('overlay'));
		var overlay = document.createElement('div');
		overlay.setAttribute("id","overlay");
		overlay.style.height = Helper.winHeight()+'px';
		document.body.appendChild(overlay);
		Helper.hideSelects();
		if(/MSIE/.test(navigator.userAgent)) {
			$el('overlay').style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=40)";
		}
	},
	closeOverlay:function(){
		if($el('overlay')) document.body.removeChild($el('overlay'));
		Helper.showSelects();
	},
	getScrollXY:function() {
  		var scrOfX = 0, scrOfY = 0;
 		if( typeof( window.pageYOffset ) == 'number' ) {
   		  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 new Array(scrOfX,scrOfY);
	},
	win:function(){
		var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	wh = windowHeight;
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	},
	windowHeight:function(){
		return wh;
	},
	winHeight:function(){
		this.win();
		return pageHeight;
	},
	winWidth:function(){
		this.win();
		return pageWidth;
	}
}