var clicked=""
var gtype=".gif"
var selstate="_over"

if(!document.all) 
document.write("<div id=\"fr\" style=\"display:inline; width:0px; height:0px;\"></div>"); 
else 
document.write("<div id=\"fr\" style=\"display:none; width:0px; height:0px;\"></div>"); 
function bgsound(url) { 
if(!document.all)
document.getElementById("fr").innerHTML="<embed id=\"m\" type=\"application/x-mplayer2\" src=\""+url+"\" autostart=\"1\" showcontrols=\"0\" loop=\"0\" hide=\"1\" width=\"0\" height=\"0\">"; 
else 
document.getElementById("fr").innerHTML="<object type=\"application/x-mplayer2\" codebase=\"&lt;a href=\" http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=\"6,4,7,1112&quot;\" target=\"_blank\" height=\"0\" width=\"0\"><param name=\"AutoStart\" value=\"true\"><param name=\"ShowControls\" value=\"false\"><param name=\"ShowStatusBar\" value=\"false\"><param name=\"filename\" value=\""+url+"\"><param name=\"loop\" value=\"false\"></object>";
}

if (typeof(loc)=="undefined" || loc==""){
	var loc=""
	if (document.body&&document.body.innerHTML){
		var tt = document.body.innerHTML.toLowerCase();
		var last = tt.indexOf("pulsante.js\"");
		if (last>0){
			var first = tt.lastIndexOf("\"", last);
			if (first>0 && first<last) loc = document.body.innerHTML.substr(first+1,last-first-1);
		}
	}
}

document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>");
document.write("<td><img src=\""+loc+"pulsante_top.gif\" alt=\"\" width=\"133\" height=\"23\"></td>");
tr(false);
writeButton(loc+"","../home.htm","pulsante_b1",133,29,"","",0);
writeButton(loc+"","../tv.htm","pulsante_b2",133,29,"","",0);
writeButton(loc+"","../galleria_intro.htm","pulsante_b3",133,29,"","",0);
writeButton(loc+"","../guestbook.htm","pulsante_b4",133,29,"","",0);
writeButton(loc+"","../chat.htm","pulsante_b5",133,29,"","",0);
writeButton(loc+"","../contatti.htm","pulsante_b6",133,29,"","",0);
writeButton(loc+"","../links.htm","pulsante_b7",133,29,"","",0);
tr(true);
document.write("<td><img src=\""+loc+"pulsante_bottom.gif\" alt=\"\" width=\"133\" height=\"23\"></td>");
document.write("</tr></table>")
loc="";

function tr(b){if (b) document.write("<tr>");else document.write("</tr>");}

function turn_over(name) {
	if (document.images != null && clicked != name) {
		document[name].src = document[name+"_over"].src;
	}
}

function turn_off(name) {
	if (document.images != null && clicked != name) {
		document[name].src = document[name+"_off"].src;
	}
}

function turn_on(name) {
	if (document.images != null && clicked != name) {
		document[name].src = document[name+"_over"].src;
		bgsound('pulsanti/click.mp3');
	}
}

function reg(gname,name)
{
if (document.images)
	{
	document[name+"_off"] = new Image();
	document[name+"_off"].src = loc+gname+gtype;
	document[name+"_over"] = new Image();
	document[name+"_over"].src = loc+gname+"_over"+gtype;
	}
}

function evs(name){ return " onclick=\"turn_on('"+ name + "')\" onmouseover=\"turn_over('"+ name + "')\" onmouseout=\"turn_off('"+ name + "')\""}

function writeButton(urld, url, name, w, h, alt, target, hsp)
{
	gname = name;
	while(typeof(document[name])!="undefined") name += "x";
	reg(gname, name);
	tr(true);
	document.write("<td>");
	if (alt != "") alt = " alt=\"" + alt + "\"";
	if (target != "") target = " target=\"" + target + "\"";
	if (w > 0) w = " width=\""+w+"\""; else w = "";
	if (h > 0) h = " height=\""+h+"\""; else h = "";	
	if (url != "") url = " href=\"" + urld + url + "\"";
	
	document.write("<a " + url + evs(name) + target + ">");	
	
	if (hsp == -1) hsp =" align=\"right\"";
	else if (hsp > 0) hsp = " hspace=\""+hsp+"\"";
	else hsp = "";
	
	document.write("<img src=\""+loc+gname+gtype+"\" name=\"" + name + "\"" + w + h + alt + hsp + " border=\"0\" /></a></td>");
	tr(false);
}
