var myMenu1 = new ypSlideOutMenu("menu1", "down", 0, 36, 500, 500)
var myMenu2 = new ypSlideOutMenu("menu2", "down", 0, 36, 500, 500)
var myMenu3 = new ypSlideOutMenu("menu3", "down", 0, 36, 500, 500)
var myMenu4 = new ypSlideOutMenu("menu4", "down", 0, 36, 500, 500)
ypSlideOutMenu.writeCSS();

var currentStep;
function initPage ()
{
	//init navigation
	var n = document.getElementById("nav");
	if (n) {
		var nodes = n.getElementsByTagName("li");
		for (var i = 0; i < nodes.length; i++){
			var d = nodes[i].getElementsByTagName("div").item(0);
			if (d) {
				var a = nodes[i].getElementsByTagName("a").item(0);
				a.menuIndex = d.id.substr(0, 5);
				a.onmouseover = function () { ypSlideOutMenu.showMenu(this.menuIndex); }
				a.onmouseout = function () { ypSlideOutMenu.hideMenu(this.menuIndex); }
			}
		}
	}
	//init steps
	var steps = document.getElementById("steps");
	if (steps)
	{
		currentStep = 1; //step 1 by default
		var links = steps.getElementsByTagName("a");
		for (var i = 0; i < links.length; i++)
		{
			links[i].onclick = function ()
			{
				if (this.className.indexOf("active") == -1)
				{
					document.getElementById("step" + currentStep).className = "hidden";
					links[currentStep - 1].className = links[currentStep - 1].className.replace(" active", "");
					currentStep = this.href.substr(this.href.indexOf("#") + 5);
					document.getElementById("step" + currentStep).className = "";
					links[currentStep - 1].className += " active";
				}
				return false;
			}
		}
	}
}

function openVideo(node)
{
	var f = document.getElementById("video-frame");
	if (f)
	{
		f.src = node.href;
		f.className = "open";
	}
	return false;
}

function closeVideo()
{
	var f = document.getElementById("video-frame");
	if (f)
		f.className = "";
}

if (window.addEventListener)
	window.addEventListener("load", initPage, false);
else if (window.attachEvent){
	window.attachEvent("onload", initPage);
	}
	
	function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}