function DeleteImg(img,id) {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url="deleteimg.php?id="+id+"&img="+img;
	url=url+"&n="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


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

function stateChanged() {
	if (xmlHttp.readyState==4) { 
		// document.getElementById("Cost").innerHTML=xmlHttp.responseText;
		if (xmlHttp.responseText.indexOf('invalid') == -1) {
			// Use the XML DOM to unpack the city and state data 
			var xmlDocument = xmlHttp.responseXML;
			var Img1 = xmlDocument.getElementsByTagName('Img1').item(0).firstChild.data;
			var Img2 = xmlDocument.getElementsByTagName('Img2').item(0).firstChild.data;
			var Img3 = xmlDocument.getElementsByTagName('Img3').item(0).firstChild.data;
			var Img4 = xmlDocument.getElementsByTagName('Img4').item(0).firstChild.data;
			document.getElementById('Img1').innerHTML = Img1;
			document.getElementById('Img2').innerHTML = Img2;
			document.getElementById('Img3').innerHTML = Img3;
			document.getElementById('Img4').innerHTML = Img4;
		}
	}
}


// The following should be put in your external js file,
// with the rest of your ondomready actions.

window.addEvent('domready', function(){

	$$('input.DatePicker').each( function(el){
		new DatePicker(el);
	});

});

