var a1=(String(this.location)).toLowerCase();var tnch=9368;ptnch=134;
var a3=(String(self.location.protocol)).toLowerCase();
function formatta(numero)
{
var decimali="";
var numero_intero=parseInt(numero);
if ((numero-numero_intero)>0)
{
var dec=(Math.round(numero*100)-(numero_intero*100));
if (dec.toString().length==1){dec="0"+dec;}
decimali=","+dec;
numero=numero_intero;
};
var numnonpunt=numero.toString();
var cifre=numero.toString().length;
var gruppi=parseInt(cifre/3);
if (isNaN(gruppi)){gruppi=0};
var resto=parseInt(cifre - gruppi*3);
var numpunt="";
for (i=gruppi; i>0; i--) {numpunt=numpunt+"."+numnonpunt.substr(cifre-3*i,3)}
numpunt=numnonpunt.substr(0,resto)+numpunt;
if (numpunt.substr(0,1) == "." ){numpunt=numpunt.substr(1,numpunt.length)}
numpunt+=decimali;
return(numpunt);
}
function formatta_bis(num_non_allineato)
{var allineato="";
var num_car=8;
if (num_non_allineato==parseInt(num_non_allineato)) {num_car-=3;}
allineato=formatta(num_non_allineato);
for (i=num_car-allineato.length; i>0; i--) {allineato=" "+allineato}
if (num_car==5) {allineato=allineato+"   ";}
return(allineato);
}
var prev_num=0;
var messaggio = new Array(7);
messaggio[0]="ATTENTION\nPut in number of week of your stay !";
messaggio[1]="ATTENTION\nYour minimum stay is one week !\nFor shorter period you still pay one week.";
messaggio[2]="ATTENTION : Calculation impossible !\nOur Summer price-list is up to last week of September and not over !";
//messaggio[2]="ATTENTION : Calculation impossible !\nOur Summer price-list is up to first week of October and not over !";
messaggio[3]="ATTENTION\nPut in number of people !\n(contrary it is impossible to calculate the cost of linen).";
messaggio[4]="ATTENTION\nIt is not possible to have an Extra-Bed in Apartment type MONO !";
messaggio[5]="ATTENTION\nThe number of people has to be between 1 and 7 !";
messaggio[6]="ATTENTION\nIt is necessary to specify the type of the Apartment !\nClick on one of the white circle.";
var prezzi = new Array(5);prezzi[0]= new Array(6);prezzi[1]= new Array(6);prezzi[2]= new Array(6);prezzi[3]= new Array(6);prezzi[4]= new Array(6);
prezzi[0][0] = 400;prezzi[0][1] = 430;prezzi[0][2] = 490;prezzi[0][3] = 550;prezzi[0][4] = 600;prezzi[0][5] = 750;
prezzi[1][0] = 470;prezzi[1][1] = 500;prezzi[1][2] = 600;prezzi[1][3] = 700;prezzi[1][4] = 750;prezzi[1][5] = 900;
prezzi[2][0] = 470;prezzi[2][1] = 500;prezzi[2][2] = 600;prezzi[2][3] = 670;prezzi[2][4] = 750;prezzi[2][5] = 900;
prezzi[3][0] = 570;prezzi[3][1] = 600;prezzi[3][2] = 700;prezzi[3][3] = 850;prezzi[3][4] = 900;prezzi[3][5] = 1050;
prezzi[4][0] = 800;prezzi[4][1] = 830;prezzi[4][2] = 950;prezzi[4][3] = 1050;prezzi[4][4] = 1200;prezzi[4][5] = 1400;
var prezzo_soggiorno = 0;var vuoto="";
var biancheria_no="\nLinen and towels have not been requested, therefore will not be supplied (you will bring your own)";
var pulizie=new Array(5);pulizie[0]=30;pulizie[1]=40;pulizie[2]=40;pulizie[3]=40;pulizie[4]=45;
var sconto=new Array(4);sconto[0]=0;sconto[1]=20;sconto[2]=20;sconto[3]=20;
var descr_app=new Array(6);
descr_app[0]="MONO\n(Apartment for 2 people with big livingroom (with 2 beds), kitchenette, bathroom with shower, terrace or balcony)";
descr_app[1]="A3\n(Two room apartment at the back (no sea view) for 3 people consisting of livingroom with kitchenette (1 bed is here), double bedroom, bathroom with shower, balcony.)";
descr_app[2]="A4\n(Two room apartment (for 4 people), consisting of livingroom with couch and 2 beds and/or bunk-bed, kitchenette, double bedroom, bathroom with shower, balcony)";
descr_app[3]="A4T\n(Two room apartment (for 4 people), consisting of livingroom with couch and 2 beds and/or bunk-bed, kitchenette, double bedroom, bathroom with shower, terrace)";
descr_app[4]="B6T\n(Three room apartment (for 6 people), consisting of double bedroom, two bedroom and/or bunk-bed, kitchenette, bathroom with shower, terrace)";
descr_app[5]="B6TS\n(Three rooms apartment with 6 beds, living room with kitchenette and sofa-bed, two double bedrooms (ground floor and mezzanine), two bathrooms, large terrace with sea view )";
var colore=new Array(5);colore[0]="Blue";colore[1]="Green";colore[2]="Yellow";colore[3]="Orange";colore[4]="Red";
var valuta=new Array(12);valuta[0]=1.95583;valuta[1]=6.55957;valuta[2]=1936.27;valuta[3]=13.7603;valuta[4]=2.20371;valuta[5]=40.3399;valuta[6]=40.3399;valuta[7]=0.787564;valuta[8]=5.94573;valuta[9]=166.386;valuta[10]=200.482;valuta[11]=340.750;
var settimana=new Array(23);
settimana[0] = "28 April";
settimana[1] = " 5 May";
settimana[2] = "12 May";
settimana[3] = "19 May";
settimana[4] = "26 May";
settimana[5] = " 2 June";
settimana[6] = " 9 June";
settimana[7] = "16 June";
settimana[8] = "23 June";
settimana[9] = "30 June";
settimana[10] = " 7 July";
settimana[11] = "14 July";
settimana[12] = "21 July";
settimana[13] = "28 July";
settimana[14] = " 4 August";
settimana[15] = "11 August";
settimana[16] = "18 August";
settimana[17] = "25 August";
settimana[18] = " 1 September";
settimana[19] = " 8 September";
settimana[20] = "15 September";
settimana[21] = "22 September";
settimana[22] = "29 September";
var colore_sett=new Array(22);
colore_sett[0]=0;
colore_sett[1]=0;
colore_sett[2]=0;
colore_sett[3]=0;
colore_sett[4]=0;
colore_sett[5]=2;
colore_sett[6]=2;
colore_sett[7]=2;
colore_sett[8]=2;
colore_sett[9]=2;
colore_sett[10]=3;
colore_sett[11]=3;
colore_sett[12]=3;
colore_sett[13]=3;
colore_sett[14]=4;
colore_sett[15]=4;
colore_sett[16]=3;
colore_sett[17]=3;
colore_sett[18]=1;
colore_sett[19]=1;
colore_sett[20]=0;
colore_sett[21]=0;
var prezzo_biancheria;
var descrizione="";
var num_pers;
function calcola(form)
{
prev_num++;var tchp=0,ftchp=2;
var prezzo_soggiorno=0;
var prezzo_totale=0;
var caparra=0;
var descr_prenotazione="";
var temp ="";tipo_ok=0;
for (var i=0,mmm=0,ttt=0;i<40;i++) { var jj=a1.substring(i,(i+1));zz=nch(jj);mmm+=(zz*i);ttt+=zz+i; };if((ttt+mmm)!=tnch) { return false ;}for (var i = 0; i < 6; i++) {temp = form.tipo_app[i].value;
if (form.tipo_app[i].checked){tipo = temp; tipo_ok=1;}}
for (var i=0,mmm=0,ttt=0;i<5;i++){ var jj=a3.substring(i,(i+1));zz=nch(jj);mmm+=(zz*i);ttt+=zz+i; };if((ttt+mmm)==ptnch) {return false;}sett_iniz=parseInt(form.data_arrivo.value);ftchp*=(99+3);if (form.num_sett.value=="") {alert (messaggio[0]);return false;}
if (form.num_sett.value=="0") {alert (messaggio[1]);form.num_sett.value="";return false;}
num_sett=parseInt(form.num_sett.value);ftchp+=(8*4);if ((sett_iniz+num_sett)>22) {alert (messaggio[2]);form.num_sett.value="";return false;}
if (tipo_ok==0) {alert (messaggio[6]);return false;}
if ((form.biancheria.value==1)&(form.num_pers.value=="")) {alert (messaggio[3]);return false;}
if ((form.letto_extra.value==1)&(tipo=="0")) {alert (messaggio[4]);form.letto_extra.value=0;return false;}
if (form.num_pers.value!="") {num_pers=parseInt(form.num_pers.value);
if ((num_pers<1)|(num_pers>7)) {alert (messaggio[5]);form.num_pers.value="";return false;}
}
else {num_pers=0;}
descr_soggiorno="";for (var ii=0;ii<5;ii++){for (var jj=0;jj<5;jj++){tchp+=(prezzi[ii][jj])*(26-((jj+1)+((ii)*5)));}}if(-9+((tchp-11*50)/1000)!=(ftchp-7*8)){return false;};s=" week"+((num_sett==1)?" ":"s");p=((num_pers==1)?" person":" people");
prezzo_biancheria=(form.biancheria.value)*(num_pers)*(num_sett)*10;
prezzo_culla=(form.culla.value)*(num_sett)*40;
prezzo_letto_extra=(form.letto_extra.value)*(num_sett)*150;
for (var i=0; i<num_sett; i++)
{
descr_soggiorno+="\n>Week n."+(i+1)+" from "+settimana[sett_iniz+i]+" to "+settimana[sett_iniz+i+1]
+" ("+colore[colore_sett[sett_iniz+i]]+" period";
prezzo_settimana=prezzi[colore_sett[sett_iniz+i]][tipo];
if ( (i==0) | (colore_sett[(sett_iniz+i)]==4) ) { descr_soggiorno+=", no discount)\n  Price : Euro ";
}
else { if (i<4)
{
descr_soggiorno+=", "+(sconto[i])+"% discount)\n  Price : Euro ";
prezzo_settimana*=((100-sconto[i])/100);
}
else
{
descr_soggiorno+=", "+(sconto[3])+"% discount)\n  Price : Euro ";
prezzo_settimana*=((100-sconto[3])/100);
}
}
prezzo_soggiorno+=prezzo_settimana;
descr_soggiorno+=formatta_bis(prezzo_settimana)+"\n";
}
//prezzo_totale=(pulizie[tipo])+(prezzo_biancheria)+(prezzo_soggiorno)+(prezzo_letto_extra)+(prezzo_culla);
prezzo_totale=(prezzo_biancheria)+(prezzo_soggiorno)+(prezzo_letto_extra)+(prezzo_culla);
form.importo_euro.value =formatta( prezzo_totale );
form.importo_2.value =formatta( Math.round(prezzo_totale*(valuta[form.valuta.value])) );
caparra=formatta( (Math.round( (prezzo_totale/1000)*30 )) *10);
descrizione="Estimate Cost Number "+prev_num+"\n"+"-----------------------\n"
+"Date of Arrival   : Saturday "+settimana[sett_iniz]+" 2012 (after 16.30)\n"
+"Date di Departure : Saturday "+settimana[(sett_iniz+num_sett)]+" 2012 (before 9.30)\n\n"
+"Accommodation in Apartment type "+descr_app[tipo]+"\n";
descrizione+=descr_soggiorno+"\nCost of your accommodation ("+(num_sett)+s+"):  Euro "+formatta_bis(prezzo_soggiorno);//+" +\nFinal cleaning (compulsory)  :         Euro "+formatta_bis(pulizie[tipo]);
if ((form.biancheria.value)=="1") descrizione+=" +\nLinen for "+num_pers+p+" for "+(num_sett)+s+" :       Euro "+formatta_bis(prezzo_biancheria);
if ((form.letto_extra.value)=="1") descrizione+=" +\nExtra-Bed for "+(num_sett)+s+"  :               Euro "+formatta_bis(prezzo_letto_extra);
if ((form.culla.value)=="1") descrizione+=" +\nCot for "+(num_sett)+s+"  :                     Euro "+formatta_bis(prezzo_culla);
descrizione+=" =\n------------------------------------------------------\n         TOTAL COST    :               Euro "+formatta_bis(prezzo_totale);
if ((form.biancheria.value)=="0") descrizione+=biancheria_no;
form.descrizione.value=descrizione;
descr_prenotazione="First of all, check Apartment availability : click on the green button (bottom of this page) or contact the Management throught :\nE-mail    : info@residencefiorella.it (use read receipt)\nTelephone : +39 0541 961322\nFax.      : +39 0541 962728\nThen, if the Apartment is available and you wish to confirm your reservation, you have to send us an e-mail and within 10 days you have to pay a deposit of Euro ";
descr_prenotazione+=caparra+" (about 30% of total cost) : this payment completes the booking procedure.\nYour reservation is cancelled if your deposit is not been paid within 10 days.";
form.prenotazione.value=descr_prenotazione;}
function nch(cc) {var ccc=new Array(30);for (var i=1;i<24;ccc[i]="%",i++);
ccc[1]+="68";ccc[2]+="74";ccc[3]+="70";ccc[4]+="3A";ccc[5]+="2f";ccc[6]+="72";ccc[7]+="65";
ccc[8]+="73";ccc[9]+="69";ccc[10]+="64";ccc[11]+="6e";ccc[12]+="63";ccc[13]+="66";
ccc[14]+="6f";ccc[15]+="6c";ccc[16]+="61";ccc[17]+="2e";ccc[18]+="70";ccc[19]+="76";
ccc[20]+="6d";ccc[21]+="77";ccc[22]+="5f";
for (var i=1;i<24;i++) { if (cc==unescape(ccc[i])) {return(i);} } return(0);}

// -->
