var menuids=new Array("verticalmenu") //Enter id(s) of UL menus, separated by commas
var submenuoffset=-2 //Offset of submenus from main menu. Default is -2 pixels.

function createcssmenu(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    var spanref=document.createElement("span")
		spanref.className="arrowdiv"
		spanref.innerHTML="&nbsp;&nbsp;"
		ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px"
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  }
}
if (window.addEventListener)
window.addEventListener("load", createcssmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu)
// get the height of the window so that we can set the footer at the bottom of the page
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;
}
// put the footer at the bottom
function setFooter() {
	if (document.getElementById) {
		var windowHeight=getWindowHeight();
		if (windowHeight>0) {
			var contentHeight=document.getElementById('centercontent').offsetHeight;
			var bannerHeight=document.getElementById('banner').offsetHeight + 50; //50 for the margins
			var footerElement=document.getElementById('footer');
			var footerHeight=footerElement.offsetHeight;
			if (windowHeight-(bannerHeight+contentHeight+footerHeight)>=0) {
				footerElement.style.position='relative';
				footerElement.style.top=(windowHeight-(bannerHeight+contentHeight+footerHeight))+'px';
			} else {
				footerElement.style.position='static';
			}
		}
	}
}

if (window.addEventListener) {
	window.addEventListener("load", setFooter, false);
	window.addEventListener("resize", setFooter, false);
}else if (window.attachEvent) {
	window.attachEvent("onload", setFooter);
	window.attachEvent("onresize", setFooter);
}
//displays the privacy statment in new window
function showPrivacy() {
         popup=window.open('http://www.fit-equipment.com/privacy.php', 'privacy',
'dialog,modal,scrollbars=yes,resizable=yes,width=600,height=400,left=0,top=0');
}
