function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>' +alt+ '</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}


function WM_toggle(id){
if (document.all){
if(document.all[id].style.display == 'none'){
document.all[id].style.display = '';
} else {
document.all[id].style.display = 'none';
}
return false;
} else if (document.getElementById){
if(document.getElementById(id).style.display == 'none'){
document.getElementById(id).style.display = 'block';
} else {
document.getElementById(id).style.display = 'none';
}
return false;
}
}

function nascondi(nome){
var stato = document.getElementById("tbl" + nome).style.display;
if (stato != "none"){
// Nascondo la riga
document.getElementById("tbl" + nome).style.display = "none";
}
}
function apri(nome){
var statoapri = document.getElementById("tbl" + nome).style.display;
if (statoapri == "none"){
// Visualizzo la riga
document.getElementById("tbl" + nome).style.display = "";
}
}


// funzione per far comparire il pop-up della privacy
function apriFinestra(page){
var winOpenSquadra;
winOpened = window.open(page,"Squadra","directories=no,status=no,statusbar=no,resizable=no,menubar=no,scrollbars=yes,toolbar=no,width=770,height=530,left=10,top=10");
}


//funzione che mi apre pop-up (vedi: POSIZIONE)
function openwindow2(Url, Wid, Hei){
window.open (Url, '', 'toolbar=no,status=yes,menubar=no,scrollbars=yes,fullscreen=no,resizable=no,width='+Wid+',height='+Hei);
}


//funzione che mi permette di centrare la popup
function resizeWin(Altezza,Larghezza){
var sizeH= Altezza;
var sizeW= Larghezza;
var posH=0;
var posW=0;

if (sizeH<=screen.height)
sizeH=30+sizeH;
if (sizeW<=screen.width)
sizeW=30+sizeW
self.resizeTo(sizeW,sizeH);
if (((screen.height-sizeH)/2)>0)
posW=((screen.height-sizeH)/2);
if (((screen.width-sizeW)/2)>0)
posH=((screen.width-sizeW)/2);
self.moveTo(posW,posH);
}


function addSmile(picName) {
	document.shout.messaggio.value = document.shout.messaggio.value + picName;
	document.shout.messaggio.focus();
}



function people(lng,modo){
var colore_normale = "#ffffff";
var colore_avviso = "#ffff9f";
//--Applico il colore base alle text--
document.theform.nome.style.backgroundColor = colore_normale;
document.theform.cognome.style.backgroundColor = colore_normale;
document.theform.indirizzo.style.backgroundColor = colore_normale;
document.theform.citta.style.backgroundColor = colore_normale;
document.theform.telefono.style.backgroundColor = colore_normale;
document.theform.email.style.backgroundColor = colore_normale;
document.theform.arrivo.style.backgroundColor = colore_normale;
document.theform.partenza.style.backgroundColor = colore_normale;
document.theform.ora_arrivo.style.backgroundColor = colore_normale;
document.theform.n_persone.style.backgroundColor = colore_normale;
document.theform.camera1.style.backgroundColor = colore_normale;
document.theform.camera2.style.backgroundColor = colore_normale;
document.theform.camera3.style.backgroundColor = colore_normale;
document.theform.camera4.style.backgroundColor = colore_normale;
document.theform.camera5.style.backgroundColor = colore_normale;

var camera1 = document.theform.camera1.options.selectedIndex;
var camera2 = document.theform.camera2.options.selectedIndex;
var camera3 = document.theform.camera3.options.selectedIndex;
var camera4 = document.theform.camera4.options.selectedIndex;
var camera5 = document.theform.camera5.options.selectedIndex;

var persone = document.theform.n_persone.options.selectedIndex;
var tot_1 = 0;
var tot_2 = 0;
var tot_3 = 0;
var tot_4 = 0;
var tot_5 = 0;

var somma = 0;

tot_1 = parseInt(camera1) * 1;
tot_2 = parseInt(camera2) * 1;
tot_3 = parseInt(camera3) * 2;
tot_4 = parseInt(camera4) * 2;
tot_5 = parseInt(camera5) * 3;
somma = tot_1 + tot_2 + tot_3 + tot_4 + tot_5;

if (lng=="en"){
var err_1 = "Please insert the Surname."
var err_2 = "Please insert the Name."
var err_3 = "Please insert the Town."
var err_4 = "Please insert the Phone Number or Mobile Phone."
var err_5 = "Please insert the Email."
var err_6 = "Attention ! Email wrong."
var err_7 = "Please insert the Arrival Date."
var err_8 = "Please insert the Departure Date."
var err_9 = "Please insert the Arrival Time."
var err_10 = "Attention ! The number of people is greater to the number of selected beds."
var err_11 = "Attention ! The number of people is lower to the number of selected beds."
var err_12 = "Attention ! Choose a typology of lodging."
var err_13 = "Please insert the N. of People."
var err_14 = "Attention ! Our property can entertain maximum 25 people."
var err_15 = "Attention ! You must enter all fields of credit card."
var err_16 = "Attention ! The credit card number is not correct."
}
else if (lng=="es"){
var err_1 = "¡Atención! Insertar el Apellido."
var err_2 = "¡Atención! Insertar el Nombre."
var err_3 = "¡Atención! Insertar la Ciudad."
var err_4 = "¡Atención! Insertar el Teléfono o Cell."
var err_5 = "¡Atención! Insertar el Email."
var err_6 = "Atención! Insertar el Email corregido."
var err_7 = "¡Atención! Insertar el Día de Llegada."
var err_8 = "¡Atención! Insertar el Día de Salida."
var err_9 = "¡Atención! Insertar el horario de Llegada."
var err_10 = "¡Atención! El número max de personas integradas es superior a los sitios cama seleccionada."
var err_11 = "¡Atención! El número max de personas integradas es inferior a los sitios cama seleccionada."
var err_12 = "¡Atención! Eliges una tipología de habitación."
var err_13 = "¡Atención! Insertar el número de las personas."
var err_14 = "¡Atención! Nuestra estructura puede hospedar un máximo de 25 personas."
var err_15 = "¡Atención! Usted debe entrar en todos los campos de la tarjeta de crédito."
var err_16 = "¡Atención! El número de tarjeta de crédito no es correcto."
}
else if (lng=="pt"){
var err_1 = "Atenção ! Inserir o Sobrenome."
var err_2 = "Atenção ! Inserir o Nome."
var err_3 = "Atenção ! Inserir a Cidade."
var err_4 = "Atenção ! Inserir o Telefone."
var err_5 = "Atenção ! Inserir Email."
var err_6 = "Atenção ! Formato do Email errado."
var err_7 = "Atenção ! Inserir Data de Chegada."
var err_8 = "Atenção ! Inserir Data de Partida."
var err_9 = "Atenção ! Inserir Hora de Chegada."
var err_10 = "Atenção ! O número máximo de pessoas inseridas é maior que o número de camas selecionadas."
var err_11 = "Atenção ! O número máximo de pessoas inseridas é menor que o número de camas selecionadas."
var err_12 = "Atenção ! Escolha um tipo de quarto."
var err_13 = "Atenção ! Inserir o número de pessoas."
var err_14 = "Atenção ! O nosso estabelecimento pode hospedar um máximo de 25 pessoas."
}
else if (lng=="fr"){
var err_1 = "Attention! Insérez le Nom."
var err_2 = "Attencion! Insérez le Préom."
var err_3 = "Attencion! Insérez la Ville."
var err_4 = "Attencion! Insérez le Téléphone."
var err_5 = "Attencion! Insérez la Email."
var err_6 = "Attencion! Email incorrect."
var err_7 = "Attencion! Insérez la Date d\'Arrivée."
var err_8 = "Attencion! Insérez la Date de Départ."
var err_9 = "Attencion! Insérez H. d\'Arrivée."
var err_10 = "Attencion! Le nombre de personnes est plus grand pour le nombre de lits sélectionnés."
var err_11 = "Attencion! Le nombre de personnes est inférieur au nombre de lits."
var err_12 = "Attencion! Choisissez un Type de chambres."
var err_13 = "Attencion! Insérez le N. de Personnes."
var err_14 = "Attencion! Notre propriété peut divertir au maximum 25 personnes."
}
else if (lng=="de"){
var err_1 = "Achtung! Einlegen der Nachname."
var err_2 = "Achtung! Einlegen der Vorname."
var err_3 = "Achtung! Einlegen der Stadt."
var err_4 = "Achtung! Legen Sie die Telefonnummer."
var err_5 = "Achtung! Legen Sie die E-Mail."
var err_6 = "Achtung! E-Mail falsch."
var err_7 = "Achtung! Legen Sie die Ankunfts Datum."
var err_8 = "Achtung! Legen Sie die Abfahrt Datum."
var err_9 = "Achtung! Einlegen der Ankunft Zeit."
var err_10 = "Achtung! Die Zahl der Menschen größer ist, um die Anzahl der ausgewählten Betten."
var err_11 = "Achtung! Die Zahl der Menschen, ist auf die geringere Zahl der Betten ausgewählt."
var err_12 = "Achtung! Wählen Sie eine Art der Unterkunft."
var err_13 = "Achtung! Legen Sie die Anzahl der Personen."
var err_14 = "Achtung! Unser Eigentum unterhalten können maximal 25 Personen."
}
else {
var err_1 = "Attenzione ! Inserire il Cognome."
var err_2 = "Attenzione ! Inserire il Nome."
var err_3 = "Attenzione ! Inserire la Città."
var err_4 = "Attenzione ! Inserire il Telefono o Cell."
var err_5 = "Attenzione ! Inserire l\'Email."
var err_6 = "Attenzione ! Inserire l\'E-mail corretta."
var err_7 = "Attenzione ! Inserire il Giorno di Arrivo."
var err_8 = "Attenzione ! Inserire il Giorno di Partenza."
var err_9 = "Attenzione ! Inserire l\'Orario di Arrivo."
var err_10 = "Attenzione ! Il numero max di persone inserite è superiore ai posti letto selezionati."
var err_11 = "Attenzione ! Il numero max di persone inserite è inferiore ai posti letto selezionati."
var err_12 = "Attenzione ! Scegli una tipologia di stanza."
var err_13 = "Attenzione ! Inserire il numero delle persone."
var err_14 = "Attenzione ! La nostra struttura può ospitare un massimo di 25 persone."
var err_15 = "Attenzione ! Devi inserire tutti i dati, richiesti dal form, della tua carta di credito."
var err_16 = "Attenzione ! Il numero della carta di credito non è corretto."
}

if (document.theform.cognome.value==""){
alert(err_1);
document.theform.cognome.focus();
document.theform.cognome.style.backgroundColor = colore_avviso;
return false;
}
if (document.theform.nome.value==""){
alert(err_2);
document.theform.nome.focus();
document.theform.nome.style.backgroundColor = colore_avviso;
return false;
}
if (document.theform.citta.value==""){
alert(err_3);
document.theform.citta.focus();
document.theform.citta.style.backgroundColor = colore_avviso;
return false;
}
if (document.theform.telefono.value==""){
alert(err_4);
document.theform.telefono.focus();
document.theform.telefono.style.backgroundColor = colore_avviso;
return false;
}
if (document.theform.email.value==""){
alert(err_5);
document.theform.email.focus();
document.theform.email.style.backgroundColor = colore_avviso;
return false;
}
var x = document.theform.email.value;
var filter  = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
if (!(filter.test(x))){
alert (err_6);
document.theform.email.focus();
document.theform.email.style.backgroundColor = colore_avviso;
return false;
}
if (document.theform.arrivo.value==""){
alert(err_7);
document.theform.arrivo.focus();
document.theform.arrivo.style.backgroundColor = colore_avviso;
return false;
}
if (document.theform.partenza.value==""){
alert(err_8);
document.theform.partenza.focus();
document.theform.partenza.style.backgroundColor = colore_avviso;
return false;
}
if (document.theform.ora_arrivo.value=="0"){
alert(err_9);
document.theform.ora_arrivo.focus();
document.theform.ora_arrivo.style.backgroundColor = colore_avviso;
return false;
}
if (somma < persone){
alert(err_10);
document.theform.n_persone.focus();
document.theform.n_persone.style.backgroundColor = colore_avviso;
return false;
}
if (somma > persone){
alert(err_11);
document.theform.n_persone.focus();
document.theform.n_persone.style.backgroundColor = colore_avviso;
return false;
}
if (somma==0){
alert(err_12);
document.theform.camera1.style.backgroundColor = colore_avviso;
document.theform.camera2.style.backgroundColor = colore_avviso;
document.theform.camera3.style.backgroundColor = colore_avviso;
document.theform.camera4.style.backgroundColor = colore_avviso;
document.theform.camera5.style.backgroundColor = colore_avviso;
return false;
}

if (persone==0){
alert(err_13);
document.theform.n_persone.focus();
document.theform.n_persone.style.backgroundColor = colore_avviso;
return false;
}

//if (somma > 24){
//alert(err_14);
//document.theform.camera1.style.backgroundColor = colore_avviso;
//document.theform.camera2.style.backgroundColor = colore_avviso;
//document.theform.camera3.style.backgroundColor = colore_avviso;
//document.theform.camera4.style.backgroundColor = colore_avviso;
//document.theform.camera5.style.backgroundColor = colore_avviso;
//return false;
//}

if (modo==1){
document.theform.creditcard.style.backgroundColor = colore_normale;
document.theform.titolare.style.backgroundColor = colore_normale;
document.theform.numero.style.backgroundColor = colore_normale;
document.theform.ccmese.style.backgroundColor = colore_normale;
document.theform.ccanno.style.backgroundColor = colore_normale;
var cccard = document.theform.creditcard.options[document.theform.creditcard.options.selectedIndex].value;
var titcard = document.theform.titolare.value;
var numcard = document.theform.numero.value;
var mesecard = document.theform.ccmese.options[document.theform.ccmese.options.selectedIndex].value;
var annocard = document.theform.ccanno.options[document.theform.ccanno.options.selectedIndex].value;

if (cccard!="0"){
if (titcard=="" || numcard=="" || mesecard=="0" || annocard=="0"){
alert(err_15);
document.theform.titolare.style.backgroundColor = colore_avviso;
document.theform.numero.style.backgroundColor = colore_avviso;
document.theform.ccmese.style.backgroundColor = colore_avviso;
document.theform.ccanno.style.backgroundColor = colore_avviso;
return false;
}
if (numcard!=""){
if (!Mod10(numcard))  {
alert(err_16);
document.theform.numero.style.backgroundColor = colore_avviso;
return false;
}
}
}
else{
alert(err_15);
document.theform.creditcard.style.backgroundColor = colore_avviso;
return false;
}
}
}



//funzione per disabilitare e cambiare il testo sul tasto submit nel momento di invio dati
function disabilita(){
document.forms[0].submit.value = "Wait..";
document.forms[0].submit.disabled = true;
}




//funzione che mi permette di ridimensionare le immagini in Offerte ed Eventi se superano una determinata larghezza
function ridimensiona(){ 
for (imm in document.images){ 
img = document.images[imm] 
if (img.className=="image"){ 
if (img.width > 650){ 
img.width=650
} 
} 
} 
} 