function setVal() {
  dz=document.form.duration.options[document.form.duration.selectedIndex].value;
  mz=document.form.numberofpeople.options[document.form.numberofpeople.selectedIndex].value;
  hma=document.form.howmanyap.value;
  arrivalday=document.form.arrivalday.options[document.form.arrivalday.selectedIndex].value;
  arrivalmonth=document.form.arrivalmonth.options[document.form.arrivalmonth.selectedIndex].value;
  arrivalyear=document.form.arrivalyear.options[document.form.arrivalyear.selectedIndex].value;
  dollarconv=document.form.dollareuro.value;
  poundeuro=document.form.poundeuro.value;
  lang=document.form.lang.value;
  
  

var d = new Date()
secs=d.getTime()



sstemp = new Date(arrivalyear,arrivalmonth-1,arrivalday);
ss = sstemp.getTime();


//var ninety_day_in_future=new Date()
//ninety_day_in_future.setDate(ninety_day_in_future.getDate()+95)

//window.alert(ss+"hello"+ninety_day_in_future+"sstemis"+sstemp);

//if ( ninety_day_in_future < sstemp )
//{alert ( "It is not possible to book this apartment more than 90 days in the future. You can only book until //"+ninety_day_in_future );}


price= "0";


//1 or 2 pax
if (dz == 2 && mz < 3)
{price = dz * 100}
if (dz == 3 && mz < 3)
{price = dz * 88}
if (dz == 4 && mz < 3)
{price = dz * 76}
if (dz == 5 && mz < 3)
{price = dz * 70}
if (dz == 6 && mz < 3)
{price = dz * 65}
if (dz > 6 && mz < 3)
{price = dz*65}


//3 pax
if (dz == 2 && mz == 3)
{price = dz * 110}
if (dz == 3 && mz == 3)
{price = dz * 90}
if (dz == 4 && mz == 3)
{price = dz * 80}
if (dz == 5 && mz == 3)
{price = dz * 72}
if (dz == 6 && mz == 3)
{price = dz * 70}
if (dz > 6 && mz == 3)
{price = dz*68}

//4 pax
if (dz == 2 && mz == 4)
{price = dz * 120}
if (dz == 3 && mz == 4)
{price = dz * 100}
if (dz == 4 && mz == 4)
{price = dz * 90}
if (dz == 5 && mz == 4)
{price = dz * 80}
if (dz == 6 && mz == 4)
{price = dz * 74}
if (dz > 6 && mz == 4)
{price = dz*72}


fullprices = price;


discountsup(dz,fullprices,ss)
fullprices = fullprices + holsup_zz;

fianth = fullprices/4;
if (fianth < 51 )
{fianth = 50}

dollars = fullprices*dollarconv; 
pounds = fullprices*poundeuro; 
fianza = fianth;
pricepn = fullprices/dz;
pricepp = fullprices/mz;
pesetass = fullprices*166.386;
restante = fullprices - fianth;


document.form.fullprice.value=Math.round(+fullprices*100)/100;
document.form.pounds.value=Math.round(+pounds*100)/100;
document.form.dollars.value=Math.round(+dollars*100)/100;
document.form.deposit.value=Math.round(+fianza*100)/100;
document.form.ppn.value=Math.round(+pricepn*100)/100;
document.form.ppp.value=Math.round(+pricepp*100)/100;
document.form.pesetas.value=Math.round(+pesetass);
document.form.depositeuros.value=Math.round(+restante);
document.form.holsupdays.value=holsupdays_zz;
document.form.holsup.value=holsup_zz;
}
            
