function deleteimage(objSpan, deletePath, FieldName, TableName, WCond)
{
	if(!confirm("Confirm to Delete Image"))
		return false;
	url = dealer_url+"deleteimage.php?deletePath="+deletePath+"&FieldName="+FieldName+"&TableName="+TableName+"&WCond="+WCond;
	//alert(url);return false;
	xmlhttp = new myXMLHttpRequest();
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState == 4) 
		{	
	    	if (xmlhttp.responseText.indexOf('invalid') == -1) 
			{
				if(xmlhttp.responseText == 1)
				{
					alert("Image deleted successfully");
					document.getElementById(objSpan).style.display = 'none';
					return false;
				}
				else
				{
					alert("Image deleted successfully");
					document.getElementById(objSpan).style.display = 'none';
					return false;
				}
			}
		}
	}
   	xmlhttp.send(null);

}	
function myXMLHttpRequest() 
{
	  var xmlhttplocal;
	  try {
    		//xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
			xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
	   } 
	   catch (e) 
	   {
			try 
			{
				xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
			} 
			catch (E) 
			{
			    xmlhttplocal=false;
			}
		}

		if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') 
		{
			try 
			{
				var xmlhttplocal = new XMLHttpRequest();
			} 
			catch (e) 
			{
				var xmlhttplocal=false;
				alert('couldn\'t create xmlhttp object');
			}
		}
	return(xmlhttplocal);
}