var arrivals=document.calc.Travel.options.length
var arrival=new Array(arrivals)
for (i=0; i<arrivals; i++)
arrival[i]=new Array()

arrival[0][0]=new Option("Select travel above"," ");

arrival[1][0]=new Option("---- Categories ----"," ");
arrival[1][1]=new Option("Arrival Day","");

arrival[2][0]=new Option("---- Categories ----"," ");
arrival[2][1]=new Option("Arrival Day","");

arrival[3][0]=new Option("---- Categories ----"," ");
arrival[3][1]=new Option("Arrival Day","");

var temp3=document.calc.select_1


function redirectb(x){
for (m=temp3.options.length-1;m>0;m--)
temp3.options[m]=null
for (i=0;i<arrival[x].length;i++){
temp3.options[i]=new Option(arrival[x][i].text,arrival[x][i].value)
}
temp3.options[0].selected=true
redirect1b(0)
}

var secondarrivals=document.calc.select_1.options.length
var secondarrival=new Array(arrivals)
for (i=0; i<arrivals; i++)  {
secondarrival[i]=new Array(arrival[i].length)
for (j=0; j<arrival[i].length; j++)  {
secondarrival[i][j]=new Array()  }}


secondarrival[0][0][0]=new Option("--Select left box first--"," ");
secondarrival[1][0][0]=new Option("--Select left box first--"," ");
secondarrival[1][1][0]=new Option("----- Select One -----"," ");
secondarrival[1][1][1]=new Option("City orientation tour","");
secondarrival[1][1][2]=new Option("City tour (full day)","");
secondarrival[1][1][3]=new Option("Hotel transfer only","");
secondarrival[1][1][4]=new Option("Local field study","");
secondarrival[1][1][5]=new Option("Transport to field study","");

secondarrival[2][0][0]=new Option("--Select left box first--"," ");
secondarrival[2][1][0]=new Option("----- Select One -----"," ");
secondarrival[2][1][1]=new Option("Hotel arrival only","");
secondarrival[2][1][2]=new Option("Local field study","");

secondarrival[3][0][0]=new Option("--Select left box first--"," ");
secondarrival[3][1][0]=new Option("----- Select One -----"," ");
secondarrival[3][1][1]=new Option("Hotel arrival only","");
secondarrival[3][1][2]=new Option("Local field study","");

var temp4=document.calc.select_2
function redirect1b(y){
for (m=temp4.options.length-1;m>0;m--)
temp4.options[m]=null
for (i=0;i<secondarrival[document.calc.Travel.options.selectedIndex][y].length;i++){
temp4.options[i]=new Option(secondarrival[document.calc.Travel.options.selectedIndex][y][i].text,secondarrival[document.calc.Travel.options.selectedIndex][y][i].value)
}
temp4.options[0].selected=true
}
function Updatedeparture(object) {
object.select_1.options.length = 0;
object.select_2.options.length = 0;
var defaultSelected = false;
var selected = false;
var optionName5 = new Option("Select travel above", "Barcelona", defaultSelected, selected);
var optionName6 = new Option("--Select left box first--", "Barcelona", defaultSelected, selected);
var length3 = object.select_1.length;
var length4 = object.select_2.length;
object.select_1.options[length3] = optionName5;
object.select_2.options[length4] = optionName6;
}

function g(){if(document.calc.Travel[0].selected||document.calc.select_1[0].selected||document.calc.select_2[0].selected){alert ('Please select an arrival day option');
return false;}
if (document.calc.Travel[1].selected && document.calc.Airport[2].selected && document.calc.select_2[1].selected){
window.open("http://geographyfieldwork.com/OrientationTarragona.htm");}
else if (document.calc.Travel[1].selected && document.calc.select_2[1].selected){
window.open("http://geographyfieldwork.com/Orientation.htm");}
if (document.calc.Travel[1].selected && document.calc.Airport[2].selected && document.calc.select_2[2].selected){
window.open("http://geographyfieldwork.com/ArrivalReus.htm");}
else if (document.calc.Travel[1].selected && document.calc.select_2[2].selected){
window.open("http://geographyfieldwork.com/Arrival.htm");}
if (document.calc.Travel[1].selected && document.calc.select_2[3].selected){
window.open("http://geographyfieldwork.com/ArrivalDayLocalFieldwork.htm");}
if ((document.calc.Travel[2].selected||document.calc.Travel[3].selected) && (document.calc.select_2[1].selected||document.calc.select_2[2].selected)){
window.open("http://geographyfieldwork.com/CoachArrival.htm");}
if (document.calc.Travel[1].selected && document.calc.select_2[4].selected){
window.open("http://geographyfieldwork.com/ArrivalDayFieldwork.htm");}
}