    function createRequestObject() {  

       var requestObject;
     
       if(window.XMLHttpRequest){  
          requestObject = new XMLHttpRequest();  
       } else if(window.ActiveXObject) {  
          requestObject = new ActiveXObject("Microsoft.XMLHTTP");  
       } else {  
          alert('Error creating XMLHttpRequest object');  
       }  
     
       return requestObject;  
     
    }  
     
    var http = createRequestObject(); 
    var tabStop = 0;
    var timer; 
    var boxName;
    var cat;
    var cats = new Array("1002","1037","2022","2017","1104","1111","9500","0000","0");
    var response;
    
    function sendRequest(category,area,location) {  
       http.open('post', '/content.jsp?q=home'+category+'&d='+area);
       boxName = location;
       http.onreadystatechange = handleResponse;  
       http.send(null);
       for (i=0; i<8; i++){
        document.getElementById(cats[i]).style.background="#eeeeee";
        document.getElementById(cats[i]).style.borderTop="1px solid #bbbbbb";
        document.getElementById(cats[i]).style.borderBottom="1px solid #bbbbbb";
        document.getElementById(cats[i]).style.borderRight="1px solid #bbbbbb";
        document.getElementById('top'+cats[i]).style.borderBottom="1px solid #ffffff";
       }
       document.getElementById(category).style.background="#ffffff";
       document.getElementById(category).style.borderTop="0px";
       document.getElementById(category).style.borderBottom="1px solid #ffffff";
       document.getElementById(category).style.borderRight="2px solid #bbbbbb";
       document.getElementById('top'+category).style.borderBottom="1px solid #bbbbbb";
    }  
    
    function readyResponse(category,area,location) {
      if (tabStop == 0) {
        if (category == "default") {
          category = cats[(Math.floor(Math.random()*8))];
        }
        http.abort();
        clearTimeout(timer);
        window.timer=setTimeout("sendRequest('"+category+"','"+area+"','"+location+"')", 100);
      }
      if (tabStop == 1) {
        window.timer=setTimeout("sendRequest('"+category+"','"+area+"','"+location+"')", 100);
        document.getElementById('most').innerHTML = "<b>Most Searched:</b>";
        tabStop = 0;
      }
    }

    function handleResponse() {
       if (http.readyState == 4 && http.status == 200){  
          response = http.responseText;  
          if (response) {  
             document.getElementById(boxName).innerHTML = response;
          }  
          
       }
    }
