﻿// JScript File

function OnMakeSelectionCallback(result, context)
    {
     var dropdown2 = document.forms[0].elements['ctl00$vehicle_model'];
      dropdown2.innerHTML= "";
      var rows = result.split('|');
      
      var option = document.createElement("OPTION");
      option.value = 'Please choose a Model';
      option.innerHTML = 'Choose a Model';
      dropdown2.appendChild(option);
      
      for (var i = 0; i < rows.length - 1; ++i)
      {
         var values = rows[i]
         var option = document.createElement("OPTION");
        
         option.value = values;
         option.innerHTML = values;    
         dropdown2.appendChild(option);
      }
      //document.getElementById("ResultsSpan").innerHTML = "::" + rows + "::" + context;
    }
    
      function OnModelSelectionCallback(result, context)
    {
     var dropdown2 = document.forms[0].elements['ctl00$vehicle_year'];
      dropdown2.innerHTML= "";
      var rows = result.split('|');
      
      var option = document.createElement("OPTION");
      option.value = 'Please choose a Year';
      option.innerHTML = 'Choose a Year';
      dropdown2.appendChild(option);
         
      for (var i = 0; i < rows.length - 1; ++i)
      {
         var values = rows[i]
         var option = document.createElement("OPTION");
        
         option.value = values;
         option.innerHTML = values;    
         dropdown2.appendChild(option);
      }
      //document.getElementById("ResultsSpan").innerHTML = "::" + rows + "::" + context;
    }
    
    
      function OnYearSelectionCallback(result, context)
    {
     var dropdown2 = document.forms[0].elements['ctl00$vehicle_options'];
      dropdown2.innerHTML= "";
      var rows = result.split('|');
      
      var option = document.createElement("OPTION");
      option.value = 'Please choose an Option';
      option.innerHTML = 'Choose an Option';
      dropdown2.appendChild(option);
      
      //var option2 = document.createElement("OPTION");
      //option2.value = '';
      //option2.innerHTML = 'Not sure about my options';
      //dropdown2.appendChild(option2);
         
      for (var i = 0; i < rows.length - 1; ++i)
      {
         var values = rows[i]
         var option = document.createElement("OPTION");
        
         option.value = values;
         option.innerHTML = values;    
         dropdown2.appendChild(option);
      }
      //document.getElementById("ResultsSpan").innerHTML = "::" + rows + "::" + context;
    }