var subMenus = new Array();
//alert (subMenus.length);
var timeLeft;
var k = 0;

function showMenu(menName){
window.clearTimeout(timeLeft);
for (i=0;i<subMenus.length;i++){
document.getElementById('punt' + subMenus[i]).style.visibility = 'hidden';
document.getElementById(subMenus[i]).style.visibility = 'hidden';
}
document.getElementById(menName).style.visibility = 'visible';
document.getElementById('punt' + menName).style.visibility = 'visible';
}
function hideMenu(menName){

for (i=0;i<subMenus.length;i++){
document.getElementById('punt' + subMenus[i]).style.visibility = 'hidden';
document.getElementById(subMenus[i]).style.visibility = 'hidden';
}
}
function makeMenu(width, align, border, bStyle, bColor, padding, lHeight, left, top, wSpace, bkColor, voices){
this.width = width;
this.border = border;
this.bColor = bColor;
this.left = left;
this.top = top;
this.padding = padding;
this.bStyle = bStyle;
this.lHeight = lHeight;
this.wSpace = wSpace;
this.bkColor = bkColor;
this.vAlign = lHeight;
this.align = align;
var comName;
var fullMenuText = "";
fullMenuText = fullMenuText + ("<div style = 'position: absolute; left: " + this.left + "px; top: " + this.top);
fullMenuText = fullMenuText + ("px; width: " + this.width + "px;'>");

for (i=0;i<voices[0].length;i++){
	if ((voices[1][i] == "#")||(voices[0][i] == miTrovoIn)){
	fullMenuText = fullMenuText + ("<span class = 'morto' style = 'position: absolute; left: 0");
	fullMenuText = fullMenuText + ("px; top: " + (this.wSpace + this.lHeight+  (this.padding*2) + (this.border*2)) * i + "px; height: " + ((this.lHeight*1) + 2));
	fullMenuText = fullMenuText + ("px; line-height: " + this.vAlign+ "px; width: " + voices[2][i] + "px;");
	fullMenuText = fullMenuText + (" background-color: " + this.bkColor + "; text-align: " + this.align + "; ");
	fullMenuText = fullMenuText + ("border: " + this.border + "px " + this.bStyle + " " + this.bColor + "; padding: " + this.padding + "px;'>");
	fullMenuText = fullMenuText + (voices[0][i] + "</span>"); 
	}
	else if (voices[1][i].substring(0,3) != "***"){
	fullMenuText = fullMenuText + ("<a href = '" + voices[1][i] +"' class = 'attivo' style = 'position: absolute; left: 0");
	fullMenuText = fullMenuText + ("px; top: " + (this.wSpace + this.lHeight+ (this.padding*2) + (this.border*2)) * i + "px; height: " + this.lHeight);
	fullMenuText = fullMenuText + ("px; line-height: " + this.vAlign + "px; width: " + voices[2][i] + "px;");
	fullMenuText = fullMenuText + (" background-color: " + this.bkColor + "; text-align: " + this.align + "; ");
	fullMenuText = fullMenuText + ("border: " + this.border + "px " + this.bStyle + " " + this.bColor + "; padding: " + this.padding + "px;'>");
	fullMenuText = fullMenuText + (voices[0][i] + "</a>"); 
	}
	else{
	comName = 'timeLeft = window.setTimeout("hideMenu(/' + voices[1][i].substring(3) + '/)",500);'
	fullMenuText = fullMenuText + ("<a href = '#' onmouseover = 'showMenu(");
	fullMenuText = fullMenuText +('"' + voices[1][i].substring(3) + '"');
	fullMenuText = fullMenuText + (");' onmouseout='");
	fullMenuText = fullMenuText + (comName);
	fullMenuText = fullMenuText + ("' class = 'attivo' style = 'position: absolute; left: 0");
	fullMenuText = fullMenuText + ("px; top: " + (this.wSpace + this.lHeight+  (this.padding*2) + (this.border*2)) * i + "px; height: " + this.lHeight);
	fullMenuText = fullMenuText + ("px; line-height: " + this.vAlign + "px; width: " + voices[2][i] + "px;");
	fullMenuText = fullMenuText + (" background-color: " + this.bkColor + "; text-align: " + this.align + "; ");
	fullMenuText = fullMenuText + ("border: " + this.border + "px " + this.bStyle + " " + this.bColor + "; padding: " + this.padding + "px;'>");
	fullMenuText = fullMenuText + (voices[0][i] + "</a>"); 
	subMenus.length = subMenus.length + 1;
	subMenus[subMenus.length -1] = voices[1][i].substring(3);
	}
}
fullMenuText = fullMenuText + ("</div>");
document.write(fullMenuText);
//alert(fullMenuText);
}

function makeSubMenu(width, align, border, bStyle, bColor, padding, lHeight, left, top, wSpace, bkColor, voices, name){
this.width = width;
this.border = border;
this.bStyle = bStyle;
this.bColor = bColor;
this.left = left;
this.top = top;
this.padding = padding;
this.lHeight = lHeight;
this.wSpace = wSpace;
this.bkColor = bkColor;
this.vAlign = lHeight;
this.align = align;
this.name = name;
var comName;
var fullMenuText = "";

fullMenuText = fullMenuText + ("<div style = 'position: absolute; left: " + this.left + "px; top: " + this.top);
fullMenuText = fullMenuText + ("px; width: " + this.width + "px; visibility: hidden;' onmouseover = '");
fullMenuText = fullMenuText + ("window.clearTimeout(timeLeft);' onmouseout = 'timeLeft = window.setTimeout(");
fullMenuText = fullMenuText + ('"hideMenu(/' + this.name + '/)","500");');
fullMenuText = fullMenuText + ("' id = '" + this.name + "'>");
for (i=0;i<voices[0].length;i++){
	if ((voices[1][i] == "#")||(voices[0][i] == miTrovoIn)){
	fullMenuText = fullMenuText + ("<span class = 'morto' style = 'position: absolute; left: 0");
	fullMenuText = fullMenuText + ("px; top: " + (this.wSpace + this.lHeight+  (this.padding*2) + (this.border*2)) * i + "px; height: " + ((this.lHeight*1) + 2));
	fullMenuText = fullMenuText + ("px; line-height: " + this.vAlign + "px; width: " + voices[2][i] + "px;");
	fullMenuText = fullMenuText + (" background-color: " + this.bkColor + "; text-align: " + this.align + "; ");
	fullMenuText = fullMenuText + ("border: " + this.border + "px " + this.bStyle + " " + this.bColor + "; padding: " + this.padding + "px;'>");
	fullMenuText = fullMenuText + (voices[0][i] + "</span>"); 
	}
	else if (voices[1][i].substring(0,3) != "***"){
	fullMenuText = fullMenuText + ("<a href = '" + voices[1][i] +"' class = 'attivo' style = 'position: absolute; left: 0");
	fullMenuText = fullMenuText + ("px; top: " + (this.wSpace + this.lHeight+  (this.padding*2) + (this.border*2)) * i + "px; height: " + this.lHeight);
	fullMenuText = fullMenuText + ("px; line-height: " + this.vAlign + "px; width: " + voices[2][i] + "px;");
	fullMenuText = fullMenuText + (" background-color: " + this.bkColor + "; text-align: " + this.align + "; ");
	fullMenuText = fullMenuText + ("border: " + this.border + "px " + this.bStyle + " " + this.bColor + "; padding: " + this.padding + "px;'>");
	fullMenuText = fullMenuText + (voices[0][i] + "</a>"); 
	}
	else{
	comName = 'timeLeft = window.setTimeout("hideMenu(/' + voices[1][i].substring(3) + '/)",500);'
	fullMenuText = fullMenuText + ("<a href = '#' onmouseover = 'showMenu(");
	fullMenuText = fullMenuText +('"' + voices[1][i].substring(3) + '"');
	fullMenuText = fullMenuText + (");' onmouseout='");
	fullMenuText = fullMenuText + (comName);
	fullMenuText = fullMenuText + ("' class = 'attivo' style = 'position: absolute; left: 0");
	fullMenuText = fullMenuText + ("px; top: " + (this.wSpace + this.lHeight+  (this.padding*2) + (this.border*2)) * i + "px; height: " + this.lHeight);
	fullMenuText = fullMenuText + ("px; line-height: " + this.vAlign + "px; width: " + voices[2][i] + "px;");
	fullMenuText = fullMenuText + (" background-color: " + this.bkColor + "; text-align: " + this.align + "; ");
	fullMenuText = fullMenuText + ("border: " + this.border + "px " + this.bStyle + " " + this.bColor + "; padding: " + this.padding + "px;'>");
	fullMenuText = fullMenuText + (voices[0][i] + "</a>"); 
	subMenus.length = subMenus.length + 1;
	subMenus[subMenus.length -1] = voices[1][i].substring(3);	
	}
}
fullMenuText = fullMenuText + ("</div>");
document.write(fullMenuText);
}
//}