<!--
function defaultmonth() {
document.login.rmy.options[document.login.dmy.selectedIndex].selected = true}

function defaultyear() {
document.login.ry.options[document.login.dy.selectedIndex].selected = true}

function submitit() {
var errormessage = ''
document.forms[0].dm.value = document.forms[0].dmy.value.substring(0,3);
document.forms[0].dy.value = document.forms[0].dmy.value.substring(3,5);
document.forms[0].rm.value = document.forms[0].rmy.value.substring(0,3);
document.forms[0].ry.value = document.forms[0].rmy.value.substring(3,5);
var arrival = new Date();
var returning = new Date();
var today = new Date();
var months = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
var monthpos;

monthpos = months.indexOf(document.forms[0].dm.value);
monthpos = (( monthpos + 3 ) / 3 ) - 1;

if (isValidDate(document.forms[0].dd.value, monthpos, 2000 + parseInt(document.forms[0].dy.value,10)))
   {
   arrival.setDate(1);
   arrival.setMonth(monthpos);
   arrival.setYear(2000 + parseInt(document.forms[0].dy.value,10));
   
   arrival.setDate(document.forms[0].dd.value);
   if (arrival < today) 
      {
      errormessage = (errormessage + 'The entry date entered is before today\n' ); 
      }
   else
      {
      if (arrival > today)
         {
         }
      else
         {
         errormessage = (errormessage + 'You cannot book for same day\n'); 
         }
      }
   }
else
   {
   errormessage = (errormessage + 'You entered an invalid entry date\n' );
   } 



monthpos = months.indexOf(document.forms[0].rm.value);
monthpos = (( monthpos + 3 ) / 3 ) - 1;

if (isValidDate(document.forms[0].rd.value, monthpos, 2000 + parseInt(document.forms[0].ry.value,10)))
   {
   returning.setDate(1);
   returning.setMonth(monthpos);
   returning.setYear(2000 + parseInt(document.forms[0].ry.value,10));
   returning.setDate(document.forms[0].rd.value);
    
   if (returning < today) 
      {
      errormessage = (errormessage + 'The exit date date entered is before today\n' ); 
      }
   else
      {
      if (returning > today)
         {
         if (returning < arrival)
	    {
	    errormessage = (errormessage + 'The exit date entered is before the entry date\n'); 
	    
	    }
	 }
      else
         {
         errormessage = (errormessage + 'The exit date is today\n'); 
         }
      }
   }
else
   {
   errormessage = (errormessage + 'You entered an invalid exit date\n' );
   } 


if (document.forms[0].ap.selectedIndex==0) 
   {
   errormessage = (errormessage + 'You did not select a Terminal\n'); 
   }
if (document.forms[0].t.selectedIndex==0) 
   {
   errormessage = (errormessage + 'You did not select an entry time\n'); 
   }
if (document.forms[0].rt.selectedIndex==0) 
   {
   errormessage = (errormessage + 'You did not select an exit time'); 
   }

if (errormessage.length > 0 )
   {
   alert('Your request could not be processed\nfor the following reason(s)\n\n' + errormessage);
   return false;
   }

//document.forms[0].action = document.forms[0].action + '?p=po&pr=gpc&al=gpc&agent=best&src=X00002'
document.forms[0].submit();
}

function setdates(dateform) {
	

// var m_names = new Array("JAN", "FEB", "MAR", 
// "APR", "MAY", "JUN", "JUL", "AUG", "SEP", 
// "OCT", "NOV", "DEC");
// var startdate = new Date;
// var enddate = new Date;
// startdate.setTime(startdate.getTime() + 1 * 24 * 60 * 60 * 1000);
// enddate.setTime(enddate.getTime() + 2 * 24 * 60 * 60 * 1000);
// var d = startdate.getDate() ;
// var y = startdate.getYear();

// if( y.toString().length < 2 )
// 	y = "0" + y;
// else if( y.toString().length > 2 )
// 	y = y.toString().substring( y.toString().length - 2 );

// if (d < 10)
// 	d = "0" + d;

// dateform.dd.value = d;
// dateform.dmy.value = m_names[startdate.getMonth()] + y;

// var ed = enddate.getDate() ;
// var ey = enddate.getYear();

// if( ey.toString().length < 2 )
// 	ey = "0" + ey;
// else if( ey.toString().length > 2 )
// 	ey = ey.toString().substring( ey.toString().length - 2 );

// if (ed < 10)
// 	ed = "0" + ed;

// dateform.rd.value = ed;
// dateform.rmy.value = m_names[enddate.getMonth()] + ey;

generatemydropdown();	
}


var monthsArray = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
    var monthsNumberArray = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
    function generatemydropdown()
    {
      optionNum = 0;
      selText = '';
      selValue = '';
      startdate = new Date();
      enddate = new Date();
      enddate.setMonth(enddate.getMonth() + 10);
      workingdate = new Date(startdate.getFullYear(), startdate.getMonth() -1, 1);
      while (workingdate < enddate)
      {
        workingdate.setMonth(workingdate.getMonth() + 1);
        year = workingdate.getFullYear();
        if (year < 1900) year += 1900;
        selText = (monthsArray[workingdate.getMonth()] + ' ' + year);

	
        selValue = (monthsArray[workingdate.getMonth()].toUpperCase() + year.toString().substring(2,4));
	document.forms[0].dmy.options[optionNum] = new Option(selText, selValue);
        document.forms[0].rmy.options[optionNum] = new Option(selText, selValue);
        optionNum++;

      }
      
      mytoday = new Date();
      mytomorrow = new Date();
      mytoday.setDate(mytoday.getDate() + 1);
      mytomorrow.setDate(mytomorrow.getDate() + 2);
      
      
      
      mytodayyear = mytoday.getFullYear().toString().substring(2,4);
      
      mytomorrowyear = mytomorrow.getFullYear().toString().substring(2,4);
      
      

      setSelectedbyvalue(mytoday.getDate(),'field_from_day');
      setSelectedbyvalue(mytomorrow.getDate(), 'field_to_day');
      setSelectedbyvalue(monthsArray[mytoday.getMonth()].toUpperCase() + mytodayyear, 'dmy');
      setSelectedbyvalue(monthsArray[mytomorrow.getMonth()].toUpperCase() + mytomorrowyear, 'rmy');

              
    
    }	
    
    


function setSelectedbyvalue(valuetosearchfor, dropdownlistid)
    { 
      var tempElement = document.getElementById(dropdownlistid);
      var a=tempElement.value;
      for (i=0;i<tempElement.length;i++)
      {
        if (valuetosearchfor == tempElement.options[i].value)
        {
          tempElement.options[i].selected = true;
          return;
        }
      }

    }
  




    function setSelectedbytext(texttosearchfor, dropdownlistid)
    { 

      var a=document.getElementById(dropdownlistid).value;
      for (i=0;i<document.getElementById(dropdownlistid).length;i++)
      {

        if (texttosearchfor == document.getElementById(dropdownlistid).options(i).text)
        {
          document.getElementById(dropdownlistid).options(i).selected = true;
          return;
        }
      }

    }











function poplist(mylink)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, 'infopop','width=400,height=300,scrollbars=no');
return false;
}

function OpenHelpWindow(mylink)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, 'userinfo', 'width=600,height=550,scrollbars=yes');
return false;
}

function OpenMapWindow(mylink)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, 'userinfo', 'width=600,height=500,scrollbars=yes');

}

function isValidDate(day,month,year){
/*
Purpose: return true if the date is valid, false otherwise

Arguments: day integer representing day of month
month integer representing month of year
year integer representing year

Variables: dteDate - date object

*/
var dteDate;

//set up a Date object based on the day, month and year arguments
//javascript months start at 0 (0-11 instead of 1-12)
dteDate=new Date(year,month,day);

/*
Javascript Dates are a little too forgiving and will change the date to a reasonable guess if it's invalid. We'll use this to our advantage by creating the date object and then comparing it to the details we put it. If the Date object is different, then it must have been an invalid date to start with...
*/

return ((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()));
}

function addsource(url)
{
window.location = url  + '&src=X00002';
top.location.href  = url  + '&src=X00002';
}





    var monthsArray = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
    var monthsNumberArray = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
    function generatemydropdown()
    {
      optionNum = 0;
      selText = '';
      selValue = '';
      startdate = new Date();
      enddate = new Date();
      enddate.setMonth(enddate.getMonth() + 10);
      workingdate = new Date(startdate.getFullYear(), startdate.getMonth() -1, 1);
      while (workingdate < enddate)
      {
        workingdate.setMonth(workingdate.getMonth() + 1);
        year = workingdate.getFullYear();
        if (year < 1900) year += 1900;
        selText = (monthsArray[workingdate.getMonth()] + ' ' + year);

	
        selValue = (monthsArray[workingdate.getMonth()].toUpperCase() + year.toString().substring(2,4));
	document.forms[0].dmy.options[optionNum] = new Option(selText, selValue);
        document.forms[0].rmy.options[optionNum] = new Option(selText, selValue);
        optionNum++;

      }
      
      mytoday = new Date();
      mytomorrow = new Date();
      mytoday.setDate(mytoday.getDate() + 1);
      mytomorrow.setDate(mytomorrow.getDate() + 2);
      
      
      
      mytodayyear = mytoday.getFullYear().toString().substring(2,4);
      
      mytomorrowyear = mytomorrow.getFullYear().toString().substring(2,4);
      
      

      setSelectedbyvalue(mytoday.getDate(),'field_from_day');
      setSelectedbyvalue(mytomorrow.getDate(), 'field_to_day');
      setSelectedbyvalue(monthsArray[mytoday.getMonth()].toUpperCase() + mytodayyear, 'field_from_month');
      setSelectedbyvalue(monthsArray[mytomorrow.getMonth()].toUpperCase() + mytomorrowyear, 'field_to_month');

              
    
    }	
    
    


function setSelectedbyvalue(valuetosearchfor, dropdownlistid)
    { 
      var tempElement = document.getElementById(dropdownlistid);
      var a=tempElement.value;
      for (i=0;i<tempElement.length;i++)
      {
        if (valuetosearchfor == tempElement.options[i].value)
        {
          tempElement.options[i].selected = true;
          return;
        }
      }

    }
  




    function setSelectedbytext(texttosearchfor, dropdownlistid)
    { 

      var a=document.getElementById(dropdownlistid).value;
      for (i=0;i<document.getElementById(dropdownlistid).length;i++)
      {

        if (texttosearchfor == document.getElementById(dropdownlistid).options(i).text)
        {
          document.getElementById(dropdownlistid).options(i).selected = true;
          return;
        }
      }

    }





 //-->
