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.options[document.form.howmanyap.selectedIndex].value;
  dollarconv=document.form.dollareuro.value;
  poundeuro=document.form.poundeuro.value;

lang=document.form.lang.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;


price= 0;

//START OF 2006
if (arrivalyear == 2006) 
{

if (mz < 5*hma && dz > 6)
{price = dz*94.57*hma}
if (mz > 4*hma && dz > 6)
{price = dz*121.57*hma}

if (mz < 5*hma && dz == 2)
{price = 210*hma}
if (mz < 5*hma && dz == 3)
{price = 315*hma}
if (mz < 5*hma && dz == 4)
{price = 420*hma}
if (mz < 5*hma && dz == 5)
{price = 525*hma}
if (mz < 5*hma && dz == 6)
{price = 630*hma}

if (mz > 4*hma && dz == 2)
{price = 260*hma}
if (mz > 4*hma && dz == 3)
{price = 390*hma}
if (mz > 4*hma && dz == 4)
{price = 520*hma}
if (mz > 4*hma && dz == 5)
{price = 650*hma}
if (mz > 4*hma && dz == 6)
{price = 780*hma}


supp = 0;
if (mz > hma*5)
{supp = dz*20*(mz - (hma*5))}

}
//END OF 2006


//START OF 2007
if (arrivalyear > 2006) 
{


//less than 5 pax
if (mz < 5*hma)
{price = (dz * 110) *hma}

//more than 4 pax
if (mz > 4*hma)
{price = (dz * 136) *hma}

supp = 0;
if (mz > hma*5)
{supp = dz*21*(mz - (hma*5))}


//MORE THAN 6 DAYS
if (dz > 6) 
{

//less than 5 pax
if (mz < 5*hma)
{price = (dz * 99) *hma}

//more than 4 pax
if (mz > 4*hma)
{price = (dz * 122.4) *hma}

supp = 0;
if (mz > hma*5)
{supp = dz*18.8*(mz - (hma*5))}
}

}
//END OF 2007




if (lang == "eng")
{text = "The maximum number of people in each apartment is 6. You need 2 apartments.";}

if (lang == "span")
{text = "El número máximo de personas es 6 en cada apartamento. Necesitas 2 apartamentos.";}

if (mz > 6 && hma == 1)
{window.alert(text)}


fullprices = price+supp ;

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;

 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);
}
            
     
