<!--


firstTit = 0;
ciccio = null;
ciccio2 = null;
currentFolder = "";
currentItem = "";
currentCol = "";

function chgClass(obj, clss)
   {
   obj.className = clss;
   }
	
function chgColor(obj, what, j)
   {
	if(what)
	   {
		currentCol = obj.style.backgroundColor;
		obj.style.backgroundColor = "transparent";
		obj.style.cursor = "pointer";
		document.getElementById("td" + j).style.color = "red";
		}
	else
	   {
		obj.style.backgroundColor = currentCol;
		obj.style.cursor = "";
		document.getElementById("td" + j).style.color = "black";
		}
   }
	
function emp_cv(obj)
   {
	if(obj.style.fontStyle == "italic")
	   {
		obj.style.fontStyle = "normal"; 
	   document.getElementById("td" + obj.id.substring(1)).style.backgroundColor = "transparent";
		}
	else
	   {
	   obj.style.fontStyle = "italic"; 
	   document.getElementById("td" + obj.id.substring(1)).style.backgroundColor = "#FFEF00";
		}
	}

function emp_shop(obj)
   {
	if(obj.style.fontStyle == "italic")
	   {
		obj.style.fontStyle = "normal"; 
	   document.getElementById("t_" + obj.id.substring(2)).style.backgroundColor = "transparent";
		}
	else
	   {
	   obj.style.fontStyle = "italic"; 
	   document.getElementById("t_" + obj.id.substring(2)).style.backgroundColor = "#FFEF00";
		}
	}
	
function emp_img(obj)
   {
	if(obj.style.borderColor.substring(0,3) == "red" ||
	obj.style.borderColor.substring(0,3) == "#ff")
	   obj.style.borderColor = "black";
	else
	   obj.style.borderColor = "red";
	}
	
function goTo(lnk, prm)
   {
   top.location.href = lnk + '.asp?' + prm;
   }

function apri_foto(idx, fgP)
   {
	if(screen.availWidth < 900)
	   {
		theWidth = "600";
		theHeight = "500";
		}
   else
	   {
	   theWidth = "700";
		theHeight = "600";
		}
	theLink = document.getElementById("img_" + idx).src;
	theLink = theLink.substring(theLink.indexOf("preview") + 8);
	while(theLink.indexOf("+") > 0)
	   {
		theLink = theLink.substring(0, theLink.indexOf("+")) + "¿" + 
		theLink.substring(theLink.indexOf("+") + 1);
		}
	winDett = window.open("./viewer.asp?fgP=" + fgP + 
	"&lf=" + theLink,"Foto","width=" + theWidth + "," +
	"height=" + theHeight + ",scrollbars=yes,resizable=yes");
	}

function apri_scheda(idx)
   {
	theWidth = "430";
	theHeight = "470";
	theLink = document.getElementById("sk_" + idx).innerHTML;
	while(theLink.indexOf("+") > 0)
	   {
		theLink = theLink.substring(0, theLink.indexOf("+")) + "¿" + 
		theLink.substring(theLink.indexOf("+") + 1);
		}
	winSk = window.open("./scheda.asp?ls=" + theLink,"Scheda","width=" + theWidth + "," +
	"height=" + theHeight + ",scrollbars=yes,resizable=yes");
	}
	
function apri_offerte()
   {
	theWidth = "430";
	theHeight = "470";
	winSk = window.open("./sk_off.asp","Offerte","width=" + theWidth + "," +
	"height=" + theHeight + ",scrollbars=yes,resizable=yes");
	}
		
function giraTit()
   {
	for(j=0;j<titArr.length; j++)
	   {
		firstTit = (firstTit >= titArr.length) ? (firstTit - titArr.length) : firstTit;
		spacer = j == 8 ? "" : "&nbsp;&nbsp;&nbsp;";
		if(j <= 8)
		   {
		   document.getElementById("t" + j).innerHTML =  
		   //"<a href=\"./menu/" + titArr[firstTit][0] + "/" + titArr[firstTit][1] + ".asp\" " +
			"<a href=\"" + titArr[firstTit][0] + ".asp\" " +
		   "title=\"" + titArr[firstTit][1] + "\" class='A_t" + j + "' " +
		   "onmouseover=\"this.style.fontStyle='italic';clearTimeout(ciccio);\" " +
		   "onmouseout=\"this.style.fontStyle='normal';ciccio = setTimeout('giraTit()', 1000);\">" +
		   "<b>" + spacer + titArr[firstTit][1] + "</b></a>";
		   }
		firstTit++;
		}
	firstTit++;
	ciccio = setTimeout("giraTit()", 1000);
	}	
	
function creaMenu(pagina)
   {
	tableMenu = "";
	tableMenu += "<table border=0 cellspacing=\"0\" cellpadding=\"0\" width=\"140\" align=\"left\">" +
   "<tr>" +
	"<td colspan=\"2\" height=\"150\" align=\"center\">" +
	"<a href=\"./\" title=\"Torna alla pagina iniziale\">"+
	"<img src=\"./componenti/logo_home.gif\" border=\"0\" " +
	"onmouseover=\"this.style.backgroundColor='red'\" onmouseout=\"this.style.backgroundColor=''\">" +
	"</a>" +
	"</td>" +
	"</tr>";
	for(j=0;j<titArr.length; j++)
	   {
		if(titArr[j][0] == pagina)
		   {
			currentFolder = titArr[j][0];
			currentItem = titArr[j][1];
			ico = "<img src=\"./componenti/2cv_icomezz.gif\">";
			}
		else
		   ico = "";
		tableMenu += "<tr>" +
	   "<td height=\"21\">" + ico + "</td>" +
		"<td align=\"left\"><a href=\"./" + titArr[j][0] + ".asp\" " +
		"onmouseover=\"this.style.fontStyle='italic'\" onmouseout=\"this.style.fontStyle='normal'\">" +
		"<b>" + titArr[j][1] + "</b></a></td>" +
		"</tr>";
		}
	tableMenu += "</table>";
   document.getElementById("menu").innerHTML = tableMenu;
	document.getElementById("titolo").innerHTML = "<b>" + pagina.substring(3) + "</b>";
	}
	
i_img = 0;
function chgImg()
   {
	i_img = (i_img + 4) > 39 ? i_img - 36 : i_img + 4;
	document.getElementById("img_0").src = imgArr[i_img].src;
	document.getElementById("img_1").src = imgArr[i_img + 1].src;
	document.getElementById("img_2").src = imgArr[i_img + 2].src;
	document.getElementById("img_3").src = imgArr[i_img + 3].src;
	ciccio2 = setTimeout("chgImg()",5000);
	}
	
function open_shop(idx, bgc)
   {
	top.location.href = top.location.href + "?i=" + idx + "&c=" + bgc;
	}
	
-->

