// ######## User management functions AJAX/ActiveX XML-access library ##########
// # Coded by: David Altenschmidt
// # Version: 1.0.0 Beta1
// # Info: 
// # This script gets the variables for the forms and buttons using AJAX from an
// # external PHP-handler that outputs an XML file
// #############################################################################


function getnews(id)
  {
  xmlHttp=null;
  try
    {
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX/ActiveX, change it in your settings or update it!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
	    if(xmlHttp.responseText!="false"){
	    document.getElementById("newstext_"+id).innerHTML=xmlHttp.responseText;
	    return true;
	    }else{
	    return false;
	    }
        }
      }
    xmlHttp.open("GET","newsmodule_ajax.php?mode=all&id="+id,true);
    xmlHttp.send(null);
  }


function hidenews(id)
  {
  xmlHttp=null;
  try
    {
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX/ActiveX, change it in your settings or update it!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
	    if(xmlHttp.responseText!="false"){
	    document.getElementById("newstext_"+id).innerHTML=xmlHttp.responseText;
	    return true;
	    }else{
	    return false;
	    }
        }
      }
    xmlHttp.open("GET","newsmodule_ajax.php?mode=preview&id="+id,true);
    xmlHttp.send(null);
  }
