// JavaScript Document<script type="text/javascript">

function hidestatus(){
window.status='Alderney Duty Free'
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus

function getkey(e)
{
 
  if (event.keyCode == 13 ) { event.keyCode = 9 ; }
  else if (event.keyCode == 92 ) { event.keyCode = 47 ; }
  else if (event.keyCode == 34 || event.keyCode == 39 || event.keyCode == 60 || event.keyCode == 62 ) 
    { event.keyCode = null ; }  
   
}

function verifyDest(form)
    {
    var xdesc = document.checkout.flight.value.toUpperCase() ;
    var myRegExp = / /g ;
    xdesc = xdesc.replace(myRegExp,"") ;
    ax = xdesc.substr(0,3) ;
    if (ax == "BCI" || ax == "BC1" ) { xdesc = "SI" + xdesc.substr(3) ; }
    
    ax = xdesc.substr(0,2) ;
    if (ax == "BC" || ax == "AX" ) { xdesc = "SI" + xdesc.substr(2) ; }
    document.checkout.flight.value = xdesc ;
    var xnum = xdesc.substr(2,5) ;
    xdesc = xdesc.substr(0,3) ;
    var hour = "" ;
    var minute = "" ;
    if (xdesc == "SI1" )
    { 
    if ( xnum == "101" ) { hour = "09" ; minute = "00" ; }
    if ( xnum == "103" ) { hour = "11" ; minute = "15" ; }
    if ( xnum == "107" ) { hour = "15" ; minute = "00" ; }
    if (hour > "0") 
    { document.checkout.hour.value=hour ;
      document.checkout.minute.value=minute ; }
    document.checkout.destination.value="Bournemouth" ;
    document.checkout.location.value="A" ;
    document.checkout.passengers.focus() ;
    document.checkout.passengers.select() ;
    
     }
     if ( xdesc == "GR2"  || xdesc == "SI4" )
    {
    if ( xnum == "203" ) { hour = "07" ; minute = "45" ; }
    if ( xnum == "205" ) { hour = "08" ; minute = "00" ; }
    if ( xnum == "401" ) { hour = "08" ; minute = "00" ; }
    if ( xnum == "219" ) { hour = "09" ; minute = "50" ; }
    if ( xnum == "203" ) { hour = "07" ; minute = "45" ; }
    if ( xnum == "227" ) { hour = "10" ; minute = "50" ; }
    if ( xnum == "411" ) { hour = "13" ; minute = "00" ; }
    if ( xnum == "255" ) { hour = "14" ; minute = "15" ; }
    if ( xnum == "257" ) { hour = "14" ; minute = "30" ; }
    if ( xnum == "259" ) { hour = "14" ; minute = "45" ; }
    if ( xnum == "263" ) { hour = "14" ; minute = "30" ; }
    if ( xnum == "269" ) { hour = "16" ; minute = "00" ; }
    if ( xnum == "277" ) { hour = "16" ; minute = "55" ; }
    if ( xnum == "279" ) { hour = "17" ; minute = "15" ; }
    if ( xnum == "433" ) { hour = "17" ; minute = "25" ; }
    if ( xnum == "283" ) { hour = "17" ; minute = "45" ; }
    if ( xnum == "285" ) { hour = "18" ; minute = "00" ; }
    if ( xnum == "287" ) { hour = "18" ; minute = "15" ; }
    if ( xnum == "295" ) { hour = "19" ; minute = "20" ; }
    
    
    
    
    if (hour > "0") 
    { document.checkout.hour.value=hour ;
      document.checkout.minute.value=minute ; } 
    var xdesc = document.checkout.flight.value.toUpperCase();
    var xdesc1 = prompt("orders via Guernsey - You must be intransit and depart Guernsey on same day\n\rPlease enter 2nd flight number","" ) ;
    xdesc += ("/"+ xdesc1) ;
    document.checkout.flight.value = xdesc.toUpperCase() ;
    document.checkout.destination.value="via Guernsey" ;
    document.checkout.location.value="A" ;
    document.checkout.passengers.value=document.checkout.passengers.value ;
    document.checkout.passengers.select() ;
    document.checkout.passengers.focus() ;
     }
      if (xdesc == "GR3"  || xdesc == "SI2" )
    { 
    if ( xnum == "203" ) { hour = "13" ; minute = "45" ; }
    if ( xnum == "205" ) { hour = "16" ; minute = "10" ; }
    if (hour > "0") 
    { document.checkout.hour.value=hour ;
      document.checkout.minute.value=minute ; }
    document.checkout.destination.value="Jersey" ;
    document.checkout.location.value="A" ;
    document.checkout.passengers.select() ;
    document.checkout.passengers.focus() ;
     }
    
     if (xdesc == "GR5" || xdesc == "GR4" )
    {
    if ( xnum == "497" ) { hour = "07" ; minute = "45" ; }
    if ( xnum == "499" ) { hour = "08" ; minute = "00" ; }
    if ( xnum == "503" ) { hour = "08" ; minute = "30" ; }
    if ( xnum == "501" ) { hour = "08" ; minute = "15" ; }
    if ( xnum == "505" ) { hour = "08" ; minute = "45" ; }
    if ( xnum == "507" ) { hour = "09" ; minute = "00" ; }
    if ( xnum == "509" ) { hour = "09" ; minute = "15" ; }
    if ( xnum == "511" ) { hour = "09" ; minute = "30" ; }
    if ( xnum == "513" ) { hour = "09" ; minute = "45" ; }
    if ( xnum == "515" ) { hour = "10" ; minute = "00" ; }
    if ( xnum == "517" ) { hour = "10" ; minute = "15" ; }
    if ( xnum == "519" ) { hour = "10" ; minute = "30" ; }
    if ( xnum == "521" ) { hour = "10" ; minute = "45" ; }
    if ( xnum == "523" ) { hour = "11" ; minute = "00" ; }
    if ( xnum == "525" ) { hour = "11" ; minute = "15" ; }
    if ( xnum == "527" ) { hour = "11" ; minute = "45" ; }
    if ( xnum == "529" ) { hour = "12" ; minute = "00" ; }
    if ( xnum == "531" ) { hour = "12" ; minute = "05" ; }
    if ( xnum == "533" ) { hour = "12" ; minute = "15" ; }
    if ( xnum == "535" ) { hour = "12" ; minute = "30" ; }
    if ( xnum == "537" ) { hour = "12" ; minute = "45" ; }
    if ( xnum == "539" ) { hour = "13" ; minute = "00" ; }
    if ( xnum == "541" ) { hour = "13" ; minute = "15" ; }
    if ( xnum == "541" ) { hour = "13" ; minute = "30" ; }
    if ( xnum == "543" ) { hour = "13" ; minute = "30" ; }
    if ( xnum == "545" ) { hour = "13" ; minute = "45" ; }
    if ( xnum == "547" ) { hour = "14" ; minute = "00" ; }
    if ( xnum == "549" ) { hour = "14" ; minute = "15" ; }
    if ( xnum == "551" ) { hour = "14" ; minute = "35" ; }
    if ( xnum == "553" ) { hour = "14" ; minute = "45" ; }
    if ( xnum == "555" ) { hour = "15" ; minute = "00" ; }
    if ( xnum == "557" ) { hour = "15" ; minute = "15" ; }
    if ( xnum == "559" ) { hour = "15" ; minute = "30" ; }
    if ( xnum == "561" ) { hour = "15" ; minute = "45" ; }
    if ( xnum == "563" ) { hour = "16" ; minute = "00" ; }
    if ( xnum == "565" ) { hour = "16" ; minute = "15" ; }
    if ( xnum == "567" ) { hour = "16" ; minute = "30" ; }
    if ( xnum == "569" ) { hour = "16" ; minute = "45" ; }
    if ( xnum == "571" ) { hour = "17" ; minute = "00" ; }
    if ( xnum == "573" ) { hour = "17" ; minute = "15" ; }
    
    if (hour > "0") 
    { document.checkout.hour.value=hour ;
      document.checkout.minute.value=minute ; }
    document.checkout.destination.value="Southampton" ;
    document.checkout.location.value="A" ;
    document.checkout.passengers.select() ;
    document.checkout.passengers.focus() ;

     }
     if (xdesc == "SI6" )
    { 
    document.checkout.destination.value="Shoreham " ;
    document.checkout.location.value="A" ;
    document.checkout.passengers.select() ;
    document.checkout.passengers.focus() ;
     }
      
      if (xdesc == "777" )
    { 
    document.checkout.flight.value="777/Victor Hugo" ;
    document.checkout.location.value="H" ;
    document.checkout.destination.select() ;
         }
      if (xdesc == "776" )
    { 
    document.checkout.flight.value="776/HD Ferries" ;
    document.checkout.location.value="H" ;
    document.checkout.destination.select() ;
     }
      if (xdesc == "775" )
    { 
    document.checkout.flight.value="775/Alderney Felix" ;
    document.checkout.location.value="H" ;
    document.checkout.destination.select() ;
     }
      if (xdesc == "774" )
    { 
    document.checkout.flight.value="774 " ;
    document.checkout.location.value="H" ;
    document.checkout.destination.select() ;
     }
      if (xdesc == "773" )
    { 
    document.checkout.flight.value="773/Voyager" ;
    document.checkout.location.value="H" ;
    document.checkout.destination.select() ;
     }
      if (xdesc == "772" )
    { 
    document.checkout.flight.value="772/Lady Maris" ;
    document.checkout.location.value="H" ;
    document.checkout.destination.select() ;
     }
      if (xdesc == "771" )
    { 
    document.checkout.flight.value="771/Isis" ;
    document.checkout.location.value="H" ;
    document.checkout.destination.select() ;
     }
     xh = xdesc.substr(0,1) ;
     if (xh < "A" )
     {
     document.checkout.location.value="H" ;
    document.checkout.destination.select() ;
    document.checkout.destination.focus() ;
     }
     
     
}
function verifyDate(form)
    {
    var d1 = document.checkout.day.value ;
    var m1 = document.checkout.month.value ;
    var y1 = document.checkout.year.value ;
    userdate = new Date(y1,m1-1,d1) ;
    currdate = new Date() ;
    currdate.setDate(currdate.getDate()) ;
    currdate.setHours(0);
    currdate.setMinutes(0);
    currdate.setSeconds(0);
    if (currdate > userdate) {
    alert ("You cannot order online for departure before tomorrow!\n\r\n\rPlease order at the Airport or Harbour Shop" ) ;
    document.checkout.day.focus() ;
    }
}
function verifyIt(form)
    {
    
   
   var xdesc = document.checkout.flight.value.toLowerCase() ;
   if (xdesc == "" )
    { 
    alert ("You must enter a flight number, aircraft registration or boat name " ) ;
    document.checkout.flight.focus() ;
    document.checkout.flight.select() ;
    return false ;
     }

 var xdesc = document.checkout.destination.value.toLowerCase() ;
   if (xdesc == "" )
    { 
    alert ("You must enter a destination" ) ;
    document.checkout.destination.focus() ;
    document.checkout.destination.select() ;
    return false ;
     }
     
    document.forms[0].submit() ;
        
 return true ; 
}   
function verifyAddress(form)
    {
    var address = document.getaddress.address1.value ;
    var postcode = document.getaddress.postcode.value ;

    if (address.length < 5 )
    { address = prompt("You must enter 1st line of address") ;
     document.getaddress.address1.value = address ; }

    if (postcode < 6 )
    { postcode = prompt("You must enter your postcode") ;
     document.getaddress.postcode.value = postcode ; }

    document.forms[0].submit() ;

    return true ;

    }

function verifyDate(form)
    {
    var d1 = document.checkout.day.value ;
    var m1 = document.checkout.month.value ;
    var y1 = document.checkout.year.value ;
    userdate = new Date(y1,m1-1,d1) ;
    currdate = new Date() ;
    currdate.setDate(currdate.getDate()) ;
    currdate.setHours(0);
    currdate.setMinutes(0);
    currdate.setSeconds(0);
    if (currdate > userdate) {
    alert ("You cannot order online for a departure today!\n\r\n\rPlease order at the Airport" ) ;
    document.checkout.day.focus() ;
    }




}   
