basicURL = "http://www.metricksystem.com/2008/";

function getXMLHTTPRequest() {
  try {
  req = new XMLHttpRequest();
  } catch(err1) {
    try {
    req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(err2) {
      try {
      req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch(err3) {
        req = false;
      }
    }
  }
  return req;
}

var http = getXMLHTTPRequest();

function showItem(id) {
  var myurl = basicURL + "showportfolioitem.php";
  myRand = parseInt(Math.random()*999999999);
  var modurl = myurl +  "?id=" + id + "&rand=" + myRand;
  http.open("GET", modurl, true);
  http.onreadystatechange = useHttpResponse;
  http.send(null);
}

function useHttpResponse() {
  if (http.readyState == 4) {
    if (http.status == 200 || http.status == 304) {
      document.getElementById("content").innerHTML = http.responseText;
    }
  } else {
    document.getElementById("content").innerHTML = '<img src="' + basicURL + 'img/bar.gif" alt="">';
  }
}
