function showOtherMethods(anID, callingElement) {
    el =  document.getElementById(anID);
    if (el != null) {
	if (el.style.display == "none") {
	    el.style.display = "block";
	} else {
	    el.style.display = "none";
	}
    }
}


function trCartype() {
	trArr();
	trDep();
}

  function getMonthNum(abbMonth)
  {
    var arrMon = new Array("Jan","Feb","Mar","Apr","May","Jun",
          "Jul","Aug","Sep","Oct","Nov","Dec");
    for(i=0; i<arrMon.length; i++)
    {
      if(abbMonth == arrMon[i])
        return i;
    }
  }

function setTrDeparture() {
	var tmp_dep = parseInt(document.booking.checkin.value) + parseInt(3600*24*document.booking.nights.value);
	
    var theDate = new Date(tmp_dep * 1000);
    dateString = theDate.toGMTString();
    arrDateStr = dateString.split(" ");
    document.forms["booking"].elements["d_Mon"].selectedIndex = getMonthNum(arrDateStr[2]);
    document.forms["booking"].elements["d_Day"].selectedIndex = arrDateStr[1];
}

function trArr() {
	var tmp_price;	

	var numofguestse = document.booking.a_numofguests;
        numofguests_2 = numofguestse.selectedIndex;
	numofguests = numofguests_2 + 1;
	
	var pickupplacee = document.booking.a_pickupplace;
	var myindex = pickupplacee.selectedIndex;
        pickupplace_i = pickupplacee.options[myindex].value;
	
	if ( (pickupplace_i==1) || (pickupplace_i==2) || (pickupplace_i==6) ) {
	    if ( (numofguests == 1) || (numofguests == 2) ||(numofguests == 3) ||(numofguests == 4) ) {	
		tmp_price = 22    
	    } else if ((numofguests == 5) || (numofguests == 6)) {	
		tmp_price = 35  
	    } else if ((numofguests == 7) || (numofguests == 8)) {	
		tmp_price = 40    
	    } 
	}

	if ( (pickupplace_i==3) || (pickupplace_i==4) || (pickupplace_i==5) ) {
	    if ( (numofguests == 1) || (numofguests == 2) ||(numofguests == 3) ||(numofguests == 4) ) {	
		tmp_price = 16    
	    } else if ((numofguests == 5) || (numofguests == 6)) {	
		tmp_price = 22  
	    } else if ((numofguests == 7) || (numofguests == 8)) {	
		tmp_price = 27    
	    } 
	}
	
	
	document.forms["booking"].elements["a_cost"].value = tmp_price;
	
	updateTotalCost();
}

function trDep() {
	var tmp_price;	

	var numofguestse = document.booking.d_numofguests;
        numofguests_2 = numofguestse.selectedIndex;
	numofguests = numofguests_2 + 1;
	
	var destinatione = document.booking.d_destination;
	var myindex = destinatione.selectedIndex;
        destination_i = destinatione.options[myindex].value;
	
	if ( (destination_i==1) || (destination_i==2) || (destination_i==6) ) {
	    if ( (numofguests == 1) || (numofguests == 2) ||(numofguests == 3) ||(numofguests == 4) ) {	
		tmp_price = 20    
	    } else if ((numofguests == 5) || (numofguests == 6)) {	
		tmp_price = 33  
	    } else if ((numofguests == 7) || (numofguests == 8)) {	
		tmp_price = 38    
	    } 
	}

	if ( (destination_i==3) || (destination_i==4) || (destination_i==5) ) {
	    if ( (numofguests == 1) || (numofguests == 2) ||(numofguests == 3) ||(numofguests == 4) ) {	
		tmp_price = 14    
	    } else if ((numofguests == 5) || (numofguests == 6)) {	
		tmp_price = 20  
	    } else if ((numofguests == 7) || (numofguests == 8)) {	
		tmp_price = 25    
	    } 
	}
	document.forms["booking"].elements["d_cost"].value = tmp_price;
	
	updateTotalCost();
}

function updateTotalCost() {
	document.forms["booking"].elements["tr_totalcost"].value = parseInt(document.forms["booking"].elements["a_cost"].value) + parseInt(document.forms["booking"].elements["d_cost"].value);
}

