function tdColor(elementId, color) {
	if (document.getElementById) {
		document.getElementById(elementId).style.backgroundColor=color;
	}
}
// JavaScript Document
//Pop Up per dettagli prodotto
function PopupPic(sPicURL) { 
  window.open("../image/popup.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}
//Apri finestra browser
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
function newwindow(url,name,x,y,scrollbars,resize,menu,tool) { 
nw=window.open(url,name,"width="+x+",height="+y+",resizable="+resize+",scrollbars="+scrollbars+",menubar="+menu+",toolbar="+tool); 
nw.moveTo((screen.width-x)/2,(screen.height-y)/2); 
nw.focus(); 
} 

//MAIN frame
<!--
montaggio=window.location.href.split("/"); 
semplice=montaggio.length-1;
var url = montaggio[semplice];
if(window == window.top) document.location.replace("index.php?url="+url);
// -->
// JavaScript Document
//Flash Variables
// (C) F. Permadi 
function getFlashMovieObject(movieName)
{
  if (parent.main.document[movieName]) 
  {
    return parent.main.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (parent.main.document.embeds && parent.main.document.embeds[movieName])
      return parent.main.document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return parent.main.document.getElementById(movieName);
  }
}

function PlayFlashMovie()
{
	var flashMovie=getFlashMovieObject("menu");
	flashMovie.Play();
}
//-->
//
//MAIN frame
<!--
/*
montaggio=window.location.href.split("/"); 
semplice=montaggio.length-1;
var url = montaggio[semplice];
if(window == window.top) document.location.replace("index.php?url="+url);
*/
// -->
//Print
<!--

var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

function printPage() {
  if (pr) // NS4, IE5
    window.print()
  else if (da && !mac) // IE4 (Windows)
    vbPrintPage()
  else // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  return false;
}

if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

// -->
//Bookmark

function Add_A_Favorite()  
{  
if (window.external)  
// The browser is Internet Explorer so we open the 'add favorite' window 
{ 
window.external.addFavorite('http://www.treciluce.com','Tre Ci Luce S.p.A.'); 
// Add the document location and title to the AddFavorite window 
} 
else  
// Display and JavaScript alert box for any other browsers. 
{ 
alert("Sorry. Your browser doesn't support automatic bookmark:http://www.treciluce.com Please Bookmark this page whit your browser function."); 
} 

}
// -->

//Menu Download

function P7_JumpMenu(selObj,restore){ //v1.3 by Project Seven
	var theFullString = selObj.options[selObj.selectedIndex].value;
	if (restore) selObj.selectedIndex=0;
	var theLength = theFullString.length;
	var endPos = theFullString.lastIndexOf("~");
	var theUrl, theTarget, theParent;
	if (endPos > 0) {theUrl = theFullString.substring(0,endPos);}
	else {theUrl = theFullString;}
	endPos++
	if (endPos < theLength) {theTarget = theFullString.substring(endPos,theLength)}
	else {theTarget = "window:Main";}
	if (theTarget == "window:New") {window.open(theUrl);}
	else if (theTarget == "window:Main") {eval("parent.location='"+theUrl+"'");}
	else {eval("parent.frames[\'"+theTarget+"\'].location='"+theUrl+"'");}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function P7_JumpMenuGo(selName,restore){ //v1.1 Beta Version by Project Seven
  var selObj = MM_findObj(selName); if (selObj) P7_JumpMenu(selObj,restore);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
