function ajax_fun(printid,filename,imgid)
{
//alert('sachin');	
	if (filename)
	{  var url = filename ;
		//{  var url =   qs ;
		// alert(url);
		if (window.ActiveXObject) httpRequestobj = new ActiveXObject("Microsoft.XMLHTTP");
		else httpRequestobj = new XMLHttpRequest();
		document.getElementById(printid).innerHTML="Processing ....  " +  "<br><img src='images/wait.gif' >";
		httpRequestobj.open("GET", url, true);
		httpRequestobj.onreadystatechange= function () {processRequest1(printid,filename,imgid); } ;
		httpRequestobj.send(null);
	}
	else alert("Error in processing ");
	}


	function processRequest1(printid,filename,imgid)
	{
		if (httpRequestobj.readyState == 4)     {

			if(httpRequestobj.status==200){

				document.getElementById(imgid).innerHTML="<img src=\"images/treenode_expand_minus.gif\"  onclick=\"reset('"+ printid +"','" + filename + "','" + imgid + "' );\"  >";
                                //document.getElementById(printid).innerHTML=httpRequestobj.responseText;
                               //close(printid,10);
				document.getElementById(printid).innerHTML=httpRequestobj.responseText;
			}
			else  {   alert("Error loading page\n"+ httpRequestobj.status +":"+ httpRequestobj.statusText);}
		}
	}
function reset(printid,filename,imgid)
   {
       document.getElementById(imgid).innerHTML="<img src=\"images/treenode_expand_plus.gif\"  onclick=\"ajax_fun('"+ printid + "','" + filename + "','" + imgid + "');\"  >";
document.getElementById(printid ).innerHTML="";
   }



