// Globale Variable zur Haltung des HTTP Object
var g_xmlHttp;

// Globale Variable zur Haltung des Elements
var g_xmlHttpElementId;


function getXmlHttpStateChanged() 
{ 
  if (g_xmlHttp.readyState==4 || g_xmlHttp.readyState=="complete")
  { 
    document.getElementById(g_xmlHttpElementId).innerHTML = g_xmlHttp.responseText; 
  } 
}

function getXmlHttpObject()
{
  try
  {
    // Firefox, Opera 8.0+, Safari
    g_xmlHttp=new XMLHttpRequest();
  }
  catch (e)
  {
    // Internet Explorer
    try
    {
      g_xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
      g_xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return g_xmlHttp;
}

function showImage(imgageName, elementId, imgCSSClass, imgAltTxt)
{
	var xmlHttp=null;
	var url="";
	
	xmlHttp=getXmlHttpObject();

  g_xmlHttpElementId  = elementId;
  xmlHttp.onreadystatechange = getXmlHttpStateChanged;
  
  url="ajaxGetImage.php?imgname="+imgageName+"&imgcssclass="+imgCSSClass+"&imgalttxt="+imgAltTxt;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);

}

