// Function to open a new window
function qtwin(URL,WNUM,HNUM) { popupWinqt = window.open(URL, 'qt', 'scrollbars=no,status=yes,width='+WNUM+',height='+HNUM+''); }

// Function to go back to the top
function backToTop(){ window.scroll(0, 0);}



// Function to Dynamically set the RIGHT COLUMN CONTENT to the bottom of the page above the footer
/*function setRightcontent() {
	if (document.getElementById) {
		var footerElement = document.getElementById('footer');
		var rightcontentElement = document.getElementById('rightcontent');
		var rightcontentHeight  = rightcontentElement.offsetHeight;
		rightcontentElement.style.position = 'absolute';
		newTop = footerElement.offsetTop - rightcontentHeight;
		rightcontentElement.style.top = newTop + 'px';
		rightcontentElement.style.top = 417 + 'px';
		rightcontentElement.style.left = footerElement.offsetLeft;//555 + 'px';
	}
}*/
// Function to Dynamically set the FOOTER at the end of the content
/*function setFooter() {
	if (document.getElementById) {
		var contentHeight = document.getElementById('content').offsetHeight + document.getElementById('content').offsetTop;
		var footerElement = document.getElementById('footer');
		var footerHeight  = footerElement.offsetHeight;
		if (contentHeight < 590) {
		    alert(contentHeight);
			footerElement.style.position = 'absolute';
			footerElement.style.top = '590px';//contentHeight + 'px';
			setRightcontent();
		}
	}
}*/



function setFooter() {
	if (document.getElementById) {
		var contentHeight = document.getElementById('content').offsetHeight; // + document.getElementById('content').offsetTop;
		var body2Element = document.getElementById('contentBody2');
		var body2Height  = body2Element.offsetHeight;
		var footerElement = document.getElementById('contentFooter');
		if (contentHeight > 335) {
			body2Element.style.position = 'relative';
			positionOffset = 335 - contentHeight;
			body2Element.style.top = positionOffset + 'px';
			body2Element.style.height = -positionOffset + 'px';
			body2Element.style.zIndex = "1";
			document.getElementById('content').style.zIndex = "50";
			footerElement.style.top = positionOffset + 'px';
			//alert(body2Element.style.zIndex);
		}
	}
}

