/*************************
XMLTTHPRequest METHODS 
*************************/


var url = "imageInformation.php?param="; // The server-side script
function handleHttpResponse() {
  if (http.readyState == 4) {
 // alert(http.responseText);
    if (http.responseText.indexOf('invalid') == -1) {
      // Split the comma delimited response into an array
	  
      results = http.responseText.split("|");
	  var title = results[0];
	  var description = results[1];
	  var available = results[2]; // == 1 ? "Yes" : "No";
	  var price = results[3];
	  var result = 	  	"<span class='highlight'>Title:</span> <p>" + title + "</p>" +
	  					"<span class='highlight'>Description:</span> <p>" + description + "</p>" +
	  					"<span class='highlight'>Availability:</span> <p>"+ available + "</p>";
		/*			
		if(price != 0){
			result += "<span class='highlight'>Price:</span> <p>&#36;"+ price + "</p>";
		}
		*/
	  document.getElementById("lightboxDetail").innerHTML = result;

	 // document.write(results);
     // document.getElementById('city').value = results[0];
      //document.getElementById('state').value = results[1];
      isWorking = false;
    }
  }
}
var isWorking = false;
function sendRequest(id) {
  if (!isWorking && http) {
    //var zipValue = document.getElementById("zip").value;
    http.open("GET", url + id, true);
    http.onreadystatechange = handleHttpResponse;
    isWorking = true;
    http.send(null);
  }
}
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object

/*************************************
END AJAX METHODS 
*/////////////////////////////////////


