      google.load('search', '1');
      

      function inputFocus() {
        document.getElementById('query-input').style['background'] = '';
      }
 
      function inputBlur() {
        var queryInput = document.getElementById('query-input');
        if (!queryInput.value) {
          queryInput.style['background'] =
              'white url(http://www.google.com/coop/images/'
              + 'google_custom_search_watermark.gif) no-repeat 0% 50%';
        }
      }
 
      function init() {
        google.search.CustomSearchControl.attachAutoCompletion(
            '0003819612672581674799:k7tyj_5xcf8',
            document.getElementById('query-input'),
            'two-page-form');
        inputBlur();
      }
      
 
      function submitQuery() {
      
	  var inputTerm = trim((document.getElementById('query-input').value));
        //window.location = 'http://gtstelephone.com/search_results.html?q='
            //+ encodeURIComponent(inputTerm);
                
                products(inputTerm);
				
        return false;
      }
      
function trim(str) {
        return str.replace(/^\s+|\s+$/g,"");
    }
      
            function products(inputTerm) {

var str="DTL-2E-1,DTL-6DE-1,DTL-8LD-1,DTL-12D-1,DTL-12BT-1,DTL-12PA-1,DTL-24D-1,DTL-32D-1,DTERM CORDLESS,DSX-40,DSX-60,DSX-80,DSX-22,DSX-34,DSX,DTH-32D-2,DTH-32D-1,DTH-16D-2,DTH-16D-1,DTH-8D-2,DTH-8D-1,DTH-8-2,DTH-8-1,DTH-4R-1,DCR-60-1,DTR-32D-1,DTR-16D-1,DTR-8D-1,DTR-8-1,DTR-4R-2,DTR-4R-1,ASPIRE 512,ASPIRE 110DSS,ASPIRE 64,ASPIRE 34,ASPIRE 32,ASPIRE 22,ASPIRE 16,ASPIRE 8,8-CO-IS-TRUNK-CARD,8-SLOT-KSU,4-CO-IS-TRUNK-CARD,DMS 4,ASPIRE 4,VOICEMAIL-4,PRI/T1,DTP-32D-1,DTP-16D-1,DTP-8D-1,DTP-8-1,DTP-2DT-1,DTU-32D-1,DTU-32-1,DTU-16D-2,DTU-16D-1,DTU-16-1,DTU-8D-2,DTU-8-1,ADAU,ETJ-24DS-2,ETJ-24DA-1,ETJ-16DD-2,ETJ-16DC-2,ETJ-16DC-1,ETJ-8-2,ETJ-8IS-2,ETE-16K-1,ETE-16D-2,ETE-16-2,ETE-6D-2,ETE-6-2,HFU-E,ETW-24DS-1,ETW-16DC-1,ETW-16DD-1,ETW-8-1,ETW-4R,ETZ-16D-1,ETZ-16-1,ET-16-4,ET-16-3,ET-16-1,ET-6-1,ETT-16-1, ETT-8-1,ETT-4-1,HFU-TA,88673,88671,88670,88663,88661,88660,88650,ITR-32D-3,ITR-16D-3,ITH-16D-3,ITR-8D-3,ITH-8D-3,ITR-4D-3,ITH-4D-3,AC-2R,92755,92555,92783,92773,92673,92670,92763,92760,92663,92756,92753,92750,92573,92570,92000A,92021,92040,92011,92005,92060,EX-CPRU,80673,80663,80556,80573,80570,88363,88361,88360,88263,88261,88260,DTL,DSX,DTH,DCR,DTR,ASPIRE,DTP,DTU,ETE,ETW,ETZ,ET,ETT,NITSUKO,ITR,ITH";
var productArray = new Array() 
productArray = str.split(',');
//document.writeln('Array Length: '+productArray.length);

var searchTerm = (inputTerm);

//var searchTerm = /DTERM/i;
var searchResult =(str.search(searchTerm.toUpperCase()));

//document.writeln('<h1> '+searchResult + '</h1>');

//document.writeln


 //window.location = 'search_results.html?q='
  //          + encodeURIComponent(inputTerm);

for (i=0;i<productArray.length;i++)
{
//document.write(productArray[i] + "<br >");
}
msg = "Found at position " + searchResult + "\n\nterm: " + searchTerm;
if (searchResult != "-1") 

  {
  //alert(msg);
   window.location = '../products/Telephones.html#'
            + encodeURIComponent(inputTerm);
  }
else 
{
 window.location = 'http://gtstelephone.com/search_results.html?q='
           + encodeURIComponent(inputTerm);
}
}
 
  
      google.setOnLoadCallback(init);

