var xmlHttp = createXmlHttpRequestObject();
var xmlHttp1 = createXmlHttpRequestObject();
function createXmlHttpRequestObject() 
{	
  // will store the reference to the XMLHttpRequest object
  var xmlHttp;
  // if running Internet Explorer
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // if running Mozilla or other browsers
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  if (!xmlHttp)
  alert("Error creating the XMLHttpRequest object.");
  else
  return xmlHttp;
}
function perform_action(str1,str2,str3,str4,str5)
{
//var dep=form.dept.options[form.dept.options.selectedIndex].value;
if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	document.getElementById("delayDiv").style.display = '';
	perform_column(str3);
    xmlHttp.open("GET", "ajax_inner.php?oid="+str1+"&act="+str2+"&cPath="+str3+"&start="+str4+"&del="+str5, true);
    // define the method to handle server responses
    xmlHttp.onreadystatechange = handleSiteResponse;
    // make the server request
    xmlHttp.send(null);		
  }
}
function handleSiteResponse()
{
  if (xmlHttp.readyState == 4)
  {
  if (xmlHttp.status == 200)
    {xmlResponse = xmlHttp.responseText;
	 document.getElementById("innerDive").innerHTML='';
	 document.getElementById("delayDiv").style.display = 'none';
	 document.getElementById("innerDive").innerHTML =xmlHttp.responseText;	 
	 //setTimeout('perform_column(str)', 2000);
    } 
    else
    {
		alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}

function perform_column(str)
{
if (xmlHttp1.readyState == 4 || xmlHttp1.readyState == 0)
  {
   xmlHttp1.open("GET", "column_left_inner.php?cPath="+str, true);
   // define the method to handle server responses
    xmlHttp1.onreadystatechange = handleSiteResponseColumn;
    // make the server request
    xmlHttp1.send(null);
  }
 
}
function handleSiteResponseColumn()
{
  if (xmlHttp1.readyState == 4)
  { 
  if (xmlHttp1.status == 200)
    {xmlResponse = xmlHttp1.responseText;
	 //alert(xmlHttp1.responseText);
	 //alert(document.getElementById("columnDiv").innerHTML);
	 document.getElementById("columnDiv").innerHTML='';
	 document.getElementById("columnDiv").innerHTML =xmlHttp1.responseText;
	 //document.getElementById("columnDiv").innerHTML ='Hello Yasir';
	 //setTimeout('selectuser()', 2000);
    } 
    else 
    {
		alert("There was a problem accessing the server: " + xmlHttp1.statusText);
    }
  }
}