//per il select della selezione del brand
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	//eval(targ+".location='/brand/"+selObj.options[selObj.selectedIndex].value+"'");
	var strUrl = selObj.options[selObj.selectedIndex].value;
	if (strUrl.indexOf("http://") == -1) {
		strUrl = '/brand/' + strUrl;
		eval(targ+".location='"+strUrl+"'");
	} else {
		eval("window.open('"+strUrl+"','brand')");
	}
  if (restore) selObj.selectedIndex=0;
}
//per il select della selezione del brand affinity
function GZ_jumpMenuAff(selObj,chAff){ //v. 14.8.143 build F2
	//alert ('quuuuuui');
	//	alert(selObj.options[selObj.selectedIndex].value);
	if (selObj.options[selObj.selectedIndex].value != '') {
		document.location = '/' + chAff + '/brand/'+ selObj.options[selObj.selectedIndex].value
	}
}

function GZ_jumpMenuSiti(targ,selObj,restore){ //v3.0
  
  if (selObj.options[selObj.selectedIndex].value.indexOf("http://") >= 0){
	//aprire in nuova finestra
	eval("window.open('"+selObj.options[selObj.selectedIndex].value+"','altrisiti')")
  }else{
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  }
  if (restore) selObj.selectedIndex=0;

}

//*** qui sotto quelle che arrivano dal template

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// funzioni per i box rollover delle schede prodotto:

// funzione che garantisce il funzionamento crossbrowser:
function dammiElemID(str___id){
	try{
	   return document.getElementById(str___id);	
	}catch(ex){
	   try{
	       return document.all.item(str___id);
        }catch(exp){
    		//gestErrCode(exp.number,exp.description);
	       	return null;
	   }
    }
}

// il primo argomento passato alla funzione è il box da mostrare quando l'utente clicca sul minibox corrispondente, gli altri sono tutti gli altri box da nascondere:
function aprilo(box1, box2, box3, box4){
dammiElemID(box1).style.display='block';
dammiElemID(box2).style.display='none';
dammiElemID(box3).style.display='none';
dammiElemID(box4).style.display='none';
}
//funzione collegata al link "chiudi" in fondo a ogni box:
function chiudilo(box){
dammiElemID(box).style.display='none';
}

function flashWrite(flashname,flashwidth,flasheight) { 
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 " WIDTH='+flashwidth+' HEIGHT='+flasheight+' >');
	document.write('<PARAM NAME=movie VALUE="/static_2007/flash/'+flashname+'">');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<EMBED src="/static_2007/flash/'+flashname+'" quality=high width='+flashwidth+' HEIGHT='+flasheight+' type="application/x-shockwave-flash" PLUGINSPAGE=" http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.write('</OBJECT>');
}

function show_hide(id){

	var elemento = document.getElementById(id);

	if (elemento.style.display == '') {
		elemento.style.display = "none";
		elemento='';
	}	else if (elemento.style.display == "none") {
		elemento.style.display = '';
		elemento='';
	}
}
