function GetXmlHttpObject(handler)
{
  var objXMLHttp=null
  if (window.XMLHttpRequest)
  {
      objXMLHttp=new XMLHttpRequest()
  }
  else if (window.ActiveXObject)
  {
      objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
  return objXMLHttp
}

function stateChanged1()
{                   
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {    
          document.getElementById("txtResult").innerHTML=xmlHttp.responseText
		  //alert(xmlHttp.responseText);
			//alert("Uploads Pagination Ajax");
		  //document.getElementById("txtResult").style.display="inline";
  }
  else {
          //alert(xmlHttp.status);
  }
}

function stateChanged2()
{                   
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  {    
  		  document.getElementById("txtResult").innerHTML=xmlHttp.responseText;	
          //document.getElementById("txtResult").innerHTML="Member added successfully <span class=disp style='cursor:pointer' onclick='window.location.reload()' ><font color=#006699 >Click here </font></span> to go back"
	      //window.location.reload();
  }
  else {
          //alert(xmlHttp.status);
  }
}

function htmlData(url, qStr)
{
	//alert("htmlDataUploads called");
  if (url.length==0)
  {
      document.getElementById("txtResult").innerHTML="";
	alert("txtResult is Null");  
      return;
  }
  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null)
  {
      alert ("Browser does not support HTTP Request");
      return;
  }

  url=url+"?"+qStr;
  url=url+"&sid="+Math.random();
  xmlHttp.onreadystatechange=stateChanged1;
  //alert(url);	
  xmlHttp.open("GET",url,true) ;
  xmlHttp.send(null);
}

function addMembers(url, qStr)
{
	//alert("add users called");
  if (url.length==0)
  {
      document.getElementById("txtResult").innerHTML="";
	alert("txtResult is Null");  
      return;
  }
  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null)
  {
      alert ("Browser does not support HTTP Request");
      return;
  }

  url=url+"?"+qStr;
  url=url+"&sid="+Math.random();
  xmlHttp.onreadystatechange=stateChanged1;
  //alert(url);	
  xmlHttp.open("GET",url,true) ;
  xmlHttp.send(null);
}

function registerMember(url, qStr)
{
	//alert("registerMember called"+"*"+url+"*"+qStr);
  if (url.length==0)
  {
      document.getElementById("txtResult").innerHTML="";
	alert("txtResult is Null");  
      return;
  }
  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null)
  {
      alert ("Browser does not support HTTP Request");
      return;
  }

  url=url+"?"+qStr;
  url=url+"&sid="+Math.random();
  xmlHttp.onreadystatechange=stateChanged2;
  //alert(url);	
  xmlHttp.open("GET",url,true) ;
  xmlHttp.send(null);
}
