      <!-- Beginning of JavaScript

      function pathtail( path ) {
         parts = new Array();
         parts = path.split( "/" );
         var nparts = parts.length;
         return parts[nparts-1];
      }


      var testurl0;
      var testurl1;
      var testurl2;
      function where_am_i() {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;


      // Clock adds an extra frame at top.

         testurl0 = pathtail( top.frames[1].location.pathname );
         if ( testurl0.slice( 0, 7 ) == "testver" ) {
            testurl0 = testurl0.slice( 8 );
         }
         if ( testurl0 == "ridematch_clock.php" ) {
            ii = 1;
         } else {
            ii = 0;
         }
      // if( alert_debug_f ) {
      //    alert( "where_am_i: ii: " + ii
      //           + "\ntop.length: " + top.length );
      // }
         if( top.length == ii+2 ) {

            // No ridematch main (registered user).  Page will be 2nd frame [1]
            // (or 3rd [2], if clock).

            testurl1 = pathtail( top.frames[ii+1].location.pathname );
            testurl2 = "";
         } else {
            testurl1 = pathtail( top.frames[ii+2].location.pathname );
            if ( top.length >= ii+4 ) {
               testurl2 = pathtail( top.frames[ii+3].location.pathname );
            } else {
               testurl2 = "";
            }
         }
         if ( testurl1.slice( 0, 7 ) == "testver" ) {
            testurl1 = testurl1.slice( 8 );
            testurl2 = testurl2.slice( 8 );
         }
         if ( alert_debug_f ) {
            alert(     "testurl0: " + testurl0 
                   + "\ntesturl1: " + testurl1 
                   + "\ntesturl2: " + testurl2 );
         }
      }


      function login() {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;
         fp = document.forms.main_pass_data;

         // Find out what page we're on.

         where_am_i();
         if ( testurl1 == "registration_form.php"
                || testurl2 == "registration_form.php" ) {

            // Coming from registration form.

            if ( check_reg_save_done() ) {
               f = top.registration_form_frame.document.forms.Registration_form;
               site = f.site.value;
               fp.site.value = site;
               fp.action = "ridematch_login_frame.php";
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_requests.php" ) {

            // Coming from ridematch requests.

            if ( check_request_submit_ok() ) {
               f = top.ridematch_req_frame.document.forms.pass_data;
               site = f.site.value;
               fp.site.value = site;

               fp.action = "ridematch_login_frame.php";
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_confirm.php" ) {
      
            // Coming from ridematch confirm.

            f = top.ridematch_confirm_frame.document.forms.match_display;
            site = f.site.value;
            fp.site.value = site;

            fp.action = "ridematch_login_frame.php";
            fp.submit();
         } else if ( testurl1 == "ridematch_login.php" ) {

            // Already on login page.  Just go to login section of page.
            // Hash doesn't work in Netscape 4.

            document.location.hash = "#login_anchor";
            f = document.forms.start;
            if ( f.site.value == "" ) {
               f.site_label.focus();
            } else if ( f.area_code.value == "" ) {
               f.area_code.focus();
            } else {
               f.PIN.focus();
            }
         } else {
            
            // Coming from FAQ or contact or other_match_options or whos_going.

            f = top.primary_frame.document.forms.pass_data;
            site = f.site.value;
            fp.site.value = site;

            fp.action = "ridematch_login_frame.php";
            fp.submit();
         }
      }


      function registration() {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;
         fp = document.forms.main_pass_data;

         fp.action = "registration.php";

         // Find out what page we're on.

         where_am_i();

         // Wherever we're coming from and wherever we've been called from --
         // either ridematch_main (top of page) or regular page (bottom),
         // registration frame will need pc_nav6up_f set.

         if ( is_nav6up && is_win ) {
            fp.pc_nav6up_f.value = "1";
         } else {
            fp.pc_nav6up_f.value = "";
         }

         if ( testurl1 == "ridematch_login.php" ) {

            // Coming from login.  If initial entry to site, see if web site
            // password needed (and verify, if so), and make sure Ride Now! site
            // selected.

            if ( site_ok() ) {
               f = top.ridematch_login.document.forms.start;
               site = f.site.value;
               fp.site.value = site;
               fp.ID2.value = 1;

               fp.test_ride_f.value = 1;
               fp.form_index.value = 0;
               fp.submit();
            }
         } else if ( testurl1 == "registration_form.php"
                || testurl2 == "registration_form.php" ) {

            // This page.  Do nothing.

         } else if ( testurl1 == "ridematch_requests.php" ) {

            // Coming from ridematch requests.

            if ( check_request_submit_ok() ) {
               f = top.ridematch_req_frame.document.forms.pass_data;
               site = f.site.value;
               fp.site.value = site;

               ID = f.ID.value;
               if ( ID <= 2 ) {
                  fp.form_index.value = 0;
               }
               fp.ID2.value = ID;
               test_ride_f = f.test_ride_f.value;
               fp.test_ride_f.value = test_ride_f;
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_confirm.php" ) {
      
            // Coming from ridematch confirm.

            f = top.ridematch_confirm_frame.document.forms.match_display;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            if ( ID <= 2 ) {
               fp.form_index.value = 0;
            }
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;
            fp.submit();
         } else {
            
            // Coming from FAQ or contact or other_match_options or whos_going.

            f = top.primary_frame.document.forms.pass_data;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            if ( ID <= 2 ) {
               fp.form_index.value = 0;
            }
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;
            fp.submit();
         }
      }


      function whos_going() {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;
         fp = document.forms.main_pass_data;

         where_am_i();

         if ( testurl1 == "ridematch_login.php" ) {

         // Coming from login.

            if ( site_ok() ) {
               f = top.ridematch_login.document.forms.start;
               site = f.site.value;
               fp.site.value = site;
               fp.ID2.value = 1;

               fp.test_ride_f.value = 1;
               fp.action = "whos_going_frame.php";
               fp.submit();
            }
         } else if ( testurl1 == "registration_form.php"
                || testurl2 == "registration_form.php" ) {

            // Coming from registration form.

            if ( check_reg_save_done() ) {
               f = top.registration_form_frame.document.forms.Registration_form;
               site = f.site.value;
               fp.site.value = site;

               // Get ID and flag if completed registration.  ***Use ID=2 if not
               // yet registered.

               ID = f.ID.value;
               fp.ID2.value = ID;

               registration_complete_f = f.Registration_complete_f.value;
               if ( registration_complete_f == 1 ) {
                  test_ride_f = 0;
               } else if ( registration_complete_f == 0 ) {
                  test_ride_f = 1;
               } else {
                  test_ride_f = registration_complete_f;
               }
               fp.test_ride_f.value = test_ride_f;
               if ( alert_debug_f ) {
                  alert( "ID: " + ID 
                         + "\nf.Registration_complete_f.value: " 
                                               + f.Registration_complete_f.value
                      + "\ntest_ride_f2: " + test_ride_f );
               }
               fp.action = "whos_going_frame.php";
               fp.submit();
            }
         } else if ( testurl1 == "whos_going.php" ) {

            // This page.  Do nothing.

         } else if ( testurl1 == "ridematch_requests.php" ) {
            
            // Coming from ridematch requests.

            if ( check_request_submit_ok() ) {
               f = top.ridematch_req_frame.document.forms.pass_data;
               site = f.site.value;
               fp.site.value = site;

               ID = f.ID.value;
               fp.ID2.value = ID;
               test_ride_f = f.test_ride_f.value;
               fp.test_ride_f.value = test_ride_f;
               fp.action = "whos_going_frame.php";
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_confirm.php" ) {
      
            // Coming from ridematch confirm.

            f = top.ridematch_confirm_frame.document.forms.match_display;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            if ( alert_debug_f ) {
               alert( "ridematch_confirm --> ridematch_requests: ID: " + ID );
            }
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;

            fp.action = "whos_going_frame.php";
            fp.submit();
         } else {
            
            // Coming from FAQ or contact or other_match_options.

            f = top.primary_frame.document.forms.pass_data;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;

            if ( alert_debug_f ) {
               alert( "faq --> whos_going: ID: " + ID 
                      + "\ntest_ride_f: " + test_ride_f );
            }
            fp.action = "whos_going_frame.php";
            fp.submit();
         }
      }


      function ridematch_req() {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;
         fp = document.forms.main_pass_data;

         where_am_i();

         // Set indicator that link was clicked on.

         fp.link_click.value = "ridematch_req";

         if ( testurl1 == "ridematch_login.php" ) {

         // Coming from login.

            if ( site_ok() ) {
               f = top.ridematch_login.document.forms.start;
               site = f.site.value;
               fp.site.value = site;
               fp.ID2.value = 1;

               fp.test_ride_f.value = 1;
               fp.submit();
            }
         } else if ( testurl1 == "registration_form.php"
                || testurl2 == "registration_form.php" ) {

            // Coming from registration form.

            if ( check_reg_save_done() ) {
               f = top.registration_form_frame.document.forms.Registration_form;
               site = f.site.value;
               fp.site.value = site;

               // Get ID and flag if completed registration.  ***Use ID=2 if not
               // yet registered.

               ID = f.ID.value;
               fp.ID2.value = ID;

               registration_complete_f = f.Registration_complete_f.value;
               if ( registration_complete_f == 1 ) {
                  test_ride_f = 0;
               } else if ( registration_complete_f == 0 ) {
                  test_ride_f = 1;
               } else {
                  test_ride_f = registration_complete_f;
               }
               fp.test_ride_f.value = test_ride_f;
               if ( alert_debug_f ) {
                  alert( "ID: " + ID 
                         + "\nf.Registration_complete_f.value: " 
                                               + f.Registration_complete_f.value
                      + "\ntest_ride_f2: " + test_ride_f );
               }
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_requests.php" ) {

            // This page.  Do nothing.

         } else if ( testurl1 == "ridematch_confirm.php" ) {
      
            // Coming from ridematch confirm.

            f = top.ridematch_confirm_frame.document.forms.match_display;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            if ( alert_debug_f ) {
               alert( "ridematch_confirm --> ridematch_requests: ID: " + ID );
            }
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;

            fp.submit();
         } else {
            
            // Coming from FAQ or contact or other_match_options or whos_going.

            f = top.primary_frame.document.forms.pass_data;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;

            if ( alert_debug_f ) {
               alert( "faq --> ridematch_requests: ID: " + ID 
                      + "\ntest_ride_f: " + test_ride_f );
            }
            fp.submit();
         }
      }


      function ridematch_confirm() {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;
         fp = document.forms.main_pass_data;

         where_am_i();

         if ( testurl1 == "ridematch_login.php" ) {

            // Coming from login.

            if ( site_ok() ) {
               f = top.ridematch_login.document.forms.start;
               site = f.site.value;
               fp.site.value = site;
               fp.ID2.value = 1;

               fp.test_ride_f.value = 1;
               fp.action = "ridematch_confirm_frame.php";
               fp.submit();
            }
         } else if ( testurl1 == "registration_form.php"
                || testurl2 == "registration_form.php" ) {

            // Coming from registration form.

            if ( check_reg_save_done() ) {
               f = top.registration_form_frame.document.forms.Registration_form;
               site = f.site.value;
               fp.site.value = site;

               // Get ID and flag if completed registration.  *** Use ID=2 if
               // not yet registered.

               ID = f.ID.value;
               fp.ID2.value = ID;

               registration_complete_f = f.Registration_complete_f.value;
               if ( registration_complete_f == 1 ) {
                  test_ride_f = 0;
               } else if ( registration_complete_f == 0 ) {
                  test_ride_f = 1;
               } else {
                  test_ride_f = registration_complete_f;
               }
               fp.test_ride_f.value = test_ride_f;
               if ( alert_debug_f ) {
                  alert( "registration_complete_f: " + registration_complete_f);
               }
               fp.action = "ridematch_confirm_frame.php";
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_requests.php" ) {
            
            // Coming from ridematch requests.

            if ( check_request_submit_ok() ) {
               f = top.ridematch_req_frame.document.forms.pass_data;
               site = f.site.value;
               fp.site.value = site;

               ID = f.ID.value;
               fp.ID2.value = ID;
               test_ride_f = f.test_ride_f.value;
               fp.test_ride_f.value = test_ride_f;

               // If passed with argument, means set variable so can view 
               // previous matches (don't kick back to ridematch requests).

               if ( arguments.length == 1 ) {
                  fp.test_ride_w_standard_ID_f.value = 1;
               }

               fp.action = "ridematch_confirm_frame.php";
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_confirm.php" ) {
      
            // This page.  Do nothing.

         } else {
            
            // Coming from FAQ or contact or other_match_options or whos_going.

            f = top.primary_frame.document.forms.pass_data;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;
            fp.action = "ridematch_confirm_frame.php";
            fp.submit();
         }
      }

      function faq( page_index ) {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;
         fp = document.forms.main_pass_data;

         if ( page_index == 0 ) {
            page = "faq.php";
         } else if ( page_index == 1 ) {
            page = "contact.php";
         } else if ( page_index == 2 ) {
            page = "statistics.php";
         } else if ( page_index == 3 ) {
            page = "parking_credits.php";
         } else if ( page_index == 4 ) {
            page = "view_parking_credits.php";
         } else if ( page_index == 5 ) {
            page = "features.php";
         } else if ( page_index == 6 ) {
            page = "user_guides.php";
         } else if ( page_index == 7 ) {
            page = "ride_now_inc.php";
         } else if ( page_index == 8 ) {
            page = "my_account.php";
         }
         fp.page.value = page;

         fp.action = "faq_frame.php";


         where_am_i();

         if ( testurl1 == "ridematch_login.php" ) {

            // Coming from login.

            if ( site_ok() ) {
               f = top.ridematch_login.document.forms.start;
               site = f.site.value;
               fp.site.value = site;
               fp.ID2.value = 1;

               fp.test_ride_f.value = 1;
               fp.submit();
            }
         } else if (    testurl1 == "registration_form.php"
                     || testurl2 == "registration_form.php" ) {

            // Coming from registration form.

            if ( check_reg_save_done() ) {
               f = top.registration_form_frame.document.forms.Registration_form;
               site = f.site.value;
               fp.site.value = site;

               // Get ID and flag if completed registration.  

               ID = f.ID.value;
               fp.ID2.value = ID;

               registration_complete_f = f.Registration_complete_f.value;
               if ( registration_complete_f == 1 ) {
                  test_ride_f = 0;
               } else if ( registration_complete_f == 0 ) {
                  test_ride_f = 1;
               } else {
                  test_ride_f = registration_complete_f;
               }
               fp.test_ride_f.value = test_ride_f;
               if ( alert_debug_f ) {
                  alert( "registration_complete_f: " + registration_complete_f);
               }

               fp.submit();
            }
         } else if ( testurl1 == "ridematch_requests.php" ) {
            
            // Coming from ridematch requests.

            if ( check_request_submit_ok() ) {
               f = top.ridematch_req_frame.document.forms.pass_data;
               site = f.site.value;
               fp.site.value = site;

               ID = f.ID.value;
               fp.ID2.value = ID;
               test_ride_f = f.test_ride_f.value;
               fp.test_ride_f.value = test_ride_f;
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_confirm.php" ) {
      
            // Coming from ridematch confirm.

            f = top.ridematch_confirm_frame.document.forms.match_display;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;
            fp.submit();
         } else {
            
            // Coming from FAQ or contact or other_match_options or whos_going.

            f = top.primary_frame.document.forms.pass_data;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;
            fp.submit();
         }
      }


      function other_match_options() {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;
         fp = document.forms.main_pass_data;

         fp.action = "other_match_options_frame.php";

         // Find out what page we're on.

         where_am_i();

         if ( testurl1 == "ridematch_login.php" ) {

            // Coming from login.  If initial entry to site, see if web site
            // password needed (and verify, if so), and make sure Ride Now! site
            // selected.

            if ( site_ok() ) {
               f = top.ridematch_login.document.forms.start;
               site = f.site.value;
               fp.site.value = site;
               fp.ID2.value = 1;

               fp.test_ride_f.value = 1;
               fp.form_index.value = 0;
               fp.submit();
            }
         } else if ( testurl1 == "registration_form.php"
                || testurl2 == "registration_form.php" ) {

            // Coming from registration form.

            if ( check_reg_save_done() ) {
               f = top.registration_form_frame.document.forms.Registration_form;
               site = f.site.value;
               fp.site.value = site;

               // Get ID and flag if completed registration.  ***Use ID=2 if not
               // yet registered.

               ID = f.ID.value;
               fp.ID2.value = ID;

               registration_complete_f = f.Registration_complete_f.value;
               if ( registration_complete_f == 1 ) {
                  test_ride_f = 0;
               } else if ( registration_complete_f == 0 ) {
                  test_ride_f = 1;
               } else {
                  test_ride_f = registration_complete_f;
               }
               fp.test_ride_f.value = test_ride_f;
               if ( alert_debug_f ) {
                  alert( "ID: " + ID 
                         + "\nf.Registration_complete_f.value: " 
                                               + f.Registration_complete_f.value
                      + "\ntest_ride_f2: " + test_ride_f );
               }
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_requests.php" ) {

            // Coming from ridematch requests.

            if ( check_request_submit_ok() ) {
               f = top.ridematch_req_frame.document.forms.pass_data;
               site = f.site.value;
               fp.site.value = site;

               ID = f.ID.value;
               if ( ID <= 2 ) {
                  fp.form_index.value = 0;
               }
               fp.ID2.value = ID;
               test_ride_f = f.test_ride_f.value;
               fp.test_ride_f.value = test_ride_f;
               fp.submit();
            }
         } else if ( testurl1 == "ridematch_confirm.php" ) {
      
            // Coming from ridematch confirm.

            f = top.ridematch_confirm_frame.document.forms.match_display;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            if ( ID <= 2 ) {
               fp.form_index.value = 0;
            }
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;
            fp.submit();
         } else {
            
            // Coming from faq.

            f = top.primary_frame.document.forms.pass_data;
            site = f.site.value;
            fp.site.value = site;

            ID = f.ID.value;
            if ( ID <= 2 ) {
               fp.form_index.value = 0;
            }
            fp.ID2.value = ID;
            test_ride_f = f.test_ride_f.value;
            fp.test_ride_f.value = test_ride_f;
            fp.submit();
         }
      }


   // When coming from login, make sure Ride Now site selected.

      function site_ok() {
         f = top.ridematch_login.document.forms.start;
         var msg = "";

   // See if site selected.

         var site = top.ridematch_login.site_selected()
         if ( site == "" ) {
            msg += "\nPlease select a Ride Now! service/area";
         }

         var ok_f = true;
         if ( msg != "" ) {
            alert( msg );
            ok_f = false;
         }
         return ok_f;
      }


      function check_request_submit_ok() {
         var ok_f = true;

         var fp = top.ridematch_req_frame.document.forms.pass_data;
         var req_view_confirm_f = fp.req_view_confirm_f2.value;

         if ( req_view_confirm_f == 1 ) {

            var f = top.ridematch_req_frame.document.forms.match_request;
            var registration_complete_f = f.Registration_complete_f.value;
            if ( registration_complete_f == 1 ) {
               var req_submitted_f = f.req_submitted_f.value;
               var data_changed_f = fp.data_changed_f.value;
               if ( req_submitted_f == 0 ) {
                  ok_f = confirm( "Note: the request on this page has not "
                                  + "been submitted." 
                                  + "\nClick cancel if you want to submit "
                                  + "the request before continuing."
                                  + "\nClick OK to continue anyway." );
               } else if ( data_changed_f ) {
                  ok_f = confirm( "Note: the new information on this page has "
                                  + "not been submitted." 
                                  + "\nClick cancel if you want to submit the "
                                  + "updated request before continuing."
                                  + "\nClick OK to continue anyway." );
               }
            }
         }
         return ok_f;
      }

      
   // If coming from registration form, check whether changes have been saved.
   // If form_index is 9 (successful "Done"), then disable buttons here
   // (too many variables to keep track of -- require user to click "Request
   // ride match" button to move on.)

      function check_reg_save_done() {
         alert_debug_f = document.forms.alert_debug.alert_debug1_f.value;
         f = top.registration_form_frame.document.forms.Registration_form;
         if ( f.form_index.value == 9 ) {
            if ( alert_debug_f ) {
               alert( "form_index: " + f.form_index.value );
            }
            return false;
         }

         var ok_f = true;

         var Registration_complete_f = f.Registration_complete_f.value;
         var data_changed_f = f.data_changed_f.value;

         if ( alert_debug_f ) {
            alert( "data_changed_f: " + data_changed_f );
         }
         if ( data_changed_f == 1 && Registration_complete_f != 1 ) {
            ok_f = confirm( "Note: new information on this page has not "
                            + "been saved and checked."
                            + "\nClick cancel and then click the \"Save and "
                            + "continue\" button if you want to save your "
                            + "changes before continuing."
                            + "\nClick OK to continue without saving." );
         } else if ( data_changed_f == 1 ) {
            ok_f = confirm( "Note: new information on this page has not "
                            + "been saved."
                            + "\nClick cancel if you want to save your "
                            + "changes before continuing."
                            + "\nClick OK to continue without saving." );
         } else if ( Registration_complete_f == -1 ) {
            ok_f = confirm( "Note: changes entered on this page have not "
                            + "been checked.  You will not be able to request "
                            + "ride matches until you click \"Done\"."
                            + "\nClick cancel if you want to click \"Done\" "
                            + "before continuing."
                            + "\nClick OK to continue anyway." );
         }
         return ok_f;
      }
      

      // End of JavaScript -->

