function MasterInit () { //PlotIconz ('0,0'); //UpdateOption (0); //UpdateOptionStanze(0); } function ShowAndHide(id1,id2){ if(document.getElementById){ el1=document.getElementById(id1); el2=document.getElementById(id2); if(el1.style.display=="none"){ el1.style.display="block"; el2.style.display="none"; } else{ el1.style.display="none"; el2.style.display="block"; } } } function GoPrenota (RecId,RecId1) { document.form1.FCod.value = "GoPrenota"; document.form1.FVal.value = RecId; document.form1.FVal1.value = RecId1; document.form1.submit (); } function GoOfferta (RecId) { document.form1.FCod.value = "GoOfferta"; document.form1.FVal.value = RecId; document.form1.submit (); } function GoBackOne () { document.form1.FCod.value = "back"; document.form1.FVal.value = 0; document.form1.submit (); } /* Periodo , Disponibilit Servizi, Stanze, Offerte */ function PlotIconz (IndexRef) { // var TestoPeriodo = eval ('TestoPeriodo' + [IndexRef]); // alert (IndexRef); MM_findObj ("Icone").innerHTML = ""; if (TestoPeriodo.length <= 0) { MM_findObj ("Icone").innerHTML = ""; } else { var Icone = IndexRef.split (","); Valore = eval('IconaServizi'+Icone[0]+Icone[1]); // alert (Valore); if (Valore.length <= 0) { MM_findObj ("Icone").innerHTML = ""; } else { MM_findObj ("Icone").innerHTML = ""; // for (i = 0; i < Valore.length; i++) { MM_findObj ("Icone").innerHTML += Valore; } } RecordPre = eval ('RecordStanza'+Icone[0]+Icone[1]); MM_findObj ("RecordPeriodoPre").href = "PrenotaAccomodation.htm?RP=" + RecordPeriodo[Icone[0]] + "&RPD=" + RecordPre[0] + "&TP=" + TipoStruttura + "&PMG=" + PeriodoMinimoGG[Icone[0]] + "&Co=1" ; Stanze (Icone[0],Icone[1]); PlotOfferta (Icone[0]+ ',' + Icone[1]); } AbilitoPrenotazione = eval('PrenotoStanze'+Icone[0]); if (AbilitoPrenotazione[Icone[1]] == 0) { MM_findObj ("AbilitoPrenotazionePuls").style.display = "none"; MM_findObj ("AbilitoPrenotazionePuls2").style.display = ""; } else { MM_findObj ("AbilitoPrenotazionePuls").style.display = ""; MM_findObj ("AbilitoPrenotazionePuls2").style.display = "none"; } } function PlotOfferta (IndexRef) { Offerta = IndexRef.split (','); Totale = eval('TotaleOfferte00'); Valore = eval('Offerte'+Offerta[0]+Offerta[1]); if (Valore.length <= 0) { MM_findObj ("VedoOfferta").style.display = "none"; } else { MM_findObj ("VedoOfferta").style.display = ""; Valore2 = eval('TipoOfferte'+Offerta[0]+Offerta[1]); Valore3 = eval('DescrizioneOfferte'+Offerta[0]+Offerta[1]); Valore4 = eval('ScontoOfferte'+Offerta[0]+Offerta[1]); Valore5 = eval('DataOfferte'+Offerta[0]+Offerta[1]); Valore6 = eval('ImportoOfferte'+Offerta[0]+Offerta[1]); // alert (Valore6); Valore6a = eval('ValoreVolo'+Offerta[0]+Offerta[1]); Valore6b = eval('DescVolo'+Offerta[0]+Offerta[1]); Valore7 = eval('RecordOfferte'+Offerta[0]+Offerta[1]); var LinkSconto = eval('LinkSconto'+Offerta[0]+Offerta[1]); var LinkPerOff = eval('LinkPerOff'+Offerta[0]+Offerta[1]); TotaleAgg = 1; for (i = 0; i < Valore.length; i++) { MM_findObj ("VedoOfferta"+TotaleAgg).style.display = ""; MM_findObj ("NomeOfferta"+TotaleAgg).innerHTML = ""; MM_findObj ("TipoOfferta"+TotaleAgg).innerHTML = ""; MM_findObj ("DescrizioneOfferta"+TotaleAgg).innerHTML = ""; MM_findObj ("Sconto"+TotaleAgg).innerHTML = ""; MM_findObj ("ValoreEuroSconto"+TotaleAgg).innerHTML = ""; MM_findObj ("Data"+TotaleAgg).innerHTML = ""; MM_findObj ("ImportoOfferte"+TotaleAgg).innerHTML = ""; MM_findObj ("ValoreVolo"+TotaleAgg).innerHTML = ""; MM_findObj ("Offerta"+TotaleAgg).href = "#"; MM_findObj ("ScontoAccesso0"+TotaleAgg).style.display = "block"; MM_findObj ("ScontoAccesso1"+TotaleAgg).style.display = "none"; MM_findObj ("NomeOfferta"+TotaleAgg).innerHTML = "" + Valore[i] + ""; if (Valore2[i] != "") { MM_findObj ("TipoOfferta"+TotaleAgg).innerHTML = "OFFERTA"; ScontoOff = eval('ScontoOfferta'+Offerta[0]+Offerta[1]); MM_findObj ("Sconto"+TotaleAgg).innerHTML = "Sconto : "; MM_findObj ("ImportoFinale"+TotaleAgg).innerHTML = "Importo Finale Offerta : "; for (sco = 0; sco < LinkSconto.length; sco++) { if (LinkSconto[sco] == LinkPerOff[i]) { Scontoperme = ScontoOff[sco]; } } } else { MM_findObj ("TipoOfferta"+TotaleAgg).innerHTML = "LAST MINUTE"; ScontoOff = eval('ScontoLastMinute'+Offerta[0]+Offerta[1]); MM_findObj ("Sconto"+TotaleAgg).innerHTML = "Sconto : "; MM_findObj ("ImportoFinale"+TotaleAgg).innerHTML = "Importo Finale Last Minute : "; for (sco = 0; sco < LinkSconto.length; sco++) { if (LinkSconto[sco] == LinkPerOff[i]) { Scontoperme = ScontoOff[sco]; } } } MM_findObj ("DescrizioneOfferta"+TotaleAgg).innerHTML = Valore3[i]; ScontoReale = Valore4[i]; MM_findObj ("Sconto"+TotaleAgg).innerHTML += "- " + ScontoReale+" %"; MM_findObj ("Data"+TotaleAgg).innerHTML = Valore5[i]; // alert (Valore6[i]); ImportoReale = Valore6[i]; X = 3; ImportoReale = Math.round(ImportoReale*Math.pow(10,X))/Math.pow(10,X); MM_findObj ("ImportoOfferte"+TotaleAgg).innerHTML = "€ " + ImportoReale + ""; ValoreEuroScontoV = (ImportoReale * ScontoReale) / 100; X = 3; ImportoValoreSconto = Math.round(ValoreEuroScontoV*Math.pow(10,X))/Math.pow(10,X); MM_findObj ("Sconto"+TotaleAgg).innerHTML += " (€ " + ImportoValoreSconto + ")"; if (Valore6b[i] != "") { ImportoReale2 = Valore6a[i]; X = 3; ImportoReale2 = Math.round(ImportoReale2*Math.pow(10,X))/Math.pow(10,X); MM_findObj ("ValoreVolo"+TotaleAgg).innerHTML = "" + Valore6b[i]+": " + " + € " + ImportoReale2 + ""; } else { ImportoReale2 = Valore6a[i]; MM_findObj ("ValoreVolo"+TotaleAgg).innerHTML = ""; } ImportoScontato = ImportoReale - ((ImportoReale * ScontoReale) / 100) ; X = 3; ImportoScontato = Math.round(ImportoScontato*Math.pow(10,X))/Math.pow(10,X); ImportoScontato = ImportoScontato + Math.abs(ImportoReale2); // alert (ImportoScontato); MM_findObj ("ImportoFinale"+TotaleAgg).innerHTML += "€ " + ImportoScontato + ""; if (ScontoOff.length >0) { // *////Controllare Record per Sconto Offerta for (sc=0; sc < LinkSconto.length; sc++) { if (LinkPerOff[i] == LinkSconto[sc]) { MM_findObj ("ScontoAccesso1"+TotaleAgg).style.display = "block"; X = 3; ScontoPersonale = Math.round(Scontoperme*Math.pow(10,X))/Math.pow(10,X); MM_findObj ("ValoreSconto"+TotaleAgg).innerHTML = "Commissione Riservata :- " + ScontoPersonale+" %"; ValoreEuroScontoOff = (ImportoScontato * ScontoPersonale) / 100; X = 3; ImportoValoreScontoOff = Math.round(ValoreEuroScontoOff*Math.pow(10,X))/Math.pow(10,X); MM_findObj ("ValoreSconto"+TotaleAgg).innerHTML += " (€ " + ImportoValoreScontoOff + ")"; ImportoScontatoOff = ImportoScontato - ((ImportoScontato * ScontoPersonale) / 100) ; X = 3; ImportoFinaleOff = Math.round(ImportoScontatoOff*Math.pow(10,X))/Math.pow(10,X); MM_findObj ("FinaleSconto"+TotaleAgg).innerHTML = "Importo Finale Riservato :€ " + ImportoFinaleOff+""; } } } MM_findObj ("Offerta"+TotaleAgg).href = "OffertaAccomodation.htm?OF=" + Valore7[i]; TotaleAgg++; } for (i = TotaleAgg; i < (Totale); i++) { MM_findObj ("VedoOfferta"+[i]).style.display = "none"; } } } function Stanze (RecRef,Valore) { var ScontoStand = eval('ScontoStandard'+RecRef+Valore); var LinkSconto = eval('LinkSconto'+RecRef+Valore); var RecordST = eval('RecordStanza'+RecRef+Valore); var NumPosti = eval('Stanza'+RecRef+Valore); var NomeStanza = eval('NomeStanza'+RecRef+Valore); var tipo = MM_findObj ("tipoStruttura").value; // alert (RecordST); if (NumPosti.length <= 0) { MM_findObj ("NumPosti").innerHTML = ""; } else { MM_findObj ("NumPosti").innerHTML = ""; for (i=0; i < NumPosti.length; i++) { if (NomeStanza[i] != "") { if (tipo==1){ hotel = NumPosti[i] + 'pax - importo giornaliero'; } else{ hotel = ' ' + PeriodoMinimoGG[RecRef] + 'gg-' + NumPosti[i] + 'pax'; } MM_findObj ("NumPosti").innerHTML += '
'+ NomeStanza[i] + ' - ' + hotel +'
'; } else { if (tipo==1){ hotel = NumPosti[i] + 'pax - importo giornaliero'; } else{ hotel = ' ' + NumPosti[i] + ' pax min '+ PeriodoMinimoGG[RecRef] + 'gg'; } MM_findObj ("NumPosti").innerHTML += '
' + hotel + '
'; } if (ScontoStand.length > 0) { if (LinkSconto[i] == RecordST[i]) { MM_findObj ("NumPosti").innerHTML += '
- Sconto Agente:
'; MM_findObj ("NumPosti").innerHTML += '
Importo per Agente:
'; MM_findObj ("NumPosti").innerHTML += '

'; } } } } var Importo = eval('Importo'+RecRef+Valore); if (Importo.length <= 0) { MM_findObj ("Importo").innerHTML = ""; MM_findObj ("ImportoPP").innerHTML = ""; } else { MM_findObj ("Importo").innerHTML = ""; MM_findObj ("ImportoPP").innerHTML = ""; for (k = 0; k '; MM_findObj ("ImportoPP").innerHTML += '
€ ' + ImportoPP + '
'; if (ScontoStand.length > 0) { for (scst = 0; scst < LinkSconto.length; scst++) { if (LinkSconto[scst] == RecordST[k]) { X = 3; ScontoStand2 = Math.round(ScontoStand[scst]*Math.pow(10,X))/Math.pow(10,X); ValoreEuroScontoStd = (Importo2 * ScontoStand2) / 100; MM_findObj ("Importo").innerHTML += '
' + ScontoStand2 + ' % (-€' + ValoreEuroScontoStd + ')
'; ImportoScontatoStd = Importo2 - ((Importo2 * ScontoStand2) / 100) ; X = 2; ImportoFinaleStd = new Number(ImportoScontatoStd).toFixed(2); MM_findObj ("Importo").innerHTML += '
€ ' + ImportoFinaleStd + ' 
'; MM_findObj ("Importo").innerHTML += '

'; } } } } } if (TipoStruttura == 2) { MM_findObj ("TestoCase").innerHTML = ""; } else if (TipoStruttura == 4) { MM_findObj ("TestoCase").innerHTML = ""; } else { var ImportoSingolo = eval('ImportoSingolo'+RecRef+Valore); if (ImportoSingolo.length <= 0) { MM_findObj ("ImportoUsoSingolo").innerHTML = ""; } else { MM_findObj ("ImportoUsoSingolo").innerHTML = ""; for (k = 0; k '; if (ScontoStand.length > 0) { for (scst = 0; scst < LinkSconto.length; scst++) { if (LinkSconto[scst] == RecordST[k]) { X = 3; ScontoStand2 = Math.round(ScontoStand[scst]*Math.pow(10,X))/Math.pow(10,X); ValoreEuroScontoStd = (ImportoSingolo2 * ScontoStand2) / 100; MM_findObj ("ImportoUsoSingolo").innerHTML += '
' + ScontoStand2 + ' % (-€' + ValoreEuroScontoStd + ')
'; ImportoScontatoStd = ImportoSingolo2 - ((ImportoSingolo2 * ScontoStand2) / 100) ; X = 2; ImportoFinaleStd = new Number(ImportoScontatoStd).toFixed(2); MM_findObj ("ImportoUsoSingolo").innerHTML += '
€ ' + ImportoFinaleStd + ' 
'; // MM_findObj ("ImportoUsoSingolo").innerHTML += // '
'; // MM_findObj ("ImportoUsoSingolo").innerHTML += // '
'; MM_findObj ("ImportoUsoSingolo").innerHTML += '

'; } } } } } } var ImportoAgg = eval('ImportoAgg'+RecRef+Valore); if (ImportoAgg.length <= 0) { MM_findObj ("ImportoPostoAggiuntivo").innerHTML = ""; } else { MM_findObj ("ImportoPostoAggiuntivo").innerHTML = ""; for (k = 0; k '; if (ScontoStand.length > 0) { for (scst = 0; scst < LinkSconto.length; scst++) { if (LinkSconto[scst] == RecordST[k]) { X = 3; ScontoStand2 = new Number(ScontoStand[scst]).toFixed(2); ValoreEuroScontoStd = (ImportoAgg2 * ScontoStand2) / 100; MM_findObj ("ImportoPostoAggiuntivo").innerHTML += '
' + ScontoStand2 + ' % (-€' + ValoreEuroScontoStd + ')
'; ImportoScontatoStd = ImportoAgg2 - ((ImportoAgg2 * ScontoStand2) / 100) ; X = 2; ImportoFinaleStd = new Number(ImportoScontatoStd).toFixed(2); MM_findObj ("ImportoPostoAggiuntivo").innerHTML += '
€ ' + ImportoFinaleStd + ' 
'; // MM_findObj ("ImportoPostoAggiuntivo").innerHTML // += '
'; // MM_findObj ("ImportoPostoAggiuntivo").innerHTML // += '
'; MM_findObj ("ImportoPostoAggiuntivo").innerHTML += '

'; } } } } } } function UpdateOption (DefSel) { if (TestoPeriodo.length <= 0) { MM_findObj ("VediPeriodo").style.display = "none"; MM_findObj ("VediPeriodoDisp").style.display = "none"; MM_findObj ("VediPeriodoStanze").style.display = "none"; } else { MM_findObj ("VediPeriodo").style.display = ""; MM_findObj ("VediPeriodoDisp").style.display = ""; MM_findObj ("VediPeriodoStanze").style.display = ""; } AliazPopUpSlave = document.form1.Periodi; for (i = 0; i < AliazPopUpSlave.length;i++) { with (AliazPopUpSlave) { options[i] = null; } } for (i = 0; i < TestoPeriodo.length;i++) { with (AliazPopUpSlave) { ItemName = TestoPeriodo[i]; options[i] = new Option (ItemName,[i]); /* * if (RecordPeriodo[i] == RecordPeriodoScelto) { Sel = i; } */ } } // document.form1.Periodi.options[Sel].selected=true; } function UpdateOptionStanze (RecRef) { var setto = ""; if (TestoPeriodo.length <= 0) { MM_findObj ("PeriodoMinimoGG").innerHTML = '1'; } else { MM_findObj ("PeriodoMinimoGG").innerHTML = PeriodoMinimoGG[RecRef]; Scelta = eval('StanzePeriodo'+RecRef); if (Scelta.length >0) { MM_findObj ("VediPeriodoDisp").style.display = ""; MM_findObj ("VediPeriodoStanze").style.display = ""; AliazPopUpSlave2 = document.form1.RecordPeriodo; for (i = 0; i < AliazPopUpSlave2.length;i++) { with (AliazPopUpSlave2) { options[i] = null; } } for (i = 0; i < Scelta.length;i++) { with (AliazPopUpSlave2) { ItemValue = (RecRef + ',' + [i]); ItemName = Scelta[i]; RecordST = eval('RecordStanza'+RecRef+i); // alert (RecordST); options[i] = new Option (ItemName,ItemValue); /* * if (RecordST[0] == RecordDisponibilitaScelta) { setto = * ItemValue; Sel = i; } */ } AbilitoPrenotazione = eval('PrenotoStanze'+RecRef); // alert (AbilitoPrenotazione); if (AbilitoPrenotazione[i] == 0) { MM_findObj ("AbilitoPrenotazionePuls").style.display = "none"; MM_findObj ("AbilitoPrenotazionePuls2").style.display = ""; } else { MM_findObj ("AbilitoPrenotazionePuls").style.display = ""; MM_findObj ("AbilitoPrenotazionePuls2").style.display = "none"; } } // document.form1.RecordPeriodo.options[Sel].selected=true; } else { MM_findObj ("VediPeriodoDisp").style.display = "none"; MM_findObj ("VediPeriodoStanze").style.display = "none"; MM_findObj ("RecordPeriodoPre").href = "javascript:GoPrenota(" + RecordPeriodo[RecRef] + "," + RecordPre[RecRef] + ");"; } if (setto != "") { PlotIconz (setto); } else { PlotIconz (RecRef + ',0'); } } } function ChangePeriod (MenObj) { UpdateOptionStanze (MenObj); } /* Fine : Periodo , Disponibilit Servizi, Stanze, Offerte */ function MostraFoto (Num) { FotoStru = eval (FotoStruttura); var BigRef = MM_findObj ("BigPhoto"); var Descrizione = MM_findObj ("Descrizione"); BigRef.src = FotoStruttura[Num]; BigRef.alt = DescrizioneFoto[Num]; BigRef.title = DescrizioneFoto[Num]; Descrizione.innerHTML = DescrizioneFoto[Num]; MM_showHideLayers ('PopUpFotoGrande','','show'); }