﻿
/* _____________________________ ON ERROR ____________________________________________ */
function silenzia()  {return true}
// window.onerror=silenzia();
/* ___________________________________________________________________________________ */

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function linkblank(src){
	MM_openBrWindow(src,'','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function prendiElementoDaId(id_elemento) {
	var elemento;
	if(document.getElementById)
		elemento = document.getElementById(id_elemento);
	else
		elemento = document.all[id_elemento];
	return elemento;
};

function opennew(z,w,h,nome)
{

	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	var larghez = 600;
	var altez = 600;

	i1 = new Image;
	i1.src = z;
	html = '<HTML>\n<HEAD>\n<TITLE>Zoom</TITLE>\n';
	html+='</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 link="#003366" vlink="003366" alink="003366" onLoad="dimWidth=12+document.zooming.width;dimHeight=61+document.zooming.height;';
	html+='window.resizeTo(dimWidth, dimHeight);centx=Math.round((screen.width/2)-(dimWidth/2));centy=Math.round((screen.height/2)-(dimHeight/2));window.moveTo(centx,centy);window.focus()">\n<a href="javascript:window.opener.focus();self.close();"><IMG SRC="'+z+'" S_RC="phpthumb/phpthumb.php?src=../'+z+'&w=950&h=720&maxb=300000" BORDER=0 NAME=zooming alt="Clicca per chiudere"></a>\n</BODY>\n</HTML>';
	popupImage = eval("window.open('','" + nome + "','toolbar=no,location=no,directories=no,menuBar=no,scrollbars=no,resizable=yes,width=" + larghez + ",height=" + altez + ",left=" + ((chasm - larghez - 10) * .5) + ",top=" + ((mount - altez - 30) * .5) + "');");
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
}


function openZoom(z,w,h,nome,descrizione)
{

	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	var larghez = 600;
	var altez = 600;
	var addHeight = 61;
	if(descrizione && descrizione!=""){
		addHeight = 125;
	}
	var addWidth = 12;
	i1 = new Image;
	i1.src = z;
	html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
	html+= '<html xmlns="http://www.w3.org/1999/xhtml">';
	html+= '<head>';
	html+= '<HEAD>\n<TITLE>Zoom</TITLE>\n';
	html+= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
	html+= '<link href="css/stili.css" rel="stylesheet" type="text/css" />';
	html+='</HEAD>\n<BODY style="background:#FFFFFF" ';
	html+='onLoad="dimWidth='+addWidth+'+document.zooming.width;dimHeight='+addHeight+'+document.zooming.height;';
	html+='window.resizeTo(dimWidth, dimHeight);centx=Math.round((screen.width/2)-(dimWidth/2));centy=Math.round((screen.height/2)-(dimHeight/2));window.moveTo(centx,centy);window.focus()">\n<a href="javascript:window.opener.focus();self.close();"><IMG S_RC="'+z+'" SRC="'+z+'" BORDER=0 NAME=zooming alt=""></a>\n';
	if(descrizione && descrizione!=""){
		html+='<div clas="bloccoScroll nero grassetto" style="padding:8px; height:40px; margin:8px; border:1px solid #F0F0F0">';
		html+=descrizione;
		html+='</style>';
	}
	html+='</BODY>\n</HTML>';
	popupImage = eval("window.open('','" + nome + "','toolbar=no,location=no,directories=no,menuBar=no,scrollbars=no,resizable=yes,width=" + larghez + ",height=" + altez + ",left=" + ((chasm - larghez - 10) * .5) + ",top=" + ((mount - altez - 30) * .5) + "');");
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
}

function MM_preloadImages() { //v3.0
  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_swapImgRestore() { //v3.0
  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_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 MM_swapImage() { //v3.0
  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];}
}


/* ---------------------------------------------------------------------------- */
/* ---------------- INIZIO SCRIPT PER IL SITO --------------------------------- */
/* ---------------------------------------------------------------------------- */

function caricaHome(parametri){
	///////////////////////////////// CARICA FLASH HOME
	e = canResizeFlash();
	var so = new SWFObject("home.swf", "home", "555", "488", "8", "#FFFFFF", true);
	for(var chiave in parametri){
		tmp=parametri[chiave].toString();
		if(tmp.indexOf("function")==-1 && chiave.indexOf("rnd")==-1){
			so.addVariable(chiave, parametri[chiave]);
		}
	}
	so.addVariable("allowResize", ""+e+"");
	so.setAttribute("useExpressInstall",false);
	so.setAttribute("redirectUrl","updateFlash.html");
	so.addParam("wmode", "transparent");
	so.write("swfhome");
}


/* ---------------------------------------------------------------------------- */
/* ---------------- FINE SCRIPT PER IL SITO ----------------------------------- */
/* ---------------------------------------------------------------------------- */


/* ---------------------------------------------------------------------------- */
/* ---------------- INIZIO SCRIPT PER I FORM ---------------------------------- */
/* ---------------------------------------------------------------------------- */


/* ---------------------------------------------------------------------------- */
/* ---------------- FINE SCRIPT PER I FORM ------------------------------------ */
/* ---------------------------------------------------------------------------- */

