// Tours, accomodation, Locations, Price LISTS
var daysList = new Array (7)
daysList[0] = 'Day Two' 
daysList[1] = 'Day Three' 
daysList[2] = 'Day Four' 
daysList[3] = 'Day Five' 
daysList[4] = 'Day Six' 
daysList[5] = 'Day Seven' 
daysList[6] = 'Day Eight' 

//list of accommodaton
var accomList = new Array ()
accomList[0] = 'none'
accomList[1] = 'Waterfront Terraces'
accomList[2] = 'Meridian (min 2 nights)'
accomList[3] = 'Cook Town 2 days 1 night'
accomList[4] = 'Undara 2 days 1 night'
accomList[5] = 'Cape Tribulation Resort and Spa'
accomList[6] = 'Reef Encounter 2 days 1 night (dive)'
accomList[7] = 'Reef Encounter 3 days 2 nights (dive)'
accomList[8] = 'Rum Runner 2 days 1 night (dive)'
accomList[9] = 'Taka 4 days 3 nights (dive)'

//accommodaton low season price NB: [number] should be same as the accommodation [number] it relates to
var accomPricelow = new Array (accomList.length)// low season prices
accomPricelow[0] = 0 //per person price :: Keep array index same as accommodation array index it refers to
accomPricelow[1] = 85 // Waterfront Low
accomPricelow[2] = 85 // Meridian Low
accomPricelow[3] = 329 // Cooktown Low 2 days one night
accomPricelow[4] = 475 // Undara 2 days 1 night
accomPricelow[5] = 125 // Cape Tribulation Resort Spa
accomPricelow[6] = 435 // Reef Encounter 2 days one night
accomPricelow[7] = 515 // Reef Encounter 3 days 2 nights
accomPricelow[8] = 300 // Rum Runner 2 days one night
accomPricelow[9] = 1200// Taka 4 days 3 nights

//accommodation high season price  NB: [number] should be same as the accommodation [number] it relates to
var accomPriceHigh = new Array (accomList.length)// high season prices
accomPriceHigh[0] = 0// per person price :: Keep array index same as accommodation array index it refers to
accomPriceHigh[1] = 100 // Waterfront High
accomPriceHigh[2] = 100 // Meridian High
accomPriceHigh[3] = 329 // Cooktown Low 2 days one night
accomPriceHigh[4] = 475 // Undara 2 days 1 night
accomPriceHigh[5] = 155 // Cape Tribulation Resort Spa'
accomPriceHigh[6] = 435 // Reef Encounter 2 days one night
accomPriceHigh[7] = 515 // Reef Encounter 3 days 2 nights
accomPriceHigh[8] = 300 // Rum Runner 2 day one night
accomPriceHigh[9] = 1200// Taka 4 days 3 nights

//list of accommodation locations NB: [number] should be same as the accommodation [number] it relates to
var locationList = new Array ()
locationList[0] = 'none'
locationList[1] = 'Cairns'
locationList[2] = 'Port Douglas'
locationList[3] = 'Cook Town'
locationList[4] = 'Tablelands'//Undara
locationList[5] = 'Cape Tribulation' // Cape Tribulation Resort Spa
locationList[6] = 'Reef Trip'// Reef Encounter 2 day one night
locationList[7] = 'Reef Trip'// Reef Encounter 3 day 2 nights
locationList[8] = 'Reef Trip'// Rum Runner 2 day one night
locationList[9] = 'Reef Trip'// Taka 4 days 3 nights

//list of tours
var tourList = new Array()
tourList[0] = 'none'
tourList[1] = 'Kuranda:Skyrail & Train'
tourList[2] = 'Full Day reef trip'
tourList[3] = 'Quicksilver'
tourList[4] = 'Reef Experience (day trip)'
tourList[5] = 'Cape Tribulation Daintree Rainforest'
tourList[6] = 'White Water Rafting - Tully River'
tourList[7] = 'Ballooning (30 mins)'


//list of tour prices NB: [number] should be same as the tour [number] it relates to
var tourListPrice = new Array(tourList.length)
tourListPrice[0] = 0// per person price :: Keep array index same as tour array index it refers to
tourListPrice[1] = 102// Kuranda Trek North
tourListPrice[2] = 175// Reef Magic
tourListPrice[3] = 180// Quicksilver
tourListPrice[4] = 145// Reef Experience (day trip)
tourListPrice[5] = 155// 'Cape Tribulation/Daintree Rainforest'
tourListPrice[6] = 155// White Water Rafting -Tully
tourListPrice[7] = 165// Ballooning (30 mins)



//!!!!!!!!!!    DON NOT TOUCH BELOW HERE    !!!!!!!!!!


function update(accomChoice,rowNumber,days){
	
//updating location
var loc='loc';
loc=loc.concat(rowNumber)
var thisAccom = accomChoice.accom[rowNumber].selectedIndex
var locf = document.getElementById(loc);
locf.value = locationList[accomChoice.accom[rowNumber].selectedIndex];


//updating total low
var low='low';
low=low.concat(rowNumber);
lowf=document.getElementById(low);
lowf.value=accomPricelow[accomChoice.accom[rowNumber].selectedIndex]+tourListPrice[tourf.selectedIndex];
//updating high price depending only on accomodation

var high='high';

high=high.concat(rowNumber);
highf=document.getElementById(high);
highf.value=accomPriceHigh[accomChoice.accom[rowNumber].selectedIndex]+tourListPrice[tourf.selectedIndex];

var total=document.getElementById('totall');
total.value=0
 for(i=0;i<days;i++)
  {totalf=parseInt(total.value)
	var low='low';
   low=low.concat(i);
   lowf=document.getElementById(low);
   lowff=parseInt(lowf.value)
   total.value=totalf+lowff;
  }
//updating total high
var total=document.getElementById('totalh');
total.value=0
 for(i=0;i<days;i++)
  {totalf=parseInt(total.value)
	var high='high';
   high=high.concat(i);
   highf=document.getElementById(high);
   highff=parseInt(highf.value)
   total.value=totalf+highff;
  }

}

function update2(accomChoice,rowNumber,days){

//updating location    !!!!  ADED BY ME LATER
var loc='loc';
loc=loc.concat(rowNumber)
var thisAccom = accomChoice.accom[rowNumber].selectedIndex
var locf = document.getElementById(loc);
locf.value = locationList[accomChoice.accom[rowNumber].selectedIndex];

//Updating tour price
var tour='tour';
tour=tour.concat(rowNumber);
tourf=document.getElementById(tour);
//updating low price depending on chosen accomodation and tour 
var low='low';
low=low.concat(rowNumber);
lowf=document.getElementById(low);
lowf.value=accomPricelow[accomChoice.accom[rowNumber].selectedIndex]+tourListPrice[tourf.selectedIndex];
//updating high price depending on chosen accomodation and tour
var high='high';
high=high.concat(rowNumber);
highf=document.getElementById(high);
highf.value=accomPriceHigh[accomChoice.accom[rowNumber].selectedIndex]+tourListPrice[tourf.selectedIndex];
//updating total low
var total=document.getElementById('totall');
total.value=0
 for(i=0;i<days;i++)
  {totalf=parseInt(total.value)
	var low='low';
   low=low.concat(i);
   lowf=document.getElementById(low);
   lowff=parseInt(lowf.value)
   total.value=totalf+lowff;
  }
//updating total high
var total=document.getElementById('totalh');
total.value=0
 for(i=0;i<days;i++)
  {totalf=parseInt(total.value)
	var high='high';
   high=high.concat(i);
   highf=document.getElementById(high);
   highff=parseInt(highf.value)
   total.value=totalf+highff;
  }

}