function setVal() {
  dz=document.form.duration.options[document.form.duration.selectedIndex].value;
  mz=document.form.numberofpeople.options[document.form.numberofpeople.selectedIndex].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;
lang=document.form.lang.value;

dollarconv=document.form.dollareuro.value;
poundeuro=document.form.poundeuro.value;

var d = new Date()
secs=d.getTime()
secss=("" + secs)
stamp=secss.substr(0,10)

sstemp = new Date(arrivalyear,arrivalmonth-1,arrivalday);
ss = sstemp.getTime();



//FIND OUT HOW MANY WEEKEND DAYS THERE ARE

weekend = 0
weekday = 0 

sstemp = new Date(arrivalyear,arrivalmonth-1,arrivalday);
ss = sstemp.getTime();

sx = ss
for (i = 1; i <= dz; i++)
{
dayuvweak = new Date (sx);
dayuvweak = dayuvweak.getDay()

if (dayuvweak < 5)
{
weekday++
} 
else {
weekend++
}
sx = (sx + 86400000)

}

//END FIND OUT HOW MANY WEEKEND DAYS THERE ARE

//window.alert(weekday)

min34 = minimum(dz,ss)
if (min34 == false) 
{return false;}

price= "0";

if (dz ==2)
{
{weekendprice = weekend*140}
{weekdayprice = weekday*100}
price = weekendprice + weekdayprice 
}



if (dz ==3)
{price = 285}
if (dz ==4)
{price = 340} 
if (dz ==5)
{price = 400} 
if (dz ==6)
{price = 450} 
if (dz ==7)
{price = 504}
if (dz >7)
{price = dz*68}
if (dz >14)
{price = dz*65}

supp = 0;
if (mz == 3)
{supp = dz*12}
if (mz == 4)
{supp = dz*20}
if (mz == 5)
{supp = dz*25}
if (mz == 6)
{supp = dz*30}
fullprices = price+supp;

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;
priceppn = fullprices/mz/dz;
pesetass = fullprices*166.386;

 document.form.id.value=+stamp;
 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.pppn.value=Math.round(+priceppn*100)/100;
//document.form.pesetas.value=Math.round(+pesetass);
document.form.holsupdays.value=holsupdays_zz;
document.form.holsup.value=holsup_zz;

}

