var xmlHttp
var check_for_Window_Status
var id 
function deleteImage(get_id,type,image){
			
			
			var answer = confirm('Are you sure you want to delete Image ?');
			if(!answer)
				return;

		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		alert ("Browser does not support HTTP Request")
		return
		}
		id="DeleteImage";
		var url="../include/ajax.php";
		
		url=url+"?type="+type+"&id="+get_id+"&image="+image;
		
		check_for_Window_Status="image";
		xmlHttp.onreadystatechange=stateChanged
		
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
	
function adduser(type){
		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		alert ("Browser does not support HTTP Request")
		return
		}
		id="adduser";
		var url="include/ajax.php";
		
		url=url+"?type="+type;
		//alert(url);
		check_for_Window_Status="image";
		xmlHttp.onreadystatechange=stateChanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)

}	
   function showdescription(get_id,type){
			
		
			

		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		alert ("Browser does not support HTTP Request")
		return
		}
		id="";
		var url="include/ajax.php";
		
		url=url+"?type="+type+"&id="+get_id;
		
		xmlHttp.onreadystatechange=stateChanged
		
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
    function stateChanged()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
			
						var response = xmlHttp.responseText;
		
						if(id=="DeleteImage"){	
							document.getElementById("image_id").style.display='none';
						}if(id=="adduser"){	
							//alert(response);
						}else{
							document.getElementById("desc").innerHTML=response;
						}
		}
   }
   
   function view_image(http_url){
				
				win = window.open(http_url,'win','height=400,width=400,scrollbars=1,resizable=1,help=0');
				win.focus();
	}
	
    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;
    }
