var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
} 

function replace(q,s,x) {
  http.open("GET", "getStuff.php?q="+q+"&s="+s+"&x="+x, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('foo').innerHTML = http.responseText;
	  var str = q.toUpperCase();
      document.getElementById('bar').innerHTML = str.replace(/_STOEGERAIR|_STOEGER|_BENELLI|_FRANCHI|_UBERTI/, " ");
    }
  }
  http.send(null);
}

function replace_a(q,s,x) {
  http.open("GET", "getStuff_a.php?q="+q+"&s="+s+"&x="+x, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('foo').innerHTML = http.responseText;
	  var str = q.toUpperCase();
      document.getElementById('bar').innerHTML = str.replace(/_STOEGERAIR/, " ");
    }
  }
  http.send(null);
}

function replace_b(q,s,x) {
  http.open("GET", "getStuff_b.php?q="+q+"&s="+s+"&x="+x, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('foo').innerHTML = http.responseText;
	  var str = q.toUpperCase();
      document.getElementById('bar').innerHTML = str.replace(/_BENELLI/, " ");
    }
  }
  http.send(null);
}

function replace_f(q,s,x) {
  http.open("GET", "getStuff_f.php?q="+q+"&s="+s+"&x="+x, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('foo').innerHTML = http.responseText;
	  var str = q.toUpperCase();
      document.getElementById('bar').innerHTML = str.replace(/_FRANCHI/, " ");
    }
  }
  http.send(null);
}

function replace_u(q,s,x) {
  http.open("GET", "getStuff_u.php?q="+q+"&s="+s+"&x="+x, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('foo').innerHTML = http.responseText;
	  var str = q.toUpperCase();
      document.getElementById('bar').innerHTML = str.replace(/_UBERTI/, " ");
    }
  }
  http.send(null);
}

function replace_s(q,s,x) {
  http.open("GET", "getStuff_s.php?q="+q+"&s="+s+"&x="+x, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('foo').innerHTML = http.responseText;
	  var str = q.toUpperCase();
      document.getElementById('bar').innerHTML = str.replace(/_STOEGER/, " ");
    }
  }
  http.send(null);
}
