var curSub;
var outV;

function kSub(x) {
	x.className = x.className.replace(new RegExp("sfhover \\b"), "");
}

navHover = function () {
	if (!document.getElementById("nav")) {
		return;
	}
	
	var mAs = document.getElementById("nav").getElementsByTagName("a");
	
	for (var i = 0; i<mAs.length; i++) {
		mAs[i].onmouseover = function() {
			if (this.className == "tnavlink") {
				if ((curSub != "") && (curSub != null)) {
					kSub(curSub);
				}
				clearTimeout(outV);
				curSub = this.parentNode;
				this.parentNode.className = "sfhover "+this.parentNode.className;
			}
		};
		
		mAs[i].onmouseout = function() {
			if (this.className == "tnavlink") {
				outV = setTimeout("kSub(curSub)", 1250);
			}
		};
	}
	
	if (!document.getElementById("navul")) {
		return;
	}
	
	var mULs = document.getElementById("navul").getElementsByTagName("ul");
	
	for (var i = 0; i<mULs.length; i++) {
		mULs[i].onmouseover = function() {
			clearTimeout(outV);
		};
		mULs[i].onmouseout = function() {
			outV = setTimeout("kSub(curSub)", 1250);
		};
	}
};

var windowArgs = "resizable=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no";

function popDemo(product, width, height) {
	var demoWin = window.open("/flash/demos/"+product+"/", "demo", "width="+width+",height="+height+","+windowArgs);
	demoWin.focus();
}

function popMFE(prodID, page, ref) {
	var mfeWin = window.open("/products/demo.php?prodID="+prodID+"&page="+page+"&ref="+ref, "mfe", "width=620,height=350,"+windowArgs);
	mfeWin.focus();
}

function popPlayer(path) {
	var playerWin = window.open("/flash/player/?path="+path, "player", "width=324,height=240,"+windowArgs);
	playerWin.focus();
}

function popWindow(url, id, width, height) {
	var newWin = window.open(url, id, "width="+width+",height="+height+","+windowArgs);
	newWin.focus();
}

function downloadFile(FileName) {
	switch (FileName) {
	case "/support/genappstools/bin/SMFPLAYR.ZIP" :
		FileName = "SMFPLAYR.ZIP";
		break;
	case "/support/genappstools/bin/QMIDI.sit.hqx" :
		FileName = "qmidi161.sit";
		break;
	case "/support/genappstools/bin/SysExLibrarian.dmg" :
		FileName = "SysExLibrarian.dmg";
		break;
	case "/support/genappstools/bin/sdisk.zip" :
		FileName = "sdisk.zip";
	}
	window.location = "/support/downloads_updates/eula.php?FileName="+FileName;
}

var addthis_brand = "Roland U.S.";
var addthis_hover_delay = 200;

window.onload = navHover;
