var xmlHttp;

function createXMLHttpRequest() {
  if(window.ActiveXObject) {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } else if(window.XMLHttpRequest) {
    xmlHttp = new XMLHttpRequest();
  }
}

function getProductImage(params) {
  createXMLHttpRequest();
  
  var query = "inside-gal-product.php?";
  query = query + params;
  xmlHttp.onreadystatechange = setProductImage;
  xmlHttp.open("GET", query, true);
  xmlHttp.send(null);
}

function setProductImage() {
  if(xmlHttp.readyState == 4) {
    if(xmlHttp.status == 200) {
      document.getElementById("ax-product-image").innerHTML = xmlHttp.responseText;
    } else {
      //document.getElementById("ax-product-image").innerHTML = xmlHttp.status;
    }
  }
}


function getProductUseImage(params) {
  createXMLHttpRequest();
  
  var query = "inside-gal-productuse.php?";
  query = query + params;
  xmlHttp.onreadystatechange = setProductUseImage;
  xmlHttp.open("GET", query, true);
  xmlHttp.send(null);
}

function setProductUseImage() {
  if(xmlHttp.readyState == 4) {
    if(xmlHttp.status == 200) {
      document.getElementById("ax-product-use-image").innerHTML = xmlHttp.responseText;
    } else {
      //document.getElementById("ax-product-image").innerHTML = xmlHttp.status;
    }
  }
}


function getRealizationImage(params) {
  createXMLHttpRequest();
  
  var query = "inside-gal-realization.php?";
  query = query + params;
  xmlHttp.onreadystatechange = setRealizationImage;
  xmlHttp.open("GET", query, true);
  xmlHttp.send(null);
}

function setRealizationImage() {
  if(xmlHttp.readyState == 4) {
    if(xmlHttp.status == 200) {
      document.getElementById("divframe").innerHTML = xmlHttp.responseText;
    } else {
      //document.getElementById("ax-product-image").innerHTML = xmlHttp.status;
    }
  }
}

function ListChangePage(params) {
  createXMLHttpRequest();
  
  var query = "inside-gal-list.php?";
  query = query + params;
  xmlHttp.onreadystatechange = setList;
  xmlHttp.open("GET", query, true);
  xmlHttp.send(null);
}

function setList() {
  if(xmlHttp.readyState == 4) {
    if(xmlHttp.status == 200) {
      document.getElementById("gallerysmallpic").innerHTML = xmlHttp.responseText;
    } else {
      //document.getElementById("ax-product-image").innerHTML = xmlHttp.status;
    }
  }
}

function getProductListImage(params) {
  createXMLHttpRequest();
  
  var query = "inside-gal-productlist.php?";
  query = query + params;
  xmlHttp.onreadystatechange = setProductListImage;
  xmlHttp.open("GET", query, true);
  xmlHttp.send(null);
}

function setProductListImage() {
  if(xmlHttp.readyState == 4) {
    if(xmlHttp.status == 200) {
      document.getElementById("divframe").innerHTML = xmlHttp.responseText;
    } else {
      //document.getElementById("ax-product-image").innerHTML = xmlHttp.status;
    }
  }
}
