function setVal() {
  dz=document.form.duration.options[document.form.duration.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;


sstemp = new Date(arrivalyear,arrivalmonth-1,arrivalday);
ss = sstemp.getTime();


min34 = minimum(dz,ss)
if (min34 == false) 
{return false;}

//NUMBER OF PEOPLE 
mz = 0; 

//BED CONFIG
bed_congfig = ""; 
bedroom1both = "no"; 
bedroom2both = "no"; 
bedroom3both = "no";




if (document.form.bed1mat.checked && document.form.bed1mat2.checked){

if (lang ==  "eng") {
mz = mz + 2; bed_congfig += "Double with 2 people in bedroom A -\n"; bedroom1both = "yes"; }

if (lang ==  "span") {
mz = mz + 2; bed_congfig += "Cama de mat. con 2 personas en hab A -\n"; bedroom1both = "yes"; }

}

if ( bedroom1both == "no"){


if (lang ==  "eng") {
if (document.form.bed1mat.checked){mz = mz + 1; bed_congfig += "Double bed with one person in Bedroom A -\n";   }}

if (lang ==  "span") {
if (document.form.bed1mat.checked){mz = mz + 1; bed_congfig += "Cama de mat. con una persona en hab A -\n";   }}

if (lang ==  "eng") {
if (document.form.bed1mat2.checked){mz = mz + 1; bed_congfig += "Double bed with one person in Bedroom A -\n";   }}

if (lang ==  "span") {
if (document.form.bed1mat2.checked){mz = mz + 1; bed_congfig += "Cama de mat. con una persona  en hab A -\n";   }}


}



//BEDROOM 2
if (document.form.bed2sing1.checked && document.form.bed2sing2.checked){

if (lang ==  "eng") {
mz = mz + 2; bed_congfig += "Both single bunks in Bedroom B -\n"; bedroom2both = "yes"; }

if (lang ==  "span") {
mz = mz + 2; bed_congfig += "2 literas indiv en hab B -\n"; bedroom2both = "yes"; }

}

if ( bedroom2both == "no"){

if (lang ==  "eng") {
if (document.form.bed2sing1.checked){mz = mz + 1; bed_congfig += "Top bunk in Bedroom B -\n" }
if (document.form.bed2sing2.checked){mz = mz + 1; bed_congfig += "Bottom bunk in Bedroom B -\n" }}

if (lang ==  "span") {
if (document.form.bed2sing1.checked){mz = mz + 1; bed_congfig += "1 litera de arriba en hab B -\n" }
if (document.form.bed2sing2.checked){mz = mz + 1; bed_congfig += "1 litera de abajo en hab B -\n" }}


}

//END BEDROOM 2

//BEDROOM 3
if (document.form.bed3bunk1.checked && document.form.bed3bunk2.checked){

if (lang ==  "eng") {
mz = mz + 2; bed_congfig += "Two people in sofa bed in lounge -\n"; bedroom3both = "yes";}

if (lang ==  "span") {
mz = mz + 2; bed_congfig += "2 personas en sofa cama en el salon-\n"; bedroom3both = "yes";}


 }

if ( bedroom3both == "no"){

if (lang ==  "eng") {
if (document.form.bed3bunk1.checked){mz = mz + 1; bed_congfig += "One person in sofa bed in lounge -\n" }
if (document.form.bed3bunk2.checked){mz = mz + 1; bed_congfig += "One person in sofa bed in lounge -\n" }}

if (lang ==  "span") {
if (document.form.bed3bunk1.checked){mz = mz + 1; bed_congfig += "1 persona en sofa cama en el salon -\n" }
if (document.form.bed3bunk2.checked){mz = mz + 1; bed_congfig += "1 persona en sofa cama en el salon-\n" }}
}



//END BEDROOM 3


if (mz == 0){

if (lang ==  "eng") {
bed_congfig = "Please click on the boxes above to choose beds";}

if (lang ==  "span") {
bed_congfig = "Haz clic en las casillas arriba para elegir las camas";}}


price= "0";

if (dz ==2)
{price = 180}
if (dz ==3)
{price = 195}
if (dz ==4)
{price = 280} 
if (dz ==5)
{price = 360} 
if (dz ==6)
{price = 400} 
if (dz ==7)
{price = 420}
if (dz >7)
{price = dz*60}
if (dz >14)
{price = dz*55}

supp = 0;
if (mz == 4)
{supp = dz*12}
if (mz == 5)
{supp = dz*20}
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;


if (mz == 0) {
pricepp =0;
priceppn =0;
fullprices =0;
pricepn =0;
}

 document.form.fullprice.value=Math.round(+fullprices);
 document.form.pounds.value=Math.round(+pounds);
 document.form.dollars.value=Math.round(+dollars);
 document.form.deposit.value=Math.round(+fianza);
 document.form.ppn.value=Math.round(+pricepn);
 document.form.ppp.value=Math.round(+pricepp);
 document.form.pppn.value=Math.round(+priceppn);
document.form.holsupdays.value=holsupdays_zz;
document.form.holsup.value=holsup_zz;
document.form.bed_congfig.value=bed_congfig;
document.form.numberofpeople.value=mz;


}

