
// <![CDATA[

// put url in http.open and div id in document.getElementById

// Need to make an object of XMLHttpRequest Type.
function createRequestObject() {
    var ro;
    if (navigator.appName == "Microsoft Internet Explorer") {
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        ro = new XMLHttpRequest();
    }
    return ro;
}
var http = createRequestObject();

// Function that calls the PHP script:
function sendRequest(qc) {
	// Call the script.
	// Use the GET method.
	// Pass the data in the URL.
    http.open('get', 'galleryAjax.php?' + qc ); 
    http.onreadystatechange = handleResponse; 
    http.send(null);
}

// Function handles the response from the PHP script.
function handleResponse() {
	// If everything's okay:
    if(http.readyState == 4){
    	// Assign the returned value to the document object.
        var arr = http.responseText.split("||");
        document.getElementById('lpic').innerHTML = arr[0];
        document.getElementById('descText').innerHTML = arr[1];
      //  document.getElementById('lpic').innerHTML = http.responseText;
    }
}

// ]]>

