var browserName=navigator.appName;

sfHover = function() {
	var sfEls = document.getElementById("nav").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('content').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + 163) >= 0) {
				if (browserName=="Microsoft Internet Explorer") {
					footerElement.style.top = (windowHeight - (contentHeight +170)) + 'px';
				} else {
					footerElement.style.top = (windowHeight - (contentHeight +163)) + 'px';
					footerElement.style.height = '70px';
				}
			}
			else {
				if (browserName=="Microsoft Internet Explorer") {
					footerElement.style.top = '0px';
				} else {
					footerElement.style.height = '79px';
				}
			}
		}
	}
}
window.onload = function() {
	setFooter();
	doPopups();
}
window.onresize = function() {
	setFooter();
}


function tmt_winLaunch(theURL,winName,targetName,features) { 
eval(winName+"=window.open('"+theURL+"','"+targetName+"','"+features+"')")
}




function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links=document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("popup")) {
      links[i].onclick=function() {
      // Next two lines should be on one line
        window.open(this.href, "","top=40,left=40,width=630,height=505,status=yes,scrollbars=yes,resizable=yes");
        return false;
      }
    }
  }
}
