      function addScript(sPage)
       {
        var obj=new JSONscriptRequest('http://www.cdsonline.com.au/lancedixon/webroot/JSON' + sPage + '&a=b');
        obj.buildScriptTag(); // Build the script tag
        obj.addScriptTag(); // Execute (add) the script tag
      }

      function fill(data, sel)
      {
        var text='';
        var newEl = document.getElementById(sel);

        if(data==null)
          alert('error');
        else
        {
        // Clear Drop Down
        for (i=newEl.options.length-1; i>=0; i--) {
			if(newEl.options[i].value!=''){
				newEl.options[i] = null;
			}
		}
		// Populate Drop Down
        for (i=0;i<data.values.length;i++) {
                  oOption = document.createElement('option');
      	          sVal = data.values[i].txt;
      	          sValCount = data.values[i].cnt
      	          if (document.implementation && document.implementation.createDocument)
      	          {
      	          	oOption.text = sVal + " " + sValCount;
                  	}else
                   	{
                    		oOption.innerText = sVal + " " + sValCount;
                  }
                  oOption.value = sVal;
                  newEl.appendChild(oOption);
          }
         }

      }
      /*** Default.asp ***/
      function selMakeChange() {
		addScript('Model.asp?make=' + document.getElementById('selMake').value);
		addScript('YearAsc.asp?make=' + document.getElementById('selMake').value);
		addScript('YearDesc.asp?make=' + document.getElementById('selMake').value);
      }
      
      function selModelChange() {
		addScript('YearAsc.asp?make=' + document.getElementById('selMake').value + '&model=' + document.getElementById('selModel').value);
		addScript('YearDesc.asp?make=' + document.getElementById('selMake').value + '&model=' + document.getElementById('selModel').value);
      }

      /*** Vehcile_Search.html ***/
      function selChange(sObj) {
        //var sMake = document.getElementByID('selMake').value;
        //var sModel = document.getElementByID('selModel').value;
        //var sType = document.getElementByID('selType');
          if(sObj==''){
            addScript('Make.asp?');
            addScript('Model.asp?');
            addScript('Type.asp?');
          }else if(sObj=='make'){
              addScript('Model.asp?make=' + document.getElementById('selMake').value);
              addScript('Type.asp?make=' + document.getElementById('selMake').value + '&model=' + document.getElementById('selModel').value);
          }else if(sObj=='model'){
              addScript('Type.asp?make=' + document.getElementById('selMake').value + '&model=' + document.getElementById('selModel').value);
          }
             //  addScript('Make.asp?');
              // addScript('Model.asp?make=' + document.getElementByID('selMake').value);
              // addScript('Type.asp?make=' + document.getElementByID('selMake').value + '&model=' + document.getElementByID('selModel').value);
      }
      
      function selMake() {
		addScript('Model.asp?make=' + document.getElementById('selMake').value);
                addScript('Model.asp?make=' + document.getElementById('selMake').value);
                addScript('Type.asp?make=' + document.getElementById('selMake').value + '&model=' + document.getElementById('selModel').value);

      }

      function loadInt() {
         addScript('Make.asp?');
         addScript('Model.asp?');
         addScript('Type.asp?');
      }


function submitMe() {
         document.form1.submit();
}
