//Function MM_OPENBRWINDOW (Apre una pop-up)
function MM_openBrWindow(theURL,winName,features,width,height) { //v2.0
  features=features+',left='+ ((screen.width - width -10) /3)+',top='+ ((screen.height	- height-100) /3)
  window.open(theURL,winName,features);
}

//Function APRI (Apre una pop-up a scelta)
function Apri(quale) {
 switch(quale) {
 case 1 : MM_openBrWindow('cg-counter_edit.php','contatore','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=239,height=111',239,111)
 		  break;
 case 2 : MM_openBrWindow('guestbook-w.php','guestbook','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=336,height=303',336,303)
 		  break;
 case 3 : MM_openBrWindow('guestbook-r.php','guestbook','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=450,height=450',450,450)
 		  break;
 case 4 : MM_openBrWindow('base-booking.php','booking','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=454,height=529',454,529)
 	      break;
 case 5 : MM_openBrWindow('newspaper.php','newspaper','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=517,height=401',517,401)
 	      break;
 case 6 : MM_openBrWindow('mailpreview.html','preview','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=600,height=401',600,401)
 	      break;
	}
}

//Function STAMPA (Apre la finestra di stampa news)
function Stampa(quale) {
    MM_openBrWindow('notiz-print.php?IdN='+quale,'stampa','toolbar=no,scrollbars=no,alwaysRaised=yes,z-lock=yes,width=450,height=300',450,300)
}

//Function INVIA (Apre la finestra di invia news)
function Invia(quale) {
    MM_openBrWindow('notiz-esend.php?IdN='+quale,'stampa','toolbar=no,scrollbars=yes,alwaysRaised=yes,z-lock=yes,width=454,height=400',454,400)
}

//Function VIEWPIC (Apre un' immagine in pop-up)
function ViewPic(nome,misuraX, misuraY) {
    MM_openBrWindow('vedifoto.php?f='+nome,'crediti','toolbar=no,scrollbars=no,alwaysRaised=yes,z-lock=yes,width='+misuraX+',height='+eval(misuraY+20),misuraX,eval(misuraY+20))
}

//Function LOGOUT (Richiede il logout e colora la pagina)
function LogOut() {
	ht=document.getElementsByTagName("BODY");
	ht[0].style.filter="progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Vuoi veramente effettuare il logoff?')) {
		return true;
	} else {
		ht[0].style.filter = "";
		return false;
	}
 }

