var menuids=["htree1","subtree"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){
for (var i=0; i<menuids.length; i++){
if (document.getElementById(menuids[i]))
{
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    	ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.visibility="visible"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.visibility="hidden"
    }
    }
  }
}  
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)

var menuidsv=["vtree1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus(){
if (document.getElementById(menuids[i]))
{
for (var i=0; i<menuidsv.length; i++){
  var ultags=document.getElementById(menuidsv[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
		if (ultags[t].parentNode.parentNode.id==menuidsv[i]) //if this is a first level submenu
			ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
		else //else if this is a sub level submenu (ul)
		  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
		for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
		ultags[t].style.visibility="visible"
		ultags[t].style.display="none"
		}
  }
}
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)



function stampa_popup() {
var testo = "<html><head><title></title><link  href=./css/tokabe/tokabe.css rel=stylesheet type=text/css></head>";
testo += "<body>";
testo += "<table width=\"608\" border=\"0\"><tr><td><br><br>";
testo += document.getElementById('livello1').innerHTML+"</td></tr></table>";
testo += "</body></html>";
var ident_finestra = window.open('','modulo','scrollbars=yes, height=1000,width=700');
ident_finestra.document.open();
ident_finestra.document.write(testo);
ident_finestra.document.close();
ident_finestra.print();
}

function stampa_documento() {
var testo = "<html><head><link  href=./css/tokabe/tokabe.css rel=stylesheet type=text/css></head>";
testo += document.getElementById('livello1').innerHTML;
testo += "</html>";
var ident_finestra = window.open('','','scrollbars=yes, height=1000,width=700');
ident_finestra.document.open();
ident_finestra.document.write(testo);
ident_finestra.document.close();
ident_finestra.print();
}

function pop_cancella() {
testo = "<html><head><link  href=./css/tokabe/tokabe.css rel=stylesheet type=text/css></head>";
testo += "<table width=\"390\" border=\"0\"><tr><td class=normale><img src=../css/tokabe/logo.gif border=0 align=left><td></tr><tr><td class=label align=center> Sei sicuro di voler cancellare definitivamente i dati ?<br><br><form method=POST action=./lib/Gestore.php5>";
testo += document.getElementById('livello6').innerHTML+"</td></tr></table></form>";
testo += "</body></html>";
var ident_finestra = window.open('','','height=200,width=400');
ident_finestra.document.open();
ident_finestra.document.write(testo);
ident_finestra.document.close();
}

function pop_cg(link) {
var l=link
var testo = "<html><head><title>Attenzione !</title><link  href=./css/tokabe/tokabe.css rel=stylesheet type=text/css><SCRIPT language=\"JavaScript\" type=\"text/javascript\" src=\"./lib/javascript/opener.js\"></SCRIPT></head>";
testo += "<body>";
testo += "<table width=\"390\" border=\"0\"><tr><td><img src=./css/main/logo.gif border=0><td></tr><tr><td class=label align=center> Sei sicuro di voler cancellare definitivamente i dati ?<br><br> Verr&agrave; cancellato il contenuto selezionato e tutti i contenuti derivati<br><a href=\"javascript:updateParent('"+link+"')\"><img src=./css/main/cancella.gif border=0 align=left></a></td></tr></table>";
testo += "</body></html>";
var ident_finestra = window.open('','modulo','height=200,width=390');
ident_finestra.document.open();
ident_finestra.document.write(testo);
opener.document.location.href=link
close();
ident_finestra.document.close();
}

var bSupportsRollover = (((navigator.appName == "Netscape") && parseInt(navigator.appVersion) >= 3 ))  || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));

function rollover( imageName, newImage )
{
	if ( bSupportsRollover )
		document.images[imageName].src = eval(newImage + ".src")
}

if ( bSupportsRollover )
{
		arrow_on = new Image();
		arrow_on.src = "css/<? print $_SESSION[stile];?>/rombion.gif";
		arrow_off = new Image();
		arrow_off.src = "css/<? print $_SESSION[stile];?>/rombioff.gif";

}
function MM_openBrWindow(theURL,winName,features) {
wopen=window.open(theURL,winName,features);
wopen.focus();
}

function apriJPG(file, w, h)
{
var dimensioni="'scroll=no, width="+w+",height="+h+"'";
var testo="<html><title>TOKABE</title><body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" bgcolor=\"#000000\"><div align=center><img src=\"./upload/prodotti/"+file+"\" border=0></div></body></html>";
var ident_finestra = window.open('', '', dimensioni);
ident_finestra.document.open();
ident_finestra.document.write(testo);
ident_finestra.document.close();
}

function caricaFlash(val,w,h)
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'" hspace="0" vspace="0">\n');
    document.write('<param name="movie" value="'+val+'">\n');
	document.write('<param name="quality" value="high">\n');
	document.write('<param name="SCALE" value="exactfit">\n');
	document.write('<embed src="'+val+'" quality="high"  width="'+w+'" height="'+h+'" hspace="0" vspace="0" name="lay" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" scale="exactfit" pluginspage="http://www.macromedia.com/go/getflashplayer">\n');
    document.write('</object>');
}