// JavaScript Document







// --------------------------------------------------------
// toggles visibility of the passed element/id
// --------------------------------------------------------
function toggleVisibility(elem) {
	elem = document.getElementById(elem);
	if ( elem.style.display != "none" ) {
		elem.style.display = 'none';
	}
	else {
		elem.style.display = '';
	}
}

// --------------------------------------------------------
// 
// --------------------------------------------------------
function getWindowHeight() {
	if (self.innerHeight) {
		  frameHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		  frameHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		  frameHeight = document.body.clientHeight;
	}
	return frameHeight;
}
function getWindowWidth() {
	if (self.innerWidth) {
		  frameWidth = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		  frameWidth = document.documentElement.clientWidth;
	} else if (document.body) {
		  frameWidth = document.body.clientWidth;
	}
	return frameWidth;
}

// --------------------------------------------------------
// 
// --------------------------------------------------------
function SetBackgroundHeight() {
	var string = '';
	
	wh = getWindowHeight();
	string = string + 'window height: ' + wh;
	
	ww = getWindowWidth();
	string = string + '<br>window width: ' + ww;
		
	bh = document.getElementById("container").clientHeight;
	string = string + '<br>siteBody height: ' + bh;

	bw = document.getElementById("siteBody").clientWidth;
	string = string + '<br>siteBody width: ' + bw;


	document.getElementById('siteBody').style.width = ww + 'px';
	document.getElementById('container').style.minHeight = bh + 'px';
	document.getElementById('custom_background').style.width = (ww - 0) + 'px';
	document.getElementById('custom_background').style.minHeight = (wh + 2500) + 'px';
	string = string + '<br>siteBody width = ' + ww + 'px | custom_bg width = ' + (ww - 0) + 'px | custom_bg min-height = ' + (wh - 0) + 'px';

	document.getElementById("console").innerHTML = string;

}

