function getPageSize() {
	        
	 var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;		
	} else if (document.scrollHeight > document.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
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			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.clientWidth;
		windowHeight = document.clientHeight;				
	}	
	
	// 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 = xScroll;		
	} else {
		pageWidth = windowWidth;
	}

	//alert (pageWidth + " " + pageHeight);
	return [pageWidth,pageHeight];
}


function getOverlay() {	
	var over = document.getElementById('overlay');
	var popup = document.getElementById('lightbox');
	
	var arrayPageSize = this.getPageSize();
	over.style.width = arrayPageSize[0] + 'px';
	over.style.height = arrayPageSize[1] + 'px';
	
	popup.style.display = 'block';
}

function closeOverlay(){

	var over = document.getElementById('overlay');
	var popup = document.getElementById('lightbox');
	
	var arrayPageSize = this.getPageSize();
	over.style.width = '0px';
	over.style.height = '0px';
	
	popup.style.display = 'none';	
}

function showHide(id) {
	e = document.getElementById(id);

	if (e.style.display == 'none') {
		e.style.display = 'block';
	} else if (e.style.display == 'block') {
		e.style.display = 'none';
	}	
}
//////////////////////////////////////////////////////////////////////////////
//updateDiv
//
//Desc: Calls a special version of updateContentArea just for use with
//run.php
//////////////////////////////////////////////////////////////////////////////
function updateDiv(divName,funct_name,param1,param2,param3,param4){
	
	if(divName=="sections"){	
		var section = document.getElementById(divName);
		switch(param1){
			case "1":
				section.className = "sectionsHome";			
				break;
			case "2":
				section.className = "sectionsNewcomers";			
				break;
			case "3":
				section.className = "sectionsDevelopers";			
				break;
			case "4":
				section.className = "sectionsCitizens";			
				break;
			}
		}												
	
	var vars = "function_name="+funct_name+"&param1="+param1+"&param2="+param2+"&param3="+param3+"&param4="+param4;	
	updateContentArea(divName,vars,'run.php');
	
}//end function
//////////////////////////////////////////////////////////////////////////////
//setFormHeight
//
//
//Desc: Ta forms hack/fix for ht issues
//////////////////////////////////////////////////////////////////////////////
function setFormHeight(ht){

	//pae form height fix
	var obj = document.getElementById('taForm');	
	obj.style.height = ht;

}
