function centerpopup(URL,width,height){
	if (parseInt(navigator.appVersion) >= 3){
		if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)<5){
			var tools = new Packages.java.awt.Toolkit.getDefaultToolkit();
			screen=tools.getScreenSize();
		}
		x = screen.width;
		y = screen.height;
	}
window.open(URL,"dummy","top=" + parseInt(y/2-height/2-16) + ",left=" + parseInt(x/2-width/2-5) + ",width=" + width + ",height=" + height );
}

function apri(url) { 
newin = window.open(url,'titolo','scrollbars=no,resizable=no, width=450,height=500,status=no,location=no,toolbar=no');
} 

 // Creo lo script per l'apertura del popup
    function ApriImmagini(file)
    {
      var prop = "top=100, left=100"; // Altre proprietą... eccetto width ed height!
      window.open(file, null, prop);
    }
	
function news (url)
  {
	  window.open(url, "tinyWindow", 'scrollbars=no,resizable=no, width=450,height=500,status=no,location=no,toolbar=no') 
     
    }

function ControllaMail()
   {
   EmailAddr = document.mail.da.value;
   Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
   if (Filtro.test(EmailAddr))
      return true;
   else
      {
      alert("Controlla l'indirizzo di e-mail inserito");
      document.mail.da.focus();
      return false;
      }
   }
   
function checkDati(theForm)
{	
 	Ctrl = theForm.Nome;
	if (Ctrl.value == "") {
	validatePrompt (Ctrl, "Campo obbligatorio, Inserisci il tuo nome");
	return false;
	}

	Ctrl = theForm.Cognome;
	if (Ctrl.value == "" )  {
	validatePrompt (Ctrl, "Campo obbligatorio, Inserisci il tuo cognome");
	return false;
	}

	Ctrl = theForm.Citta;
	if (Ctrl.value == "" )  {
	validatePrompt (Ctrl, "Campo obbligatorio, Inserisci la tua cittą");
	return false;
	}
	

	Ctrl = theForm.E_Mail;
	if (Ctrl.value == "" )  {
	validatePrompt (Ctrl, "Campo obbligatorio, Inserisci la tua e-mail");
	return false;
	}

	Ctrl = theForm.telefono;
	if (Ctrl.value == "") {
	validatePrompt (Ctrl, "Campo obbligatorio, Inserisci il recapito telefonico");
	return false;
	}
	
	Ctrl = theForm.nascita;
	if (Ctrl.value == "") {
	validatePrompt (Ctrl, "Campo obbligatorio, Conferma la nascita");
	return false;
	}
	
	Ctrl = theForm.lingua;
	if (Ctrl.value == "") {
	validatePrompt (Ctrl, "Campo obbligatorio, Conferma la lingua");
	return false;
	}
	
}

function validatePrompt (Ctrl, PromptStr) {
	alert (PromptStr)
	return false;

}
