var httpReqGallery

function createXMLHttpRequestGallery () {
	if (window.ActiveXObject) { httpReqGallery = new ActiveXObject ("Microsoft.XMLHTTP"); }
	else if (window.XMLHttpRequest) { httpReqGallery = new XMLHttpRequest (); }
}

function retrieveRandomPics () {
    createXMLHttpRequestGallery ();
	httpReqGallery.onreadystatechange = handleSubmissionStateGallery;
    var command = "./gallery/random_gallery.php";
    httpReqGallery.open ("GET", command, true);
    httpReqGallery.send (command);
}
function handleSubmissionStateGallery () {
	if (httpReqGallery.readyState == 4) {
		if (httpReqGallery.status == 200) {
			document.getElementById ('randomgallery').innerHTML = httpReqGallery.responseText;
		}
		else { document.getElementById ('randomgallery').innerHTML = httpReqGallery.responseText; }
	}
}

