if (document.layers) {navigator.family = "nn4"}
if (document.all) {navigator.family = "ie4"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}

overdiv="0";
showDiv="0";
eventid="0";

var x = 0;
var y = 0;

var open = 0;

function setCard(title, img, p1, p2, setzkasten, link, admin, offset)
  {
  var html;
  var info = setzkasten.split(";");
  
  html  = "<table cellspacing='2' cellpadding='2' width='100%' height='100%'>\n";
  html += "  <tr><td colspan='2' align='center'><b>" + title + "</b><br/><br/></td></tr>\n";
  
  if (img)
    {
    html += "  <tr><td valign='top'><img src='" + img + "' width='150' border='0' style='border: 1px solid black'></td>\n";
    }
  else
    {
    html += "  <tr><td>&nbsp;</td>\n";    
    }
    
  html += "  <td valign='top'><table cellpadding='2' cellspacing='2' width='100%'><tr><td><b>" + p1 + "</b></td><td>" + p2 + "</td></tr></table></td>\n";

  if (admin == 1)
    {
    html += "  <tr>\n";
    html += "    <td height='20' colspan='2' align='center' style='border-top: 1px dotted black;'>\n<br/>\n";
    
    html += "            <a href='/" + info[3] + "1/id" + info[0] + "delete/sammlung.html' title='Modell aus der Sammlung entfernen'><img src='/images/icons/loeschen.gif' border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

    if (setzkasten)
      {
      html += "      <a href='#' onClick=\"HideDiv(1); popSetzkasten(" + x + ", " + y + ", '" + info[0] + "', '" + title + "', " + info[1] + ", " + info[2] + ", '" + info[3] + "', " + offset + ", " + info[4] + ", " + info[5] + ", " + info[6] + ");\" title='Modell im Setzkasten verschieben'><img src='/images/icons/verschieben.gif' border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
      }
  
    html += "            <a href='/" + link + info[0] + "/upload.html' title='Neues Bild hochladen'><img src='/images/icons/galerie.gif' border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    
    if (img)
      {
      html += "            <a href='/" + link + info[0] + "/setzbild.html' title='Bildausschnitt f&uuml;r Setzkasten w&auml;hlen'><img src='/images/icons/setzbild.gif' border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
      }
    
    html += "            <a href='/" + link + info[0] + "/1/minfo.html' title='Information zum Modell pflegen'><img src='/images/icons/setup.gif' border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    html += "            <a href='/" + link + info[0] + "/1/mpedia.html' title='Modellypedia'><img src='/images/icons/mpedia.gif' border='0'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    html += "    </td>\n";
    html += "  </tr>\n";
    }
    
  html += "</table>";
  
  if (overdiv == 0)
    {
    open = (new Date().getTime() / 1000);
    
    if (navigator.family == "gecko") 
      {
      pad="0"; bord="1 bordercolor=black";
      }
    else 
      {
      pad="1"; bord="0";
      }
    
    if(navigator.family =="nn4") {
            document.DetailsCard.document.write(html);
            document.DetailsCard.document.close();
            }
    else if(navigator.family =="ie4"){
            DetailsCard.innerHTML=html;
            }
    else if(navigator.family =="gecko"){
            document.getElementById("DetailsCard").innerHTML=html;
            }
    }
  }

function ShowDiv()
  {
  document.getElementById("DetailsCard").style.left=x+2;
  document.getElementById("DetailsCard").style.top=y+2;  
  document.getElementById("DetailsCard").style.display="block";  
  }
  
//  versteckt die PopUp-Box
function HideDiv(force)
  {
  var desc = "";
  var timestamp = (new Date().getTime() / 1000);
  var diff = (timestamp - open);
  
  if (((overdiv == "0") && (diff > 1)) || (force))
    {
    if(navigator.family =="nn4") 
      {
      document.DetailsCard.document.write(desc);
      document.DetailsCard.document.close();
      document.DetailsCard.display="none";
      }
    else if(navigator.family =="ie4")
      {
      DetailsCard.style.display="none";
      DetailsCard.innerHTML=desc;
      }
    else if(navigator.family =="gecko") 
      {
      document.getElementById("DetailsCard").style.display="none";
      document.getElementById("DetailsCard").innerHTML=desc;
      }
    }
  }

var isNav = (navigator.appName.indexOf("Netscape") !=-1);

function handlerMM(e)
  {
  // entweder feste x/y-Position fuer die Info-Box
  // x = 300; // Infobox x-Position bei 300 von links
  // y = 0;   // Infobox y-Position bei 0 (oben)

  // oder Platzierung neben Mauszeiger

  x = (isNav) ? e.pageX + 2 : event.clientX + document.body.scrollLeft + 2;
  y = (isNav) ? e.pageY + 2 : event.clientY + document.body.scrollTop + 2;  

  // y -= 158;

  if (showDiv > 1)
    {
    window.setTimeout("ControllDiv(" + showDiv + ")", 800);
    }

  if (showDiv == -1)
    {
    window.setTimeout("HideDiv()", 800);
    }  
  
  // document.getElementById("xx").value=showDiv;
  }

function ControllDiv(sd)
  {
  // document.getElementById("yy").value=sd;

  if (sd == showDiv)
    {
    ShowDiv();
    showDiv = 1;
    }
  }

if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;
//  End -->