// Funzione per l'apertura della foto ingranditafunction openPhoto (theFileName, theOrientation){	var myPage = "SchedeIta/" + theFileName;	var isUseScrollbars = false;		if (theOrientation == 0)	{		myWidth = 820;		myHeight = 640;	}	else if (theOrientation == 1)	{		myWidth = 620;		myHeight = 840;	}		if ((screen.width - 40) < myWidth)	{		myWidth = (screen.width - 40);		isUseScrollbars = true;	}	if ((screen.height - 80) < myHeight)	{		myHeight = (screen.height - 80);		isUseScrollbars = true;	}		if (isUseScrollbars)	{		var myWind = window.open(myPage, "Foto", "toolbar=no,directories=no,menubar=no,scrollbars=yes,width=" + myWidth + ",height=" + myHeight);	}	else if (!isUseScrollbars)	{		var myWind = window.open(myPage, "Foto", "toolbar=no,directories=no,menubar=no,scrollbars=yes,width=" + myWidth + ",height=" + myHeight);	}}// fine openPhoto// Questa funzione apre una finestra con un esperimento in Flashfunction openExperiment (thePageName, thePageWidth, thePageHeight){	// Pathname del file html da aprire in una nuova finestra	var myPage = ("Esperimenti/" + thePageName + ".htm");		// Calcola le coordinate dell'angolo top,left in cui posizionare la nuova finestra	var x = ((screen.width - thePageWidth) / 2);	var y = ((screen.height - thePageHeight) / 2);		// Apre la finestra con precide dimensioni	var myWind = window.open(myPage, "Esperimento", "toolbar=no,directories=no,menubar=no,scrollbars=no,resizable=yes,width=" + thePageWidth + ",height=" + thePageHeight);		// Sposta la finestra alle coordinate x,y	myWind.moveTo(x, y);}// fine openExperiment// Questa funzione apre una scheda al centro dello schermofunction openCard (thePageName){	// Pathname del file html da aprire in una nuova finestra	var myPage = ("SchedeIta/" + thePageName + ".htm");		// Calcola le coordinate dell'angolo top,left in cui posizionare la nuova finestra	var x = ((screen.width - 720) / 2);	var y = ((screen.height - 480) / 2);		// Apre la finestra con precide dimensioni	var myWind = window.open(myPage, "Scheda", "toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=720,height=480");		// Sposta la finestra alle coordinate x,y	myWind.moveTo(x, y);}// fine openCard// Questa funzione apre una scheda di esempio al centro dello schermofunction openExample (thePageName){	// Pathname del file html da aprire in una nuova finestra	var myPage = ("Esempi/" + thePageName + ".htm");		// Calcola le coordinate dell'angolo top,left in cui posizionare la nuova finestra	var x = ((screen.width - 720) / 2);	var y = ((screen.height - 480) / 2);		// Apre la finestra con precide dimensioni	var myWind = window.open(myPage, "Example", "toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=720,height=480");		// Sposta la finestra alle coordinate x,y	myWind.moveTo(x, y);}// fine openExample// Questa funzione verifica se l'indirizzo di posta elettronica passato come parametro ¸ validofunction isEmail (s){	if (s == "")	return false;		// controlla se ¸ uno spazio	if (s == " ") return false;		// ci deve essere almeno 1 carattere prima del carattere "@"	// cos“ la ricerca parte dalla posizione 1 della stringa (cio¸ il secondo carattere)	var i = 1;	var sLength = s.length;		// cerca il carattere "@"	while ((i < sLength) && (s.charAt(i) != "@"))	{ i++	}		if ((i >= sLength) || (s.charAt(i) != "@")) return false;	else i += 2;	// cerca il carattere "."	while ((i < sLength) && (s.charAt(i) != "."))	{ i++	}		// ci devono essere almeno due caratteri dopo il "." per indicare il dominio di primo livello	if ((i >= sLength - 2) || (s.charAt(i) != ".")) return false;	else return true;}// fine isEmail// Questa funzione controlla i dati inseriti dall'utente nel modulo prima di spedirlofunction controllamodulo(){	if (!isEmail(document.forms["modulo"].email.value))	{		alert("Non avete inserito il vostro indirizzo di posta elettronica!");		document.forms["modulo"].email.focus();		return (false);	}	if (document.forms["modulo"].nome.value == "")	{		alert("Non avete inserito il vostro nome!");		document.forms["modulo"].nome.focus();		return (false);	}	if (document.forms["modulo"].cognome.value == "")	{		alert("Non avete inserito il vostro cognome!");		document.forms["modulo"].cognome.focus();		return (false);	}	if (document.forms["modulo"].corpo.value == "")	{		alert("Non avete inserito il testo del messaggio!");		document.forms["modulo"].corpo.focus();		return (false);	}	else	{		return (true);	}}// fine controllamodulofunction MM_reloadPage(init) {  //reloads the window if Nav4 resized  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true);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_setTextOfLayer(objName,x,newText) { //v4.01  if ((obj=MM_findObj(objName))!=null) with (obj)    if (document.layers) {document.write(unescape(newText)); document.close();}    else innerHTML = unescape(newText);}// Example:// onMouseOver="toolTip('tool tip text here')";// onMouseOut="toolTip()";// -or-// onMouseOver="toolTip('more good stuff', '#FFFF00', 'orange')";// onMouseOut="toolTip()"; var ns4 = document.layers;var ns6 = document.getElementById && !document.all;var ie4 = document.all;offsetX = 0;offsetY = 20;var toolTipSTYLE="";function initToolTips(){  if(ns4||ns6||ie4)  {    if(ns4) toolTipSTYLE = document.toolTipLayer;    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;    if(ns4) document.captureEvents(Event.MOUSEMOVE);    else    {      toolTipSTYLE.visibility = "visible";      toolTipSTYLE.display = "none";    }    document.onmousemove = moveToMouseLoc;  }}function toolTip(msg, fg, bg){  if(toolTip.arguments.length < 1) // hide  {    if(ns4) toolTipSTYLE.visibility = "hidden";    else toolTipSTYLE.display = "none";  }  else // show  {    if(!fg) fg = "#777777";    if(!bg) bg = "#FFFFFF";    var content =    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + bg +     '"><td align="center"><font face="sans-serif" color="' + fg +    '" size="-2">&nbsp\;' + msg +    '&nbsp\;</font></td></table></td></table>';    if(ns4)    {      toolTipSTYLE.document.write(content);      toolTipSTYLE.document.close();      toolTipSTYLE.visibility = "visible";    }    if(ns6)    {      document.getElementById("toolTipLayer").innerHTML = content;      toolTipSTYLE.display='block'    }    if(ie4)    {      document.all("toolTipLayer").innerHTML=content;      toolTipSTYLE.display='block'    }  }}function moveToMouseLoc(e){  if(ns4||ns6)  {    x = e.pageX;    y = e.pageY;  }  else  {    x = event.x + document.body.scrollLeft;    y = event.y + document.body.scrollTop;  }  toolTipSTYLE.left = x + offsetX;  toolTipSTYLE.top = y + offsetY;  return true;}// Questa funzione carica la pagina indicata come primo parametro e poi apre la finestra popup// indicata dagli altri parametrifunction apriPaginaEPopup (thePagina, theEsperimento, theLarghezza, theAltezza){	// Carica la pagina indicata dal primo parametro	window.location.href = thePagina;		// Richiama la routine che apre la finestra popup	openExperiment(theEsperimento, theLarghezza, theAltezza);}// fine apriPaginaEPopup
