function changeImage(path, prefix) {

  var xmlHttp = getXmlHttpObject();

  xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4) {
      var imgURL = xmlHttp.responseText;
      var imgURLOrig = imgURL.replace(prefix, "");

      var pObj = document.getElementById("photoimage");
      pObj.setAttribute('src', imgURL);
      pObj.setAttribute('width', 170);

      var pLinkObj = document.getElementById("photolink");
      pLinkObj.setAttribute('href', imgURLOrig);
    }
  }

  xmlHttp.open("GET", "/wp-content/plugins/wp-randomimage/getrandomimage.php?path="+path+"&prefix="+prefix, true);
  xmlHttp.send(null);

}
