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

function AjaxGetAdressDetail(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=getAdressDetail&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;
            document.getElementById("PopupDialog").innerHTML = ""
                                                              +"<div style='float:right;padding-left:20px;'>"+xml.getElementsByTagName("karte")[0].firstChild.nodeValue
                                                              +"</div>"
                                                              +"<h3>"+xml.getElementsByTagName("name")[0].firstChild.nodeValue+"</h3>"
                                                              +"<p>"+xml.getElementsByTagName("strasse")[0].firstChild.nodeValue+"</p>"  
                                                              +"<p>"+xml.getElementsByTagName("tel")[0].firstChild.nodeValue+"</p>" 
                                                              +"<p>"+xml.getElementsByTagName("mobil")[0].firstChild.nodeValue+"</p>" 
                                                              +"<p>"+xml.getElementsByTagName("fax")[0].firstChild.nodeValue+"</p>"     
                                                              +"<p>"+xml.getElementsByTagName("mail")[0].firstChild.nodeValue+"</p>" 
                                                              +"<p>"+xml.getElementsByTagName("web")[0].firstChild.nodeValue+"</p>" 
                                                              +"<p>"+xml.getElementsByTagName("cat")[0].firstChild.nodeValue+"</p>" 
                                                              +"<p>"+xml.getElementsByTagName("export")[0].firstChild.nodeValue+"</p>"
                                                              +"";
                                                              
                                                              
            //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){}
}
