
    function alertRequest(q) { alert(document.searchreview.q.value); }

    function createRequestObject() { 

       var req; 
    
       if(window.XMLHttpRequest){ 
          // Firefox, Safari, Opera... 
          req = new XMLHttpRequest(); 
       } else if(window.ActiveXObject) { 
          // Internet Explorer 5+ 
          req = new ActiveXObject("Microsoft.XMLHTTP"); 
       } else { 
          // There is an error creating the object, 
          // just as an old browser is being used.
          alert('Problem creating the XMLHttpRequest object'); 
       } 
    
       return req; 
    
    } 
    
    // Make the XMLHttpRequest object 
    var http = createRequestObject(); 
    
    function sendRequest(q)
     { 
       if (q.length == 0)
          return;

       http.open('get', 'http://www.yosims.com/includes/search.php?q='+q);
       http.onreadystatechange = handleResponse; 
       http.send(null); 
       // for Firefox
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             document.getElementById("searchResults").innerHTML = response;
          }

       }
    }
    
function handleResponse()
 {
       if(http.readyState == 4 && http.status == 200){
    
          // Text returned FROM the PHP script 
          var response = http.responseText; 
    
          if(response) { 
             // UPDATE ajaxTest content 
             document.getElementById("searchResults").innerHTML = response; 
          } 
    
       }
     }

     
  function nameRequest(q)
      {
       if (q.length == 0)
          return;
      
       http.open('get', 'http://www.yosims.com/includes/namesearch.php?q='+q);
       http.onreadystatechange = function (nevent) {
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("nameResults").innerHTML = response;
          }
        }
      }
       http.send(null);
       // for Firefox
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("nameResults").innerHTML = response;
          }

       }
    }
    
  function gridRequest( q, w)
      {
      if (q.length == 0)
          return;
      
       http.open('get', 'http://www.yosims.com/includes/gridsearch.php?q='+q+'&w='+w);
       http.onreadystatechange = function (nevent) {
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("gridResults").innerHTML = response;
          }
        }
      }
       http.send(null);
       // for Firefox
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("gridResults").innerHTML = response;
          }

       }
    }
    
  function subthemeRequest(q,w)
      {
      if (q.length == 0)
          return;

       http.open('get', 'http://www.yosims.com/includes/subthemesearch.php?q='+q+'&w='+w);
       http.onreadystatechange = function (nevent) {
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("subthemeResults").innerHTML = response;
          }
        }
      }
       http.send(null);
       // for Firefox
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("subthemeResults").innerHTML = response;
          }

       }
    }
    
  function sub2Request(q,w)
      {
      if (q.length == 0)
          return;

       http.open('get', 'http://www.yosims.com/includes/sub2search.php?q='+q+'&w='+w);
       http.onreadystatechange = function (nevent) {
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("sub2Results").innerHTML = response;
          }
        }
      }
       http.send(null);
       // for Firefox
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("sub2Results").innerHTML = response;
          }

       }
    }
    
   function themeRequest(q)
      {
      if (q.length == 0)
          return;

       http.open('get', 'http://www.yosims.com/includes/themesearch.php?q='+q);
       http.onreadystatechange = function (nevent) {
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("themeResults").innerHTML = response;
          }
        }
      }
       http.send(null);
       // for Firefox
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if(response) {
             // UPDATE ajaxTest content
             window.document.getElementById("themeResults").innerHTML = response;
          }

       }
    }

 function newgridRequest(q, w)
      {
      if (q.length == 0)
          return;
    
       http.open('get', 'http://www.yosims.com/gridadd.php?gridname='+q+'&worldid='+w);
       http.onreadystatechange = function (nevent) {
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if (response) {
             // UPDATE ajaxTest content
            alert(response);

          }
        }
      }
       http.send(null);
       // for Firefox
         if(http.readyState == 4 && http.status == 200){

          // Text returned FROM the PHP script
          var response = http.responseText;

          if (response) {
             // UPDATE ajaxTest content
            alert(response);

          }

       }
    }
   
