function elBID(id){
 return(document.getElementById(id));
}
function defRequest(){
 try{
  var ret = new XMLHttpRequest();
 }catch(e){
  try{
   var ret = new ActiveXObject("Msxml2.XMLHTTP");
  }catch(e){
   try{
    var ret = new ActiveXObject("Microsoft.XMLHTTP");
   }catch(failed){
    var ret = null;
   }
  }
 }
 return(ret);
}
reqMain = defRequest();
reqVar = defRequest();
function loadMain(url,send){
 elBID("mainDiv").innerHTML = '<div style="text-align: center;"><img src="Bilder/ajax-loader.gif" /></div>';
 if(typeof(send) == undefined){
  send = "";
 }
 mainLoaded = false;
 reqMain.open("POST", url, true);
 reqMain.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
 reqMain.onreadystatechange = function(){
  if(reqMain.readyState == 4){
   if(reqMain.status == 200)
    elBID("mainDiv").innerHTML = reqMain.responseText;
   else if(reqMain.status != 0)
    elBID("mainDiv").innerHTML = "Ihr Browser scheint kein AJAX zu unterst&uuml;tzen...<br />Fehler:"+reqMain.status;
  }else
   return(false);
 }
 reqMain.send(send);
}
function showPic(url){
 txt = '<div id="showPic" style="position: absolute; padding: 8px; padding-bottom: 6px; left: 10px; top: 110px; z-index: 9999; background-color: white;">';
 elBID("mainDiv").innerHTML += txt+'<div style="float:right;" onClick="hidePic();"><img style="border: 0 none; cursor: pointer;" src="Bilder/red_cross.png" /></div><img src="'+url+'" /></div>';
 elBID("showPic").style.left = (screen.width/2-400)+"px";
 elBID("ply").style.visibility = "hidden";
 elBID("hider").style.visibility = "visible";
}
function hidePic(){
 elBID("showPic").parentNode.removeChild(elBID("showPic"));
 elBID("ply").style.visibility = "visible";
 elBID("hider").style.visibility = "hidden";
}
