// global variables to keep track of the request
// and the function to call when done
var ajaxreq=false, ajaxCallback;
// ajaxRequest: Sets up a request
function ajaxRequest(filename) {
  try {
	  // Firefox / IE 7/ Others
		ajaxreq = new XMLHttpRequest();
	} catch (error) {
	  try {
	    // IE 5 and 6
		  ajaxreq = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (error) {
	    return false;
	  }
  }
	ajaxreq.open("GET", filename, true);
	ajaxreq.onreadystatechange = ajaxResponse;
	ajaxreq.send(null);
}


// ajaxResponse: Waits for response and calls a function
function ajaxResponse() {
  if (ajaxreq.readyState !=4) return;
	if (ajaxreq.status==200) {
	  // If the request succeeded
		if (ajaxCallback) ajaxCallback();
	} //else alert ("Request Failed: " + ajaxreq.statusText);
	return true;
}
function ajaxPostRequest(url,str) {
  try {
	  // Firefox / IE 7/ Others
		ajaxreq = new XMLHttpRequest();
	} catch (error) {
	  try {
	    // IE 5 and 6
		  ajaxreq = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (error) {
	    return false;
	  }
  }
	ajaxreq.open("POST", url, true);
	ajaxreq.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	ajaxreq.onreadystatechange = ajaxResponse;
  ajaxreq.send(str);
}


function loadXMLDoc()
{
//make links visible only when page loads
document.getElementById('bottomlinks').style.visibility="visible";
	
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  //if (xmlhttp.readyState==4 && xmlhttp.status==200)
  //  {
   // document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
  //  }
  }
xmlhttp.open("POST","getimagesajax.php",true);
xmlhttp.send();
}



