﻿// JavaScript Document - TB Scripts
 
		    function PostSearch(e) 
		    {
		        var characterCode		        
		
		        if(e && e.which)
		        {
		            e = e
		            characterCode = e.which //NN4's which property
		        }
		        else
		        {
		            e = event
		            characterCode = e.keyCode //IE's keyCode property
		        }
		
		        if(characterCode == 13)
		        {
		          if(searchtext.value!="")
		          {                    
		            self.open("SearchDescription.aspx?text=" + searchtext.value, "_self");              
		          }   
		        }              
		    }	
		    
		  function PostSearchFromGo(e) 
		    {
		        var characterCode
		        		
		        if(e && e.which)
		        {
		            e = e
		            characterCode = e.which //NN4's which property
		        }
		        else
		        {
		            e = event
		            characterCode = e.keyCode //IE's keyCode property
		        }
				                         
		          if(searchtext.value!="")
		          {                    
		            self.open("SearchDescription.aspx?text=" + searchtext.value, "_self");              
		          }
		      }

		  function pageLoad() 
	      {
	          //addAutoPostBack();
	          
            //coll=Request.Headers  // Load Header collection into NameValueCollection object.
            //arr1 = coll.AllKeys   // Put names of all keys into a string array.
            //for(var i=0; i < arr1.Length; i++){
            //  Response.Write("Key: " + arr1[i] + "<br>")
            //  arr2 = coll.GetValues(i) // Get all values under this key.
            //  for(var j=0; j < arr2.Length; j++){
            //      Response.Write("Value " + j + ": " + Server.HtmlEncode(arr2[j]) + "<br>")
            //  }
            //}

	      }
	      
	      function addAutoPostBack() {
	      //check for old viewstate and sets dropdowns if previously selected
	          if ($get("ddlMake").options.length > 0) {
	              $get("ddlMake").setAttribute(
            "onchange",
            "javascript:setTimeout('__doPostBack(\\'ddlMake\\',\\'\\')', 0)");
	          }
	          else {
	              setTimeout("addAutoPostBack()", 500);
	          }

	          if ($get("ddlModel").options.length > 0) {
	              $get("ddlModel").setAttribute(
            "onchange",
            "javascript:setTimeout('__doPostBack(\\'ddlModel\\',\\'\\')', 0)");
	          }
	          else {
	              setTimeout("addAutoPostBack()", 500);
	          }
	      }	   
	      
    
        function js_PopWin(url,name,options)
        // for larger image popup
        {
          var ContextWindow = window.open(url,name,options);
          ContextWindow.focus();
          return false;
        }
    
  


