//
//  index_forms.js
//

//
//  Declare any variables to be reused
//
var daysel="<option>1</option><option>2</option><option>3</option><option>4</option><option>5</option>" +
             "<option>6</option><option>7</option><option>8</option><option>9</option><option>10</option>" +
             "<option>11</option><option>12</option><option>13</option><option>14</option><option>15</option>" +
             "<option>16</option><option>17</option><option>18</option><option>19</option><option>20</option>" +
             "<option>21</option><option>22</option><option>23</option><option>24</option><option>25</option>" +
             "<option>26</option><option>27</option><option>28</option><option>29</option><option>30</option>" +
             "<option>31</option>";

var timesel="<option value=0>Midnight</option>" +
           "<option value=0.3>00:30 am</option>" +
           "<option value=1.0>01:00 am</option>" +
           "<option value=1.3>01:30 am</option>" +
           "<option value=2.0>02:00 am</option>" +
           "<option value=2.3>02:30 am</option>" +
           "<option value=3.0>03:00 am</option>" +
           "<option value=3.3>03:30 am</option>" +
           "<option value=4.0>04:00 am</option>" +
           "<option value=4.3>04:30 am</option>" +
           "<option value=5.0>05:00 am</option>" +
           "<option value=5.3>05:30 am</option>" +
           "<option value=6.0>06:00 am</option>" +
           "<option value=6.3>06:30 am</option>" +
           "<option value=7.0>07:00 am</option>" +
           "<option value=7.3>07:30 am</option>" +
           "<option value=8.0>08:00 am</option>" +
           "<option value=8.3>08:30 am</option>" +
           "<option value=9.0 selected=selected>09:00 am</option>" +
           "<option value=9.3>09:30 am</option>" +
           "<option value=10.0>10:00 am</option>" +
           "<option value=10.3>10:30 am</option>" +
           "<option value=11.0>11:00 am</option>" +
           "<option value=11.3>11:30 am</option>" +
           "<option value=12.0>Noon</option>" +
           "<option value=12.3>12:30 pm</option>" +
           "<option value=13.0>01:00 pm</option>" +
           "<option value=13.3>01:30 pm</option>" +
           "<option value=14.0>02:00 pm</option>" +
           "<option value=14.3>02:30 pm</option>" +
           "<option value=15.0>03:00 pm</option>" +
           "<option value=15.3>03:30 pm</option>" +
           "<option value=16.0>04:00 pm</option>" +
           "<option value=16.3>04:30 pm</option>" +
           "<option value=17.0>05:00 pm</option>" +
           "<option value=17.3>05:30 pm</option>" +
           "<option value=18.0>06:00 pm</option>" +
           "<option value=18.3>06:30 pm</option>" +
           "<option value=19.0>07:00 pm</option>" +
           "<option value=19.3>07:30 pm</option>" +
           "<option value=20.0>08:00 pm</option>" +
           "<option value=20.3>08:30 pm</option>" +
           "<option value=21.0>09:00 pm</option>" +
           "<option value=21.3>09:30 pm</option>" +
           "<option value=22.0>10:00 pm</option>" +
           "<option value=22.3>10:30 pm</option>" +
           "<option value=23.0>11:00 pm</option>" +
           "<option value=23.3>11:30 pm</option>";




//
//  display the flight segment panel 
//
function display_flight(pid) {

   ffld="<form id=fl1 method=post action=index.php>" + 
          "<fieldset style=\"visibility:hidden\" class=flh1> "+
         "<input type=hidden name=mode value=\"addflight\"> " +
         "<input type=hidden name=pid value=\"" + pid+ "\"> " +
         "</fieldset>" +
          "<fieldset>" +
          "<p><label>Airline</label><input type=text name=airline></p>" +
          "<p><label>Flight No</label><input type=text name=flightno></p>" +
          "<p><label>Depart From</label><input type=text name=fromloc id=flfromloc></p>" +
          "<p><label>Depart Date / Time</label>" +
          "<select name=fromday id=fromday>" + daysel + "</select>" +
          "<select name=frommthyr id=frommthyr>" + mthyrstr + "</select>" +
          "<select name=fromtime>" + timesel + "</select>" +
          "<p><label>Arrive At</label><input type=text name=toloc  id=fltoloc></p>" +
          "<p><label>Arrive Date / Time</label>" +
          "<select name=today id=today>" + daysel + "</select>" +
          "<select name=tomthyr id=tomthyr>" + mthyrstr + "</select>" +
          "<select name=totime>" + timesel + "</select></p>" +
          "<p><label>Reservation No</label><input type=text name=resno></p>" +

          "<div id=fl1sub><input type=image src=\"./images/add_flight.gif\" border=0></div>" +
          "</fieldset>" +
          "</form>";

   close_transfer();
   close_car();
   close_accom();
   close_misc();
   document.getElementById("flights").innerHTML=ffld;
   document.getElementById("tabpanel").style.background="url(./images/flight_tab.jpg) no-repeat";

}

function close_flight() {
  document.getElementById("flights").innerHTML="";
}


//
//  display the transfer segment panel 
//
function display_transfer(pid) {

   ffld="<form id=fl1 method=post action=index.php>" + 
          "<fieldset style=\"visibility:hidden\" class=flh1> "+
         "<input type=hidden name=mode value=\"addtransfer\"> " +
         "<input type=hidden name=pid value=\"" + pid+ "\"> " +
         "</fieldset>" +
          "<fieldset>" +
          "<p><label>Tansfer Details</label><input type=text name=transfer></p>" +
          "<p><label>Phone No</label><input type=text name=phoneno></p>" +
          "<p><label>Depart From</label><input type=text name=fromloc id=ttfromloc></p>" +
          "<p><label>Depart Date / Time</label>" +
          "<select name=fromday id=fromday>" + daysel + "</select>" +
          "<select name=frommthyr id=frommthyr>" + mthyrstr + "</select>" +
          "<select name=fromtime>" + timesel + "</select>" +
          "<p><label>Arrive At</label><input type=text name=toloc id=tttoloc></p>" +
          "<p><label>Arrive Date / Time</label>" +
          "<select name=today id=today>" + daysel + "</select>" +
          "<select name=tomthyr id=tomthyr>" + mthyrstr + "</select>" +
          "<select name=totime>" + timesel + "</select></p>" +
          "<p><label>Reservation No</label><input type=text name=resno></p>" +

          "<div id=fl1sub><input type=image src=\"./images/add_tour.gif\" border=0></div>" +
          "</fieldset>" +
          "</form>";

   close_flight();
   close_car();
   close_accom();
   close_misc();
   document.getElementById("flights").innerHTML=ffld;
   document.getElementById("tabpanel").style.background="url(./images/tour_tab.jpg) no-repeat";
}
function close_transfer() {
  document.getElementById("flights").innerHTML="";
}

//
//  display the car/campervan segment panel 
//
function display_car(pid) {

   ffld="<form id=fl1 method=post action=index.php>" + 
          "<fieldset style=\"visibility:hidden\"> "+
         "<input type=hidden name=mode value=\"addcar\"> " +
         "<input type=hidden name=pid value=\"" + pid+ "\"> " +
         "</fieldset>" +
          "<fieldset>" +
          "<p><label>Company Name</label><input type=text name=company></p>" +
          "<p><label>Pickup From</label><input type=text name=fromloc></p>" +
          "<p><label>Address</label><input type=text name=fromaddress id=cfromaddress></p>" +
          "<p><label>Phone No</label><input type=text name=fromphoneno></p>" +
          "<p><label>Pickup Date / Time</label>" +
          "<select name=fromday id=fromday>" + daysel + "</select>" +
          "<select name=frommthyr id=frommthyr>" + mthyrstr + "</select>" +
          "<select name=fromtime>" + timesel + "</select></p>" +
          "<p><label>Dropoff At</label><input type=text name=toloc></p>" +
          "<p><label>Address</label><input type=text name=toaddress id=ctoaddress></p>" +
          "<p><label>Phone No</label><input type=text name=tophoneno></p>" +
          "<p><label>Dropoff Date / Time</label>" +
          "<select name=today id=today>" + daysel + "</select>" +
          "<select name=tomthyr id=tomthyr>" + mthyrstr + "</select>" +
          "<select name=totime>" + timesel + "</select></p>" +
          "<p><label>Reservation No</label><input type=text name=resno></p>" +

          "<div id=fl1sub><input type=image src=\"./images/add_car.gif\" border=0></div>" +
          "</fieldset>" +
          "</form>";

   close_flight();
   close_transfer();
   close_accom();
   close_misc();

   document.getElementById("flights").innerHTML=ffld;
   document.getElementById("tabpanel").style.background="url(./images/car_tab.jpg) no-repeat";
}
function close_car() {
  document.getElementById("flights").innerHTML="";
}


//
//  display the Accommodation segment panel 
//
function display_accom(pid) {

   ffld="<form  id=fl1 method=post action=index.php>" + 
          "<fieldset style=\"visibility:hidden\"> "+
         "<input type=hidden name=mode value=\"addaccom\"> " +
         "<input type=hidden name=pid value=\"" + pid+ "\"> " +
         "</fieldset>" +
          "<fieldset>" +
          "<p><label>Hotel Name</label><input type=text name=hotel></p>" +
          "<p><label>Address</label><input type=text name=address id=haaddress></p>" +
          "<p><label>Phone No</label><input type=text name=phoneno></p>" +

          "<p><label>Check In Date</label>" +
          "<select name=fromday id=fromday>" + daysel + "</select>" +
          "<select name=frommthyr id=frommthyr>" + mthyrstr + "</select>" +
          "<p><label>Checkout Date</label>" +
          "<select name=today id=today>" + daysel + "</select>" +
          "<select name=tomthyr id=tomthyr>" + mthyrstr + "</select></p>" +
          "<p><label>Reservation No</label><input type=text name=resno></p>" +

          "<div id=fl2sub><input type=image src=\"./images/add_accomm.gif\" border=0></div>" +
          "</fieldset>" +
          "</form>";

   close_flight();
   close_transfer();
   close_car();
   close_misc();
   document.getElementById("flights").innerHTML=ffld;
   document.getElementById("tabpanel").style.background="url(./images/accom_tab.jpg) no-repeat";
}
function close_accom() {
  document.getElementById("flights").innerHTML="";
}


//
//  display the Miscillaneuos segment panel 
//
function display_misc(pid) {

   ffld="<form  id=fl1 method=post action=index.php>" + 
          "<fieldset style=\"visibility:hidden\"> "+
         "<input type=hidden name=mode value=\"addmisc\"> " +
         "<input type=hidden name=pid value=\"" + pid+ "\"> " +
         "</fieldset>" +
          "<fieldset>" +
          "<p id=pnote><label id=lnote>Notes</label><textarea name=mnote id=mnote></textarea><br/>ie. travel insurance policyno, passport no, emergency contact numbers</p>" +

          "<div id=fl1sub><input type=image src=\"./images/add_misc.gif\" border=0></div>" +
          "</fieldset>" +
          "</form>";

   close_flight();
   close_transfer();
   close_car();
   close_accom();

   document.getElementById("flights").innerHTML=ffld;
   document.getElementById("tabpanel").style.background="url(./images/misc_tab.jpg) no-repeat";
}
function close_misc() {
  document.getElementById("flights").innerHTML="";
}

//
//   Reset the dates from the previous ones 
//
function default_dates(day1, mthyr1, day2, mthyr2) {
   var daycnt1 = day1 - 1;
   var daycnt2 = day2 - 1;

   document.getElementById("fromday").options[daycnt1].selected = true;
   document.getElementById("today").options[daycnt2].selected = true;
   document.getElementById("frommthyr").options[mthyr1].selected = true;
   document.getElementById("tomthyr").options[mthyr2].selected = true;

}

//
//  openhelp
//
function openhelp(url) {
    newwindow=window.open(url,'helpwin','height=450,width=450,scrollbars=yes');
    if (window.focus) {
         newwindow.focus()
    }
    return false; 
}


// The END 
