function showEventDetail(link,id)
{
   link.href = "javascript:void(0);";
   
   document.getElementById("PopupDialogContent").innerHTML = "<strong style='text-align:center;'>Bitte warten...</strong>";
   
   AjaxGetEventDetail(id);
      
   document.getElementById("PopupDialog").style.left = "50%";
   document.getElementById("PopupDialog").style.marginLeft ="-325px";
   PopupDialogOpen();
}

function AjaxGetEventDetail(id)//läd ein Element mit der ID vom Server
{
   //alert(anzahl);
   //AjaxStartWait()
   var req = null;
   try{req = new XMLHttpRequest();}
   catch(ms)
      {try{req = new ActiveXObject("Msxml2.XMLHTTP");}   
      catch (nonms)
         {try{req = new ActiveXObject("Microsoft.XMLHTTP");} 
         catch (failed){req = null;}
      }  
   }
   if (req == null)alert("Fehler beim Laden!");
   
   req.open("GET", '/ajax.php?action=getEventDetail&id='+id, true);
   req.onreadystatechange = function()
   {            
      switch(req.readyState) 
      {
         case 4:
         if(req.status!=200)
            alert("Fehler:"+req.status); 
         else
         {   
            try{req.responseXML.normalize();}catch(e){}
            var xml = req.responseXML;
            var temp = "";
            temp += "<div style='float:right;padding-left:20px;'>"+xml.getElementsByTagName("kalender")[0].firstChild.nodeValue;
            temp += "</div>";
            temp += "<h3>"+xml.getElementsByTagName("name")[0].firstChild.nodeValue+"</h3>"
            temp += "<p><strong class='datum'>"+xml.getElementsByTagName("datum")[0].firstChild.nodeValue+"</strong></p>"
            if(xml.getElementsByTagName("text")[0])temp += "<p>"+xml.getElementsByTagName("text")[0].firstChild.nodeValue+"</p>"
                                                              //+"<p>"+xml.getElementsByTagName("cat")[0].firstChild.nodeValue+"</p>"
                                                              //+"<p>"+xml.getElementsByTagName("loc")[0].firstChild.nodeValue+"</p>"
            if(xml.getElementsByTagName("moreinfo")[0])temp += "<p>"+xml.getElementsByTagName("moreinfo")[0].firstChild.nodeValue+"</p>"
            if(xml.getElementsByTagName("href")[0])temp += "<p>"+xml.getElementsByTagName("href")[0].firstChild.nodeValue+"</p>"
            if(xml.getElementsByTagName("autor")[0])temp += "<p>"+xml.getElementsByTagName("autor")[0].firstChild.nodeValue+"</p>"                                                              
            temp += "<p>"+xml.getElementsByTagName("export")[0].firstChild.nodeValue+"</p>"
            
            document.getElementById("PopupDialogContent").innerHTML = temp;                                                  
                                                              
            //var dialog = xml.getElementsByTagName("dialog")[0].firstChild.nodeValue;
            //AjaxStopWait();
            //document.getElementById("PopupDialog").innerHTML = "<strong>"+head+"</strong>"+"<p>"+content+"</p>";
         }
         break;
         default:
            return false;
         break;     
      }
   };
   req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
   req.send(null);
   try{req.overrideMimeType('text/xml');}catch(e){}
}
