//Das ist die Funktion die das HTTPRequestObject erzeugt.

var resObject=null;

function getRequestObject()
{
var resObject=null;

try
{
 resObject = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(Error)
{
  try
   {
    resObject = new ActiveXObject("MSXML2.XMLHTTP"); 
   }
  catch(Error)
   {
    try
     {
      resObject = new XMLHttpRequest();
     }
    catch(Error)
     {
      alert("Konnte Requestobjekt nicht erstellen");
     }
   }
}

return resObject;

}


function getRightContent(ContentKey)
{
 resObject2.open("get","../php/right/content.php?contentkey="+ContentKey,true);
 resObject2.onreadystatechange=handleRightContent;
 resObject2.send(null);
}

function getHeadline(ContentKey)
{
 resObject3.open("get","../php/head/content.php?contentkey="+ContentKey,true);
 resObject3.onreadystatechange=handleHeadline;
 resObject3.send(null);
}


function getBackground(ContentKey)
{
 resObject4.open("get","../php/back/content.php?contentkey="+ContentKey,true);
 resObject4.onreadystatechange=handleBackground;
 resObject4.send(null);
}



function sndReq(ContentKey)
{
 //getRightContent(ContentKey);
 //getHeadline(ContentKey);
 //getBackground(ContentKey); 
 resObject.open("get","../php/content.php?contentkey="+ContentKey,true);
 resObject.onreadystatechange=handleContent;
 resObject.send(null);
}


function handleContent()
{
if(resObject.readyState==4)
 {
  document.getElementById("inhalt").innerHTML=resObject.responseText; 
 }
}


function handleRightContent()
{
if(resObject2.readyState==4)
 {
  document.getElementById("inhaltrechts").innerHTML=resObject2.responseText; 
 }
}


function handleHeadline()
{
if(resObject3.readyState==4)
 {
  document.getElementById("ueberschrift").innerHTML=resObject3.responseText; 
 }
}



function handleBackground()
{
if(resObject4.readyState==4)
 { 
  document.getElementById("hintergrund").className=resObject4.responseText;
 }
}



resObject=getRequestObject();
resObject2=getRequestObject();
resObject3=getRequestObject();
resObject4=getRequestObject();