var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
} 

function replace(thisPage) {
  http.open("GET", "/includes/gallery-img.asp?imageid="+thisPage, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('lightbox').innerHTML = http.responseText;
    }
  }
  http.send(null);
}

function ajaxpage(thisPage,elid) {
  http.open("GET", thisPage, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById(elid).innerHTML = http.responseText;
    }
  }
  http.send(null);
}