// JavaScript Document
function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto, menubar=0');
}



	function newWin2(url,width,height) {
	window.open(url,"remoteWin","width="+width+",height="+height+",resizable=1,menubar=0,status=0,scrollbars=1");
	}
	
	function newWin(url,width,height) {
	window.open(url,"remoteWin","width="+width+",height="+height+",resizable=0,menubar=0,status=0,scrollbars=0");
	}
	
	
	var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
	
//Javascript per controllo modulo disponibilità

  function check_form() {
     // Variabili associate ai campi del modulo
     var nome = document.account_edit.mnome.value;
     var tel = document.account_edit.mtel.value;
     var email = document.account_edit.memail.value;
	 var commenti = document.account_edit.mcommenti.value;
	 var privacy = document.account_edit.privacy[1].checked;
 

     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert("Il campo Nome e' obbligatorio.");
           document.account_edit.mnome.focus();
           return false;
        }


        //Effettua il controllo sul campo TELEFONO
        else if ((tel == "") || (tel == "undefined")) {
           alert("Il campo Telefono e' obbligatorio.");
           document.account_edit.mtel.value = "";
           document.account_edit.mtel.focus();
           return false;
        }
		
		 //Effettua il controllo sul campo TELEFONO
        else if ((commenti == "") || (commenti == "undefined")) {
           alert("Il campo Richiesta e' obbligatorio.");
           document.account_edit.mcommenti.value = "";
           document.account_edit.mcommenti.focus();
           return false;
        }
		
		
        //Effettua il controllo sul campo CONFERMA PASSWORD
        else if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
           alert("Inserire un indirizzo email corretto.");
           document.account_edit.memail.select();
           return false;
        }
		
		else if (privacy == true) {
          alert("Senza il consenso al trattamento, non e' possibile processare i tuoi dati");
          //document.modulo.privacy.focus();
          return false;
        }
	
        //INVIA IL MODULO
        else {
           return true;
        }
  }


function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}

