  var xml;
  
var max, min, hyper, mystates

index = 0 
max = 10  // Modify this TO maximun number of Results Return from QUERY

	
	
    function LoadCache(page, container) {
  
	if(document.forms["mainSearch"].sBrands[document.forms["mainSearch"].sBrands.selectedIndex].index==0) {
           

            state = document.forms["mainSearch"].elements["searchTerms"].value // change Form index (if different)
           

           
				if(window.XMLHttpRequest) { // Mozilla (Firefox, Netscape)
					xml = new XMLHttpRequest();
				} else if(window.ActiveXObject) {  // IE          
					xml = new ActiveXObject("Microsoft.XMLHTTP")
					
				} else {
					return
				}
		
            xml.onreadystatechange = function() {process(container);}
            url = page+"?rnd="+Math.random+"&CacheQuery="+state
            xml.open("GET", url, true)
            xml.send(null)
        
	
	
		
            return false;
	}  else { // for index
		document.getElementById(container).innerHTML = ""
	}

        }
		
		
	function process(id) {
	
	        if( (xml.readyState==4) && (xml.status == 200) ) {
		         
			var ioutout = ""
			var x,y
			 var mystates = xml.responseText
			 ioutout = mystates 
				 if(mystates.length > 0) {				 
					
					x = xBrowser(15)
					y = yBrowser(282)

				 	document.getElementById(id).innerHTML = ioutout
					document.getElementById(id).style.left = x
					document.getElementById(id).style.top = y
					document.getElementById(id).style.visibility = "visible"
					//alert(document.getElementById(id).innerHTML)
					
				 	
		         }  else {
					document.getElementById(id).innerHTML = ""
		         }// for  mystates.length

		         
	        }
        }
		
  function xBrowser(x) {

	return x

    }
	
  function yBrowser(y) {

	return y

    }	


/*
function highLight(e, t) {

   var key;
   var found;
  
        found = 0

	key = (window.event)?event.keyCode:e.keyCode;

	//38 is up, 40 is down

	for(i=0; i<=max; i++) {

		if(document.getElementById("a" + i)) {
			document.getElementById("a" + i).bgColor="#FFFFFF"
			found = found + 1
		}
	}



	if(key==40) {
		
	  index = index + 1

		if(document.getElementById("a" + index)) {
			document.getElementById("a" + index).bgColor="#C0C0C0"
			hyper = document.getElementById("h" + index).innerHTML
		} else {
			document.getElementById("a" + 1).bgColor="#C0C0C0"
			hyper = document.getElementById("h" + 1).innerHTML
			index = 0
		}
			

	} else if(key==38) {

		
		index = index - 1
		if(document.getElementById("a" + index)) {
			document.getElementById("a" + index).bgColor="#C0C0C0"
			hyper = document.getElementById("h" + index).innerHTML
		} else {
			document.getElementById("a" + found).bgColor="#C0C0C0"
			hyper = document.getElementById("h" + found).innerHTML
			index = found
		}
		

			
	}


	if(key==13) {
		t.value = hyper
		index = 0
	}
	
 }
*/