function changeVal(supplier) {
   // Arrays with location info included in main file from get_location_arr.js (generated by get_location_array.php)   

   word = new String(step1.myText.value); // Get the value from the text box
   word = word.toLowerCase();
   var i = 0;
   var found = "";
   
   // If there is a word typed and it has more than 1 character
   if (word != "" && word.length > 1) {
      if (supplier=="all") {
      // Loop through each array and create a string with all details to search through
         while (i < loc_name_arr.length) {
            var str2=loc_name_arr[i].toLowerCase() + " " + loc_code_arr[i].toLowerCase() + " " + loc_region_arr[i].toLowerCase();
            var word_check = str2.indexOf(word); //Check if the array word has the word the user typed in
      
            // If there was a match, ad it to the found str
            if (word_check != -1) {
               var loc_name=loc_name_arr[i];
               var loc_code=loc_code_arr[i];
            
               // If its the first found item add the select a location heading
               if (found == "") {
                  found = "<FONT CLASS=stdtext>Select a Location:</FONT><ul class=no_margin_topbot><li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               } else {
                  found = found + "<li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               }
            } // if
      
            i++;
         
         } // end while
      } else if (supplier=="avis"){
      
      
         // Loop through each array and create a string with all details to search through
         while (i < loc_name_arr_avis.length) {
            var str2=loc_name_arr_avis[i].toLowerCase() + " " + loc_code_arr_avis[i].toLowerCase() + " " + loc_region_arr_avis[i].toLowerCase();
            var word_check = str2.indexOf(word); //Check if the array word has the word the user typed in
      
            // If there was a match, ad it to the found str
            if (word_check != -1) {
               var loc_name=loc_name_arr_avis[i];
               var loc_code=loc_code_arr_avis[i];
            
               // If its the first found item add the select a location heading
               if (found == "") {
                  found = "<FONT CLASS=stdtext>Select a Location:</FONT><ul class=no_margin_topbot><li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               } else {
                  found = found + "<li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               }
            } // if
      
            i++;
         
         } // end while
      
      
      
      
      } else if (supplier=="budget"){
      
      
         // Loop through each array and create a string with all details to search through
         while (i < loc_name_arr_budget.length) {
            var str2=loc_name_arr_budget[i].toLowerCase() + " " + loc_code_arr_budget[i].toLowerCase() + " " + loc_region_arr_budget[i].toLowerCase();
            var word_check = str2.indexOf(word); //Check if the array word has the word the user typed in
      
            // If there was a match, ad it to the found str
            if (word_check != -1) {
               var loc_name=loc_name_arr_budget[i];
               var loc_code=loc_code_arr_budget[i];
            
               // If its the first found item add the select a location heading
               if (found == "") {
                  found = "<FONT CLASS=stdtext>Select a Location:</FONT><ul class=no_margin_topbot><li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               } else {
                  found = found + "<li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               }
            } // if
      
            i++;
         
         } // end while
      
      
      
      
      } else if (supplier=="hertz"){
      
      
         // Loop through each array and create a string with all details to search through
         while (i < loc_name_arr_hertz.length) {
            var str2=loc_name_arr_hertz[i].toLowerCase() + " " + loc_code_arr_hertz[i].toLowerCase() + " " + loc_region_arr_hertz[i].toLowerCase();
            var word_check = str2.indexOf(word); //Check if the array word has the word the user typed in
      
            // If there was a match, ad it to the found str
            if (word_check != -1) {
               var loc_name=loc_name_arr_hertz[i];
               var loc_code=loc_code_arr_hertz[i];
            
               // If its the first found item add the select a location heading
               if (found == "") {
                  found = "<FONT CLASS=stdtext>Select a Location:</FONT><ul class=no_margin_topbot><li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               } else {
                  found = found + "<li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               }
            } // if
      
            i++;
         
         } // end while
      
    
      } else if (supplier=="alamo"){
      
      
         // Loop through each array and create a string with all details to search through
         while (i < loc_name_arr_alamo.length) {
            var str2=loc_name_arr_alamo[i].toLowerCase() + " " + loc_code_arr_alamo[i].toLowerCase() + " " + loc_region_arr_alamo[i].toLowerCase();
            var word_check = str2.indexOf(word); //Check if the array word has the word the user typed in
      
            // If there was a match, ad it to the found str
            if (word_check != -1) {
               var loc_name=loc_name_arr_alamo[i];
               var loc_code=loc_code_arr_alamo[i];
            
               // If its the first found item add the select a location heading
               if (found == "") {
                  found = "<FONT CLASS=stdtext>Select a Location:</FONT><ul class=no_margin_topbot><li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               } else {
                  found = found + "<li><a href=\"javascript:g_location('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
               }
            } // if
      
            i++;
         
         } // end while
      
      
      
      
      } // end if alamo
      
      
      
      
      
     found = found + "</ul>";
     document.getElementById("myDiv").innerHTML = found; // Write the chosen locations to the div
     
   } else {
      document.getElementById("myDiv").innerHTML = ""; // If there is nothing in the box don't show anything in the div
   }// end if word
} // end function

// When the user selects a location write it to the text box and hidden field and clear results div
function g_location(loc_code,loc_name) {
   step1.myText.value = loc_name; 
   document.getElementById("myDiv").innerHTML = "";
   step1.PULOC.value = loc_code; 
}

function removeText() {
   if (step1.myText.value == 'Enter name, code or airport') {
      step1.myText.value = '';
   }
}

// These functions are for the drop off location, just writing to different boxes
function changeVal2() {
   // Arrays with location info included in main file from get_location_arr.js (generated by get_location_array.php)   

   word = new String(step1.myText2.value); // Get the value from the text box
   word = word.toLowerCase();
   var i = 0;
   var found = "";
   
   // If there is a word typed and it has more than 1 character
   if (word != "" && word.length > 1) {

      // Loop through each array and create a string with all details to search through
      while (i < loc_name_arr.length) {
         var str2=loc_name_arr[i].toLowerCase() + " " + loc_code_arr[i].toLowerCase() + " " + loc_region_arr[i].toLowerCase();
         var word_check = str2.indexOf(word); //Check if the array word has the word the user typed in
      
         // If there was a match, ad it to the found str
         if (word_check != -1) {
            var loc_name=loc_name_arr[i];
            var loc_code=loc_code_arr[i];
            
            // If its the first found item add the select a location heading
            if (found == "") {
               found = "Select a Location:<ul class=no_margin_topbot><li><a href=\"javascript:g_location2('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
            } else {
               found = found + "<li><a href=\"javascript:g_location2('" + loc_code + "','" + loc_name + "');\" class=link_locs>" + loc_name + "</a></li>";
            }
         } // if
      
         i++;
         
      } // end while
     found = found + "</ul>";
     document.getElementById("myDiv2").innerHTML = found; // Write the chosen locations to the div
     
   } else {
      document.getElementById("myDiv2").innerHTML = ""; // If there is nothing in the box don't show anything in the div
   }// end if word
} // end function

// When the user selects a location write it to the text box and hidden field and clear results div
function g_location2(loc_code,loc_name) {
   step1.myText2.value = loc_name; 
   document.getElementById("myDiv2").innerHTML = "";
   step1.DOLOC.value = loc_code; 
}

function removeText2() {
   if (step1.myText2.value == 'Same as Pickup') {
      step1.myText2.value = '';
   }
}

// Show all the locations
function pop_puloc() {
   if (step1.myText2.value == 'Same as Pickup') {
      step1.myText2.value = '';
   }
}