<!--

var formfilename;
var formdir;

var tariffe = new Array(5);

for (i = 0; i < tariffe.length; i++)
  tariffe[i] = new Array(21);

for (i = 0; i < tariffe.length; i++) {
 for (j = 0; j < tariffe[i].length; j++) {
  tariffe[i][j] = new Array(7);
 }
}

 function init()
{
  formfilename='res_';
  formdir = 'https://secure.airports-shuttle.com/reservations/';
  document.formr.book_btn.disabled = true;

	if (screen.width <= 1030)
	  selw = 186;
	else
	  selw = 223;

  document.formr.form_arrival_location.style.width=selw+'px';
  document.formr.form_arrival_destination.style.width=selw+'px';

  document.formr.form_arrival_location.options.length = 0;
  document.formr.form_arrival_destination.options.length = 0;
  document.formr.form_arrival_location.options[0] = new Option('select','select');
  document.formr.form_arrival_destination.options[0] = new Option('select','select');

  document.formr.form_total_passengers.options.length = 0;
  document.formr.form_total_passengers.options[0] = new Option('select','select');
  document.formr.form_total_passengers.options[1] = new Option('1','1');
  document.formr.form_total_passengers.options[2] = new Option('2','2');
  document.formr.form_total_passengers.options[3] = new Option('3','3');
  document.formr.form_total_passengers.options[4] = new Option('4','4');
  document.formr.form_total_passengers.options[5] = new Option('5','5');
  document.formr.form_total_passengers.options[6] = new Option('6','6');
  document.formr.form_total_passengers.options[7] = new Option('7','7');
  document.formr.form_total_passengers.options[8] = new Option('8','8');
  document.formr.form_total_passengers.options[9] = new Option('9','9');
  document.formr.form_total_passengers.options[10] = new Option('10','10');
  document.formr.form_total_passengers.options[11] = new Option('11','11');
  document.formr.form_total_passengers.options[12] = new Option('12','12');
  document.formr.form_total_passengers.options[13] = new Option('13','13');
  document.formr.form_total_passengers.options[14] = new Option('14','14');

tariffe[1][0][0] = 'Treviso Airport';
tariffe[1][1][0] = 'Abano Terme';
tariffe[1][1][1] = '70';
tariffe[1][1][2] = 'apt';
tariffe[1][1][3] = 'TV';
tariffe[1][1][4] = '0,10,10,10,23,23,23,43,43,69,69,69,69,69,69';
tariffe[1][1][5] = '0,115,115,115,135,135,135,150,150,310,310,310,310,310,310';
tariffe[1][1][6] = '0,220,220,220,260,260,260,290,290,610,610,610,610,610,610';
tariffe[1][2][0] = 'Camping Marina di Venezia';
tariffe[1][2][1] = '100';
tariffe[1][2][2] = 'apt';
tariffe[1][2][3] = 'TV';
tariffe[1][2][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][2][5] = '0,95,95,95,105,105,110,110,110,200,200,200,200,200,200';
tariffe[1][2][6] = '0,180,180,180,200,200,210,210,210,390,390,390,390,390,390';
tariffe[1][3][0] = 'Camping Union Lido';
tariffe[1][3][1] = '95';
tariffe[1][3][2] = 'apt';
tariffe[1][3][3] = 'TV';
tariffe[1][3][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][3][5] = '0,95,95,95,105,105,110,110,110,200,200,200,200,200,200';
tariffe[1][3][6] = '0,180,180,180,200,200,210,210,210,390,390,390,390,390,390';
tariffe[1][4][0] = 'Canazei';
tariffe[1][4][1] = '140';
tariffe[1][4][2] = 'apt';
tariffe[1][4][3] = 'TV';
tariffe[1][4][4] = '0,10,10,10,23,23,23,43,43,69,69,69,69,69,69';
tariffe[1][4][5] = '0,305,305,305,340,340,340,370,370,430,430,430,430,430,430';
tariffe[1][4][6] = '0,610,610,610,680,680,680,740,740,860,860,860,860,860,860';
tariffe[1][5][0] = 'Caorle';
tariffe[1][5][1] = '95';
tariffe[1][5][2] = 'apt';
tariffe[1][5][3] = 'TV';
tariffe[1][5][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][5][5] = '0,105,105,105,110,110,120,120,120,220,220,220,220,220,220';
tariffe[1][5][6] = '0,200,200,200,210,210,230,230,230,430,430,430,430,430,430';
tariffe[1][6][0] = 'Cavallino';
tariffe[1][6][1] = '90';
tariffe[1][6][2] = 'apt';
tariffe[1][6][3] = 'TV';
tariffe[1][6][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][6][5] = '0,95,95,95,105,105,110,110,110,200,200,200,200,200,200';
tariffe[1][6][6] = '0,180,180,180,200,200,210,210,210,390,390,390,390,390,390';
tariffe[1][7][0] = 'Eraclea Mare';
tariffe[1][7][1] = '65';
tariffe[1][7][2] = 'apt';
tariffe[1][7][3] = 'TV';
tariffe[1][7][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][7][5] = '0,75,75,75,85,85,95,95,95,160,160,160,160,160,160';
tariffe[1][7][6] = '0,140,140,140,160,160,180,180,180,310,310,310,310,310,310';
tariffe[1][8][0] = 'Galzignano Terme';
tariffe[1][8][1] = '70';
tariffe[1][8][2] = 'apt';
tariffe[1][8][3] = 'TV';
tariffe[1][8][4] = '0,10,10,10,23,23,43,43,43,69,69,69,69,69,69';
tariffe[1][8][5] = '0,140,140,140,155,155,165,165,165,190,190,190,190,190,190';
tariffe[1][8][6] = '0,265,265,265,295,295,315,315,315,360,360,360,360,360,360';
tariffe[1][9][0] = 'Grado';
tariffe[1][9][1] = '90';
tariffe[1][9][2] = 'apt';
tariffe[1][9][3] = 'TV';
tariffe[1][9][4] = '0,10,10,10,23,23,43,43,43,69,69,69,69,69,69';
tariffe[1][9][5] = '0,165,165,165,180,180,205,205,0,0,0,0,0,0,0';
tariffe[1][9][6] = '0,330,330,330,360,360,410,410,0,0,0,0,0,0,0';
tariffe[1][10][0] = 'Jesolo';
tariffe[1][10][1] = '60';
tariffe[1][10][2] = 'apt';
tariffe[1][10][3] = 'TV';
tariffe[1][10][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][10][5] = '0,85,85,85,90,90,100,100,100,175,175,175,175,175,175';
tariffe[1][10][6] = '0,160,160,160,170,170,190,190,190,340,340,340,340,340,340';
tariffe[1][11][0] = 'Lido di Jesolo';
tariffe[1][11][1] = '60';
tariffe[1][11][2] = 'apt';
tariffe[1][11][3] = 'TV';
tariffe[1][11][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][11][5] = '0,85,85,85,90,90,100,100,100,175,175,175,175,175,175';
tariffe[1][11][6] = '0,160,160,160,170,170,190,190,190,340,340,340,340,340,340';
tariffe[1][12][0] = 'Mestre';
tariffe[1][12][1] = '60';
tariffe[1][12][2] = 'apt';
tariffe[1][12][3] = 'TV';
tariffe[1][12][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][12][5] = '0,65,65,65,80,80,85,85,85,150,150,150,150,150,150';
tariffe[1][12][6] = '0,120,120,120,150,150,160,160,160,290,290,290,290,290,290';
tariffe[1][13][0] = 'Mogliano Veneto';
tariffe[1][13][1] = '35';
tariffe[1][13][2] = 'apt';
tariffe[1][13][3] = 'TV';
tariffe[1][13][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][13][5] = '0,55,55,55,60,60,70,70,70,120,120,120,120,120,120';
tariffe[1][13][6] = '0,100,100,100,110,110,130,130,130,230,230,230,230,230,230';
tariffe[1][14][0] = 'Punta Sabbioni';
tariffe[1][14][1] = '100';
tariffe[1][14][2] = 'apt';
tariffe[1][14][3] = 'TV';
tariffe[1][14][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][14][5] = '0,95,95,95,105,105,110,110,110,200,200,200,200,200,200';
tariffe[1][14][6] = '0,180,180,180,200,200,210,210,210,390,390,390,390,390,390';
tariffe[1][15][0] = 'Treviso';
tariffe[1][15][1] = '55';
tariffe[1][15][2] = 'apt';
tariffe[1][15][3] = 'TV';
tariffe[1][15][4] = '0,10,10,10,23,23,43,43,43,10,10,10,10,10,10';
tariffe[1][15][5] = '0,25,25,25,40,40,40,45,45,5,5,5,5,5,5';
tariffe[1][15][6] = '0,45,45,45,70,70,70,70,70,5,5,5,5,5,5';
tariffe[1][16][0] = 'Venice - P.le Roma';
tariffe[1][16][1] = '60';
tariffe[1][16][2] = 'apt';
tariffe[1][16][3] = 'TV';
tariffe[1][16][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][16][5] = '0,65,65,65,80,80,85,85,85,150,150,150,150,150,150';
tariffe[1][16][6] = '0,120,120,120,150,150,160,160,160,290,290,290,290,290,290';
tariffe[1][17][0] = 'Venice city hotels (car + water taxi)';
tariffe[1][17][1] = '70';
tariffe[1][17][2] = 'apt';
tariffe[1][17][3] = 'TV';
tariffe[1][17][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][17][5] = '0,130,130,130,145,145,155,155,155,300,285,285,285,285,285';
tariffe[1][17][6] = '0,250,250,250,280,280,300,300,300,590,560,560,560,560,560';
tariffe[1][18][0] = 'Venice Cruise Terminal';
tariffe[1][18][1] = '60';
tariffe[1][18][2] = 'apt';
tariffe[1][18][3] = 'TV';
tariffe[1][18][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[1][18][5] = '0,65,65,65,80,80,85,85,85,150,150,150,150,150,150';
tariffe[1][18][6] = '0,120,120,120,150,150,160,160,160,290,290,290,290,290,290';
tariffe[1][19][0] = 'Venice Marco Polo Airport';
tariffe[1][19][1] = '60';
tariffe[1][19][2] = 'apt';
tariffe[1][19][3] = 'VE';
tariffe[1][19][4] = '0,10,10,10,23,23,43,43,43,69,69,69,69,69,69';
tariffe[1][19][5] = '0,70,70,70,75,75,85,85,85,150,150,150,155,155,155';
tariffe[1][19][6] = '0,130,130,130,140,140,160,160,160,290,290,290,300,300,300';
tariffe[2][0][0] = 'Venice city hotels';
tariffe[2][1][0] = 'Treviso Airport (water taxi + car)';
tariffe[2][1][1] = '70';
tariffe[2][1][2] = 'cty';
tariffe[2][1][3] = 'TV';
tariffe[2][1][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[2][1][5] = '0,130,130,130,145,145,155,155,155,300,285,285,285,285,285';
tariffe[2][1][6] = '0,250,250,250,280,280,300,300,300,590,560,560,560,560,560';
tariffe[3][0][0] = 'Venice Cruise Terminal';
tariffe[3][1][0] = 'Treviso Airport';
tariffe[3][1][1] = '60';
tariffe[3][1][2] = 'cty';
tariffe[3][1][3] = 'TV';
tariffe[3][1][4] = '0,10,10,10,23,23,43,43,43,70,70,70,70,70,70';
tariffe[3][1][5] = '0,65,65,65,80,80,85,85,85,150,150,150,150,150,150';
tariffe[3][1][6] = '0,120,120,120,150,150,160,160,160,290,290,290,290,290,290';
tariffe[3][2][0] = 'Venice city hotels';
tariffe[3][2][1] = '40';
tariffe[3][2][2] = 'fre';
tariffe[3][2][3] = 'VE';
tariffe[3][2][4] = '0,32,32,32,32,32,32,32,32,32,32,32,32,32,32';
tariffe[3][2][5] = '0,95,95,95,105,105,115,171,171,210,210,210,216,250,260';
tariffe[3][2][6] = '0,186,186,186,200,200,225,335,335,410,410,410,422,490,510';
tariffe[4][0][0] = 'Venice Marco Polo Airport';
tariffe[4][1][0] = 'Treviso Airport';
tariffe[4][1][1] = '60';
tariffe[4][1][2] = 'apt';
tariffe[4][1][3] = 'VE';
tariffe[4][1][4] = '0,10,10,10,23,23,43,43,43,69,69,69,69,69,69';
tariffe[4][1][5] = '0,70,70,70,75,75,85,85,85,150,150,150,155,155,155';
tariffe[4][1][6] = '0,130,130,130,140,140,160,160,160,290,290,290,300,300,300';

 for(i=1;i<tariffe.length;i++)
 document.formr.form_arrival_location.options[i] = new Option(tariffe[i][0][0],tariffe[i][0][0]);

 setfare();

}

var triptime;

function setjourney()
{
 if( document.formr.form_arrival_location.selectedIndex ==  0 || document.formr.form_arrival_destination.selectedIndex ==  0 )
  triptime = '';
 else
  triptime = 'Approx. trip time:  ' + tariffe[document.formr.form_arrival_location.selectedIndex][document.formr.form_arrival_destination.selectedIndex][1] + ' min.'; 
}

function setd()
{
	
if( document.formr.form_arrival_location.selectedIndex ==  0 )
 {
  document.formr.book_btn.disabled = true;
  document.formr.form_arrival_destination.selectedIndex = 0;
  return;
 }
document.formr.form_arrival_destination.options.length = 0;
 document.formr.form_arrival_destination.options[0] = new Option('select','select');

for (i = 1; i <= tariffe[document.formr.form_arrival_location.selectedIndex].length; i++)
{
 if( typeof tariffe[document.formr.form_arrival_location.selectedIndex][i] !== 'undefined' && typeof tariffe[document.formr.form_arrival_location.selectedIndex][i][0] != 'undefined'  )
 document.formr.form_arrival_destination.options[i] = new Option(tariffe[document.formr.form_arrival_location.selectedIndex][i][0],tariffe[document.formr.form_arrival_location.selectedIndex][i][0]);
}
  setfare();

}

function setfare()
{

 setjourney();

 var LABELPRICE = document.getElementById('LABELPRICE');
 var LABELONPRICE = document.getElementById('LABELONPRICE');
 var LABELDES = document.getElementById('LABELDES');
 var LABELBAG = document.getElementById('LABELBAG');

 if( document.formr.onewayreturn[0].checked )
 {
   document.formr.form_return_time_h.disabled = true;
   document.formr.form_return_time_m.disabled = true;
 }
 else
 {
   document.formr.form_return_time_h.disabled = false;
   document.formr.form_return_time_m.disabled = false;
 }

 if( document.formr.form_arrival_location.selectedIndex ==  0 || document.formr.form_arrival_destination.selectedIndex ==  0 )
 {
  LABELPRICE.innerHTML = ' --- select trip ---';
  LABELONPRICE.innerHTML = '&nbsp;';
  LABELDES.innerHTML = ' '; 
  LABELBAG.innerHTML = ''; 
  document.formr.book_btn.disabled = true;
  return;
 }
 if( document.formr.form_total_passengers.selectedIndex == 0 )
 {
 LABELPRICE.innerHTML = ' --- select passengers number ---';
 LABELONPRICE.innerHTML = '&nbsp;';
 LABELDES.innerHTML = ' '; 
 LABELBAG.innerHTML = '';
 document.formr.book_btn.disabled = true;
 return;
 }
 if( document.formr.bag_1.value == 0 && document.formr.bag_2.value == 0 && document.formr.bag_3.value == 0 )
 {
  LABELPRICE.innerHTML = ' --- select luggage ---';
  LABELONPRICE.innerHTML = '&nbsp;';
  LABELDES.innerHTML = ' ';
  LABELBAG.innerHTML = '';
  document.formr.book_btn.disabled = true;
  return;
 }
 if( document.formr.form_arrival_time_h.selectedIndex == 0 )
 {
  LABELPRICE.innerHTML = ' --- select pickup time ---';
  LABELONPRICE.innerHTML = '&nbsp;';
  LABELDES.innerHTML = ' '; 
  LABELBAG.innerHTML = '';
  document.formr.book_btn.disabled = true;
  return;
 }

if( document.formr.onewayreturn[1].checked && document.formr.form_return_time_h.selectedIndex == 0 )
 {
  LABELPRICE.innerHTML = ' --- select return pickup time ---';
  LABELONPRICE.innerHTML = '&nbsp;';
  LABELDES.innerHTML = ' ';  
  LABELBAG.innerHTML = '';
  document.formr.book_btn.disabled = true;
  return;
 }
 

 var faresreturndisc = new Array(16);
 var addnight = '';
 var percadd = 0;
 var arrval = 0;

 var faretypeofv = tariffe[document.formr.form_arrival_location.selectedIndex][document.formr.form_arrival_destination.selectedIndex][4].split(',');

 var actionform = formdir+formfilename+tariffe[document.formr.form_arrival_location.selectedIndex][document.formr.form_arrival_destination.selectedIndex][2]+'_eng';
 var city = tariffe[document.formr.form_arrival_location.selectedIndex][document.formr.form_arrival_destination.selectedIndex][3];

 if( document.formr.onewayreturn[0].checked )
 {
  var fares = tariffe[document.formr.form_arrival_location.selectedIndex][document.formr.form_arrival_destination.selectedIndex][5].split(',');
  actionform = actionform + '.php';
 if( document.formr.form_arrival_time_h.value >= 22 || document.formr.form_arrival_time_h.value >= 0 && document.formr.form_arrival_time_h.value < 7 )
percadd = 20;
 }
 else
 {
  var fares = tariffe[document.formr.form_arrival_location.selectedIndex][document.formr.form_arrival_destination.selectedIndex][6].split(',');
actionform = actionform + '.php';
 if( document.formr.form_arrival_time_h.value >= 22 || document.formr.form_arrival_time_h.value >= 0 && document.formr.form_arrival_time_h.value < 7 )
percadd = 10;
 if( document.formr.form_return_time_h.value >= 22 || document.formr.form_return_time_h.value >= 0 && document.formr.form_return_time_h.value < 7 )
percadd = percadd + 10;
  var fares_o = tariffe[document.formr.form_arrival_location.selectedIndex][document.formr.form_arrival_destination.selectedIndex][5].split(',');
   for (var i=1; i < fares.length; i++)
   {
	 if( parseInt(fares[i]) < parseInt(fares_o[i]) * 2  )
	 faresreturndisc[i] = 1;
	 else
 	 faresreturndisc[i] = 0;
   }
 }

 document.formr.action=actionform;
 document.formr.code.value = city;
 document.formr.book_btn.disabled = false;

 arrval = fares.length;

 if( percadd > 0 )
 {
  for (var i=1; i < arrval; i++)
  {
   add = parseInt(fares[i] * percadd / 100);
   add+=parseInt(fares[i]);
   fares[i] = add;
  }

  if( percadd >= 20 )
   addnight = '  (night fare)';
  else
   addnight = '  (one way night fare)';
 }

 fillfares( arrval, fares, addnight, faresreturndisc, faretypeofv );
}

function fillfares( numarray, fares, addnight, faresreturndisc, faretypeofv )
{
 var farestrfull = '';
 var strpas = '';
 var strfare = '';
 var typetransfer;
 var totalbag;
 var trovato=0;

 var LABELPRICE = document.getElementById('LABELPRICE');
 var LABELONPRICE = document.getElementById('LABELONPRICE');
 var LABELDES = document.getElementById('LABELDES');
 var LABELBAG = document.getElementById('LABELBAG');

   i = document.formr.form_total_passengers.selectedIndex;

   if( fares[i] <= 0 )
   {
	LABELPRICE.innerHTML = 'not available';
	LABELONPRICE.innerHTML = '&nbsp;';
	LABELDES.innerHTML = '';
	LABELBAG.innerHTML = 'This fare is not available. Please contact us.';
	document.formr.book_btn.disabled = true;
	return;
   }

   totalbag = document.formr.form_total_passengers.selectedIndex * 0.5
   totalbag = totalbag + (document.formr.bag_1.value * 1.5) + (document.formr.bag_2.value * 2.3) + (document.formr.bag_3.value * 3);

   if( totalbag > faretypeofv[i] )
   {
        for (var f=i+1; f < numarray; f++)
	      {

          if( totalbag <= faretypeofv[f] )
     	  {
		  	  trovato = 1;
			  break;
		    }
	      }

	    if( trovato == 1 )
	    {
		   strpas = i+'';
            if( i == 1 ) {
             strpas =  strpas + ' passenger ';
            }
            else {
             strpas =  strpas + ' passengers ';
            }

            if( document.formr.onewayreturn[0].checked )
             typetransfer = ' - one way ';	
            else if( document.formr.onewayreturn[1].checked )
            {
          	if( faresreturndisc[i] == 1 )
             typetransfer = ' - discounted round trip ';
            else
             typetransfer = ' - round trip ';
            }
            farestrfull= '   ' + strpas+fares[f]+' Euros'+typetransfer+addnight;
            faredes = '   ' + triptime+decodeve( faretypeofv[f] );
			if( fares[f] <= 0 )
			{
            LABELPRICE.innerHTML = 'not available';
		    LABELONPRICE.innerHTML = '&nbsp;';
            LABELDES.innerHTML = '';
			LABELBAG.innerHTML = 'This fare is not available. Please contact us.';
			document.formr.book_btn.disabled = true;
			return;
			}
            LABELPRICE.innerHTML = farestrfull;
            LABELONPRICE.innerHTML = fares[f]+',00 Euros'; 
            LABELDES.innerHTML = faredes;
			LABELBAG.innerHTML = '   Shifted to the upper vehicle category due to luggage amount';
 	    }

   return;
   }

   strpas = i+'';
   if( i == 1 ) {
    strpas =  strpas + ' passenger ';
   }
   else {
    strpas =  strpas + ' passengers ';
   }

   if( document.formr.onewayreturn[0].checked )
    typetransfer = ' - one way ';	
   else if( document.formr.onewayreturn[1].checked )   
   {
 	if( faresreturndisc[i] == 1 )
      typetransfer = ' - discounted round trip ';
     else
      typetransfer = ' - round trip ';
   }
   farestrfull= '   ' + strpas+fares[i]+' Euros'+typetransfer+addnight;
   faredes = '   ' + triptime+decodeve( faretypeofv[i] );

   LABELPRICE.innerHTML = farestrfull;
   LABELONPRICE.innerHTML = fares[i]+',00 Euros';
   LABELDES.innerHTML = faredes;
   LABELBAG.innerHTML = '';
}
function decodeve(argvalue) 
{
var retval;
if( argvalue == 10 )
 retval =  '  Service: Limousine E class transfer';
else if( argvalue == 23 )
 retval =  '  Service: luxury van transfer';
else if( argvalue == 43 )
 retval =  '  Service: luxury minibus transfer';
else if( argvalue == 69 )
 retval =  '  Service: luxury bus transfer';
else if( argvalue == 32 )
 retval =  '  Service: shuttle + water taxi transfer';
else if( argvalue == 32 )
 retval =  '  Service: shuttle mb + water taxi transfer';
else if( argvalue == 70 )
 retval =  '  Service: 2 x luxury minibus transfer';
else 
retval =  '  Service NOT available on line. Please email us for a quote.';
return  retval;
}

-->