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 c(nome){
var stato = document.getElementById("tbl" + nome).style.display;
if (stato != "none"){
// Nascondo la riga
document.getElementById("tbl" + nome).style.display = "none";
}
}
function a(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 controlla il form di BOOKING ONLINE
function checkForm(lang){

if (lang=="en"){
var Advise_1 = "The Arrival Date is wrong...please check !!";
var Advise_2 = "The Departure Date is wrong...please check !!";
var Advise_3 = "Attention !! The arrival date is inferior to today !!";
var Advise_4 = "Attention !! The daparture date is inferior to today !!";
var Advise_5 = "Attention !! The departure date is inferior to the arrival date !!";
var Advise_6 = "Attention !! Insert at least 3 characters in the field of Destination !!";
var Advise_7 = "Attention !! The Date format is wrong !! ";
}
else {
var Advise_1 = "Il Giorno di Arrivo è errato.. !!";
var Advise_2 = "Il Giorno di Partenza è errato... !!";
var Advise_3 = "Attenzione !! Il Giorno di Arrivo è inferiore alla data odierna !!";
var Advise_4 = "Attenzione !! Il Giorno di Partenza è inferiore alla data odierna !!";
var Advise_5 = "Attenzione !! Il Giorno di Partenza è inferiore al Giorno di Arrivo !!";
var Advise_6 = "Attenzione !! Inserire almeno 3 caratteri nel campo Città !!";
var Advise_7 = "Attenzione !! Formato data non valida !! ";
}

var anno = document.forms[0].checkin_year_month.value;
var mese = document.forms[0].checkin_year_month.value;
var giorno = document.forms[0].checkin_monthday.value;
var mese2 = mese.substr(4,3).replace("-","")-1;
var anno2 = anno.substr(0,4);
var dt = new Date(anno2, mese2, giorno);
var now = new Date();
var today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
var confronta = giorno + "/" + mese2 + "/" + anno2;
if (dt < today){
alert(Advise_3);
document.forms[0].checkin_monthday.focus();
return false;
}

var date_array = confronta.split('/'); 
var day = date_array[0]; // Attention! Javascript consider months in the range 0 - 11
var month = date_array[1];
var year = date_array[2]; // This instruction will create a date object
source_date = new Date(year,month,day);
if (year != source_date.getFullYear()){
alert(Advise_7);
return false;
}
if (month != source_date.getMonth()){
alert(Advise_7);
return false;
}
if (day != source_date.getDate()){
alert(Advise_7);
return false;
}

//if (dt.getFullYear() != year || dt.getMonth() != month || dt.getDate() != day){
//alert(Advise_1);
//document.forms[0].checkin_monthday.focus();
//return false;
//}
//var year2 = document.forms[0].checkout_year.value;
//var month2 = document.forms[0].checkout_month.value - 1;
//var day2 = document.forms[0].checkout_monthday.value;
//var dt2 = new Date(year2, month2, day2);
//if (dt2.getFullYear() != year2 || dt2.getMonth() != month2 || dt2.getDate() != day2){
//alert(Advise_2);
//document.forms[0].checkout_monthday.focus();
//return false;
//}
//var now = new Date();
//var today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
//if (dt < today){
//alert(Advise_3);
//document.forms[0].checkin_monthday.focus();
//return false;
//}
//var now = new Date();
//var tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate());
//if (dt2 < tomorrow){
//alert(Advise_4);
//document.forms[0].checkout_monthday.focus();
//return false;
//}
//if (dt2 <= dt){
//alert(Advise_5);
//document.forms[0].checkout_monthday.focus();
//return false;
//}


return true;
}

