var xmlHttp

function newimg() {
	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null) {
			alert('Giving up :( Cannot create an XMLHTTP instance. Something is borked.');
			return;
	}

	var url="newimg.php?hm=1"
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged() {
	if (xmlHttp.readyState==4) {
		document.getElementById("imageplace").innerHTML=xmlHttp.responseText;
	}
}

function newimg2() {
	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null) {
			alert('Giving up :( Cannot create an XMLHTTP instance. Something is borked.');
			return;
	}

	var url="newimg.php?hm=2"
	xmlHttp.onreadystatechange=stateChanged2;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged2() {
	if (xmlHttp.readyState==4) {
		document.getElementById("imageplace2").innerHTML=xmlHttp.responseText;
	}
}

function newimg3() {
	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null) {
			alert('Giving up :( Cannot create an XMLHTTP instance. Something is borked.');
			return;
	}

	var url="newimg.php?hm=3"
	xmlHttp.onreadystatechange=stateChanged3;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged3() {
	if (xmlHttp.readyState==4) {
		document.getElementById("imageplace3").innerHTML=xmlHttp.responseText;
	}
}

function newimg4() {
	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null) {
			alert('Giving up :( Cannot create an XMLHTTP instance. Something is borked.');
			return;
	}

	var url="newimg.php?hm=4"
	xmlHttp.onreadystatechange=stateChanged4;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged4() {
	if (xmlHttp.readyState==4) {
		document.getElementById("imageplace4").innerHTML=xmlHttp.responseText;
	}
}

function GetXmlHttpObject() {
	var xmlHttp=null;
	try {
		// Firefox, Opera 8.0+, Safari, IE7
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// IE6 and under
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

