function popwin(img) {	         
    aperta= window.open(img,"","height=700,width=600,menubar=0,resizable=yes,scrollbars=no,status=0,titlebar=0,toolbar=0,left=0,top=0");
    aperta.focus();
    }
			
function openWin(pagina,larghezza,altezza) {
	window.open(pagina,"","width="+larghezza+",height="+altezza+"");
	}
	
function reload(link) {
	window.opener.location.href = link;
	window.close();
	}
  
function ctrFormInformazioni() {
	if(document.forms['informazioni'].consenso[1].checked) {
		alert("E' necessario esprimere il consenso sull'informativa in materia di privacy");
		return false;
		}
	if(document.forms['informazioni'].nome.value=="") {
		alert("Il campo 'nome' deve essere valorizzato");
		return false;
		}
	if(document.forms['informazioni'].cognome.value=="") {
		alert("Il campo 'cognome' deve essere valorizzato");
		return false;
		}		
	if(document.forms['informazioni'].email.value=="") {
		alert("Il campo 'e-mail' deve essere valorizzato");
		return false;
		}
	if(document.forms['informazioni'].richiesta.value=="") {
		alert("Il campo 'richiesta' deve essere valorizzato");
		return false;
		}
	return true;
	}
	
function resetFormInformazioni() {
	document.forms['informazioni'].reset();
	}

function ctrFormInformations() {
	if(document.forms['informazioni'].consenso[1].checked) {
		alert("You must ACCEPT the informative to the treatment of the personal data");
		return false;
		}
	if(document.forms['informazioni'].name.value=="") {
		alert("The field 'name' must filled in");
		return false;
		}
	if(document.forms['informazioni'].surname.value=="") {
		alert("The field 'surname' must filled in");
		return false;
		}		
	if(document.forms['informazioni'].email.value=="") {
		alert("The field 'e-mail' must filled in");
		return false;
		}
	if(document.forms['informazioni'].remarks.value=="") {
		alert("The field 'remarks' must filled in");
		return false;
		}
	return true;
	}

function popupWinPrenotazioni(codice, posti_letto) {
        var periodo = document.forms[0].periodo.value;
	var conpre = document.forms[0].conpre.value;
	var dataeffini = document.forms[0].dataeffini.value;

        aperta= window.open("prenotazioni_action.php?cerca=1&periodo="+periodo+"&poslet="+posti_letto+"&conpre="+conpre+"&dataeffini="+dataeffini+"&codice="+codice+"&posti_letto="+posti_letto,"1","width=800,height=500,menubar=0,resizable=yes,scrollbars=yes,status=0,titlebar=0,toolbar=0,left=150,top=150");
   aperta.focus();
   }

function cal(campo,e,masch){
        var win=window.open("CalendarPage.php?campo="+campo.name+"&data="+campo.value+"&masch="+masch,"wcerca","width=300,height=200,location = no,menubar =no,resizable =yes,scrollbars = yes,status = no,titlebar = no,toolbar = no");
        xPos = (document.layers) ? e.pageX : ((document.all) ? event.x : e.clientX);
        yPos = (document.layers) ? e.pageY : ((document.all) ? event.y : e.clientY);
        win.moveTo(xPos,yPos)
        win.focus();
}


