// JavaScript Document
function initMenu() {
	var li_ = document.getElementsByTagName('li');
	for (i=0;li = li_[i];i++)
		if(li.className && li.className=="more") {
			for (j=0; j<li.childNodes.length; j++) 
				if (li.childNodes[j].nodeName.toLowerCase()=="ul") li.subMenu = li.childNodes[j];
			li.subMenu.className = "subMenu-off";
			li.onmouseover = li.onactivate = li.onfocus = function() { this.subMenu.className = "menuOn" };
			li.onmouseout = li.ondeactivate = li.onblur = function() { this.subMenu.className = "menuOff" };
		}
}
//window.onload = function(e) {
//if(document.getElementsByTagName('body')) initMenu() ;
//}


//********************* X FLASH MENU
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

// Gestisce tutti i messaggi FSCommand in un filmato Flash
function menu_DoFSCommand(command, args) {
	//var menuObj = document.getElementById("menu");
	var menuObj = isInternetExplorer ? document.all.menu : document.menu;
	//
  	if (command == "strumento") {
		//alert(command + ":" + args)
		menuObj.SetVariable("_root.scena", args);  
	}
  	if (command == "idioma") {
		//alert(command + ":" + args)
		menuObj.SetVariable("_root.idioma", args);  
	}
	//
}
// Hook per Internet Explorer
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub menu_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call menu_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

//change below target URL to your own
//var targetURL="http://www.html.it"
//change the second to start counting down from
var countdownfrom=1;

var currentsecond=countdownfrom+1
function countredirect(piano,idioma){
	if (currentsecond!=1){
		currentsecond-=1
	}else{
		menu_DoFSCommand('idioma', idioma);
		menu_DoFSCommand('strumento', piano);
		//window.location=targetURL
		return
	}
	eval("setTimeout(\"countredirect('" + piano + "','" + idioma + "')\",500)");
}

window.onload = function(e) {
	if(document.getElementsByTagName('body')){ 
		initMenu();
		countredirect(piano,idioma);
	}
}

//********************* FINE X FLASH MENU
