<!--

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}
// -->



function toggleDisplay(fO){

	var ns4 = (document.layers);
	var ie4 = (document.all && !document.getElementById);
	var ie5 = (document.all && document.getElementById);
	var ns6 = (!document.all && document.getElementById);
	
	
	if(ie5 || ns6){
		if (document.getElementById(fO).style.display=="none") {
		document.getElementById(fO).style.display="inline";
		}else{
		document.getElementById(fO).style.display="none";
		}
	}
	
	if(ie4){
		if (document.all[fO].style.display=="none") {
		document.all[fO].style.display="inline";
		}else{
		document.all[fO].style.display="none";
		}
	}	
}

function multiLocation(ln,htmC,htmD) {
	parent.frameDx.location.href=htmD;
	parent.frameCenter.location.href=htmC;

	oldLn = change.value ;
	
	change.value=ln;
	
}
function setColorClick(id,strId){

	oldId = document.form.colorHit.value ;
		if (oldId) {
		old_id = eval(oldId) ;	
		old_id.className='tdMenuSx' ;
		}
	
	document.form.colorHit.value=strId;
	id.className='tdMenuSxLink' ;
}

function setColor(id,strId,IO){
 
	if (strId != document.form.colorHit.value){
		if(IO == "in"){
		id.className='tdMenuSxLink' ;
		}else{
		id.className='tdMenuSx' ;
		}	
	} 
}

function apri_prontoinunclik_vt (id_user,webpath) {
  w = 280 ;
  h = 520 ;
  l=(screen.width - w) / 2 ;
  t=(screen.height - h) /2 ;
  
  prv  = webpath + "php/popup_prontoinunclik_vt.php?id_user="+id_user+"&webpath="+webpath ;
  pronto = window.open(prv,"pronto","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
  pronto.focus() ;	
}

function galleria_foto(titolo,foto_big){

	i1 = new Image;
	i1.src = foto_big;
	html = "<head>";
	html = html + "<title>" + titolo + "</title>";
	html = html + "</head>";
	html = html + "<BODY LEFTMARGIN='0' MARGINWIDTH='0' TOPMARGIN='0' MARGINHEIGHT='0'>";
	html = html + "<CENTER>";
	html = html + "<IMG SRC=" + foto_big + " BORDER=0 NAME=foto_grande onLoad=window.resizeTo(document.foto_grande.width+12,document.foto_grande.height+30)>";
	html = html + "</CENTER>";
	html = html + "</BODY>";

	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close() ;
}

//apre popup su prodotto da catalogo e carrello
function dettaglio_prodotto(webpath,id,dim_cod,id_nonno,id_user) {

  w = 562;
  h = 440;
  l = (screen.width - w) / 2;
  t = (screen.height - h) / 2;
  wnd = window.open(webpath+"dettaglio_prodotto.php?dim_cod="+dim_cod+"&"+dim_cod+"_ID="+id+"&id_nonno="+id_nonno+"&dadove=vetrina&id_user="+id_user,"","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes, resizable=yes, width="+w+", height="+h+", left="+l+", top="+t);
  wnd.focus();

}

//PARTE PER E-SHOP
function aggiungiACarrello (webpath, id_prodotto) {
	w = 730;
	h = 550;
	l = (screen.width - w) / 2;
	t = 100;
	
	wndCarrello = window.open(webpath+"popupCarrello.php?id_prodotto="+id_prodotto,"wndCarrello","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	wndCarrello.focus();

}

function apriCarrello (webpath) {
	w = 730;
	h = 550;
	l = (screen.width - w) / 2;
	t = 100;
	wndCarrello = window.open(webpath+"popupCarrello.php","wndCarrello","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	wndCarrello.focus();
}

function schedaProdotto (webpath, id_prodotto) {
	
	w = 730;
	h = 530;
	l = (screen.width - w) / 2;
	t = 150;
	
	wndProd = window.open(webpath+"popupProdotto.php?id_prodotto="+id_prodotto,"wndProd","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	wndProd.focus();	
}

/********************************************************
*	FUNZIONI JAVASCRIPT PER MENUTOP CON SOTTOMENU
*********************************************************/
sfHover = function() {
	if( document.getElementById("nav") )	{	
		var sfEls = document.getElementById("nav").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

-->
