/**
 * @author Andrew
 */

sfHover = function()
	{
		var sfEls = document.getElementById("menu").getElementsByTagName("LI");
		for (var i = 0; i < sfEls.length; i++) {
			sfEls[i].onmouseover = function(){
				this.className += " sfhover";
			}
			sfEls[i].onmouseout = function(){
				this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setFooter() 
{
	if (document.getElementById) 
	{
		var windowHeight=getWindowHeight();
		if (windowHeight>0) 
		{
			var contentHeight= document.getElementById('container').offsetHeight;
			var footerElement= document.getElementById('footer');
			var footerHeight=footerElement.offsetHeight;
			if (windowHeight-(contentHeight+footerHeight)>=0) 
			{
				footerElement.style.position='relative';
				footerElement.style.top=(windowHeight-(contentHeight+footerHeight))+'px';
			}
			else 
			{
				footerElement.style.position='static';
			}
		}
	}
}

window.onload = function() 
{
  setFooter();
}

window.onresize = function() 
{
  setFooter();
}


function newPopup(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}


