function getRadioButtonSelectedValue(ctrl) { for(i=0;i 2 //review data if(isNaN(aantK)) {aantK=0} if ((vanJ < 2000) && (vanJ>0)) { vanJ = vanJ+2000; document.boekform.data_DatumvanJ.value=vanJ; } if ((tmJ < 2000) && (tmJ>0)) { tmJ = tmJ+2000 document.boekform.data_DatumtmJ.value=tmJ; } bbed = getRadioButtonSelectedValue(document.boekform.data_Babybed); if (bbed == 'J') { extBbed = 3; } else { extBbed = 0; } //create date variables and calculate number of days vanDatum = new Date(vanJ,vanM,vanD); tmDatum= new Date(tmJ,tmM,tmD); numDays=((tmDatum-vanDatum)/86400000); // 24*60*60*1000 (date calc gives milliseconds) numDays=numDays.toFixed(0); //some bug with date = 24-3-2006 //determine price per day - based on # of days and discount if(discnt) { dayPrice=60; dayPriceFullWeek=54; } else { dayPrice=66; dayPriceFullWeek=60; dayPriceTwoWeeks=56; } //calculate price, number of people and total if (numDays>6) {dayPrice=dayPriceFullWeek} // discount if more than 6 days booked if (numDays>13) {dayPrice=dayPriceTwoWeeks} // discount if more than 13 days booked numPersons=aantV+aantK; if (numPersons>2) { aantExt=(numPersons-2); }else{ aantExt=0; } total=(numDays*dayPrice)+(aantExt*extCharge*numDays)+(numDays*extBbed); total=total.toFixed(2); if (!isNaN(total) && (total>0)) { document.boekform.data_Price.value=total; }else{ document.boekform.data_Price.value=''; } }