<!--
     function getModels(){
          url = '/displayajax.html?fa=smd&q_make_id=' + document.form.q_make_id.value;
          makeRequest(url,'models',true);
     }

     function getResults(){
          url = '/displayajax.html?fa=gr&q_make_id=' + document.form.q_make_id.value + '&q_model_id=' + document.form.q_model_id.value + '&q_min_price_id=' + document.form.q_min_price_id.value + '&q_max_price_id=' + document.form.q_max_price_id.value ;
          url = url + '&page=' + document.form.page.value + '&o_b=' + document.form.o_b.value + '&o_d=' + document.form.o_d.value + '&sc_id=' + document.form.sel_car_id.value;
          makeRequest(url,'display_results',true);
     }

     function submitHiddenForm(page_count){
          document.form.page.value = page_count;
          getResults();
     }

     function sortSearch(o_b, o_d){
          document.form.page.value = 1;
          if(o_b == document.form.o_b.value){
               document.form.o_d.value = o_d;
          }else{
               document.form.o_b.value = o_b;
          }
          getResults();
     }

     function getSelectedCarImage(car_id){
          if(car_id != ''){
               prev_car_id = document.form.sel_car_id.value;
               if(prev_car_id != ''){
                    tmp_name = 'stocklist_' +  prev_car_id;
                    unSelectStock(tmp_name);
               }
               document.form.sel_car_id.value = car_id;
               tmp_name = 'stocklist_' +  car_id;
               selectStock(tmp_name);
               url = '/displayajax.html?fa=si&c_id=' + car_id ;
               makeRequest(url,'sel_car',true);
          }
     }

     function getSelectedCar(car_id){
          if(car_id != ''){
              // document.form.sel_car_id.value = car_id;
               setLabel('menu_header','Vehicle Information');
               url = '/displayajax.html?fa=sc&c_id=' + car_id ;
               makeRequest(url,'display_results',true);
          }
     }

     function setMouseOverColour(row_id, item){
          if(row_id == document.form.sel_car_id.value){
               item.style.backgroundColor='#E6D9B5';
          }else{
               item.style.backgroundColor='#CEBF93';
          }
     }

     function setMouseOutColour(row_id, item){
          if(row_id == document.form.sel_car_id.value){
               item.style.backgroundColor='#E6D9B5';
          }else{
               item.style.backgroundColor='#BEAD7C';
          }
     }

     function validateForm() {
          var err = 0;
          var errors='';
          var email = /^.+\@.+\..+$/;

          if (!trim(document.contact_form.name.value)) {
              errors+= ' - you must enter your name\n';
              err += 1;
          }

          if (!trim(document.contact_form.email.value)) {
             err += 1;
             errors += ' - the must enter an email address\n';
          }

          if (document.contact_form.email.value && email.test(document.contact_form.email.value) == false) {
             err += 1;
             errors += ' - the email is in an invalid format\n';
          }

          if (!trim(document.contact_form.telephone.value)) {
              errors+= ' - you must enter a telephone number\n';
              err += 1;
          }

          if (!trim(document.contact_form.enquiry.value)) {
              errors+= ' - you must enter an enquiry description\n';
              err += 1;
          }

          if (err > 0) {
              alert('The following error(s) occurred:\n'+errors);
          }
          return (err == 0);
     }


     function sendEnquiry(){
          if (validateForm()) {
                  url = '/displayajax.html?fa=se&name=' + document.contact_form.name.value + '&email=' + document.contact_form.email.value;
                  url = url + '&telephone=' + document.contact_form.telephone.value + '&enquiry=' + document.contact_form.enquiry.value;
                  makeRequest(url,'display_results',true);
                  return true;
          }
          return false;
     }

     function clearForm(){
          document.contact_form.name.value = '';
          document.contact_form.email.value = '';
          document.contact_form.telephone.value = '';
          document.contact_form.enquiry.value = '';
     }

     function validateServiceForm() {
          var err = 0;
          var errors='';
          var email = /^.+\@.+\..+$/;

          if (!trim(document.booking_form.name.value)) {
              errors+= ' - you must enter your name\n';
              err += 1;
          }

          if (!trim(document.booking_form.email.value)) {
             err += 1;
             errors += ' - the must enter an email address\n';
          }

          if (document.booking_form.email.value && email.test(document.booking_form.email.value) == false) {
             err += 1;
             errors += ' - the email is in an invalid format\n';
          }

          if (!trim(document.booking_form.telephone.value)) {
              errors+= ' - you must enter a telephone number\n';
              err += 1;
          }

          if (!trim(document.booking_form.mobile.value)) {
              errors+= ' - you must enter a mobile number\n';
              err += 1;
          }

          if (!trim(document.booking_form.preferred_date.value)) {
              errors+= ' - you must enter your preferred service date\n';
              err += 1;
          }

          if (!trim(document.booking_form.make.value)) {
              errors+= ' - you must enter a make / model\n';
              err += 1;
          }

          if (!trim(document.booking_form.reg_no.value)) {
              errors+= ' - you must enter a registration number\n';
              err += 1;
          }


          if (err > 0) {
              alert('The following error(s) occurred:\n'+errors);
          }
          return (err == 0);
     }


     function sendBooking(){
          if (validateServiceForm()) {
                  url = '/displayajax.html?fa=sb&name=' + document.booking_form.name.value + '&email=' + document.booking_form.email.value;
                  url = url + '&telephone=' + document.booking_form.telephone.value + '&mobile=' + document.booking_form.mobile.value;
                  url = url + '&preferred_date=' + document.booking_form.preferred_date.value + '&make=' + document.booking_form.make.value;
                  url = url + '&engine=' + document.booking_form.engine.value + '&fuel_type=' + document.booking_form.fuel_type.value;
                  url = url + '&mileage=' + document.booking_form.mileage.value + '&reg_no=' + document.booking_form.reg_no.value;
                  url = url + '&year=' + document.booking_form.year.value + '&service_type=' + document.booking_form.service_type.value;
                  url = url + '&requirements=' + document.booking_form.requirements.value;

                  makeRequest(url,'display_results',true);
                  return true;
          }
          return false;
     }

     function clearServiceForm(){
          document.booking_form.name.value = '';
          document.booking_form.email.value = '';
          document.booking_form.telephone.value = '';
          document.booking_form.mobile.value = '';
          document.booking_form.requirements.value = '';
          document.booking_form.make.value = '';
          document.booking_form.mileage.value = '';
          document.booking_form.reg_no.value = '';
          document.booking_form.year.value = '';
          document.booking_form.preferred_date.value = '';
          document.booking_form.engine.value = '';
     }

//-->
