loading = new Image();
loading.src = 'templates/simple/images/buttons_ru/imageloading.jpg';

var xmlHttp;
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(src) {
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET", '../handler/imageOutput.php?src=' + src, true);
xmlHttp.send(null);
}
function handleStateChange() {
document.getElementById('imageDiv').innerHTML = '<img src="' + loading.src + '">';
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
document.getElementById('imageDiv').innerHTML =  xmlHttp.responseText;
}
}
}
