/* empira HTML-Menü
   © 2005 empira Software Gmbh, Köln
   All rights reserved.
   Based on scripts developed by Thomas Hövel for BUND Rhein-Sieg-Kreis (http://www.bund-rsk.de)
   © 2001 BUND Rhein-Sieg-Kreis und Thomas Hövel
   Used by kind permission!
*/

// Mouse over menu item
function MIPick(obj)
{
  //obj.style.color="#FFFFFF";  //warum geht das nicht???
  obj.style.backgroundColor="#69a3a6"; //"#b0b0b0";
  obj.style.borderColor="#999999";
  obj.style.borderWidth="1px";
  return true;
}

// Mouse left menu item
function MIUnpick(obj)
{
  //obj.style.color="red";
  obj.style.backgroundColor="#e4eff5";
  obj.style.borderColor="#e4eff5";
  return true;
}

// Mouse click menu item
function MIClick()
{
  var obj = window.event.srcElement;
  var a = obj.all.tags("A");
  if (a.length > 0)
  {
    obj.style.backgroundColor="#cccccc";
    obj.style.borderColor="#cccccc";
    top.location.href = a[0].href;
  }
  return true;
}

// level is level of indent
// fActive draws item hilighted with no link
// fBold draws item bold
// disabled draws item grayed with no link
// url is link. If null the item is static.
// text is item text
function MenuItem(level, fActive, fBold, disabled, url, text)
{
  document.writeln('<tr>');
  document.writeln('<td valign="top" height="1"><table border="0" width="100%" height="1" cellspacing="0" cellpadding="0"><tr>');
  if (level > 0)
  {
    cIndent = "5";
    if (level == 2)
      cIndent = "15";
    else if (level == 3)
      cIndent = "25";
    document.writeln('<td valign="top" height="1" width="' + cIndent + '"><img src="/images/space.gif" width="' + cIndent + '" height="1"></td>');
  }
  document.writeln('<td valign="top">');
  link = !fActive && !disabled && url != null;
  if (fActive)
    document.writeln('<table border="0" style="border: #CCCCCC 1px solid" width="100%" cellspacing="0" cellpadding="2" bgcolor="#e0e0e0"><tr><td>');
  else
  {
    if (disabled)
      document.writeln('<table border="0" style="border: #e4eff5 1px solid" width="100%" cellspacing="0" cellpadding="2"><tr><td>');
    else
    {
      if (link)
        document.writeln('<table border="0" style="border: #e4eff5 1px solid" width="100%" cellspacing="0" cellpadding="2" onmouseover="MIPick(this)" onmouseout="MIUnpick(this)" onclick="MIClick()"><tr><td>');
      else
        document.writeln('<table border="0" style="border: #e4eff5 1px solid" width="100%" cellspacing="0" cellpadding="2""><tr><td>');
    }      
  }    

  document.writeln("<span style=\"");
  if (fBold)
    document.writeln("font-weight:bold;");
  if (disabled)
    document.writeln("color:#909090");
  document.writeln("\">");
  if (link)
    document.writeln("<a class='menulink' href='" + url + "'>");
  document.writeln(text);
  if (link)
    document.writeln('<\/a>');
  document.writeln('</span>');

  document.writeln('</td></tr></table></td><td valign="top" height="1" width="5"><img src="/images/space.gif" width="5" height="1"></td></tr></table></td></tr>');
}

function MenuHome(fOpen, root, mid)
{
  document.writeln('<table border="0"  bgcolor="#e4eff5" width="100%" height="1" cellspacing="0" cellpadding="0" style="border-bottom: #CCCCCC 1px solid;">');
  document.writeln('<tr><td>');
  document.writeln('<img src="/images/space.gif" width="160" height="1"><br>');
  document.writeln('<table border="0" width="100%" height="1" cellspacing="0" cellpadding="0">');
  MenuItem(0, false, true, false, null, "Home");
  MenuItem(1, mid == "Home", false, false, root + "topID=Home", "MigraDoc");
  MenuItem(1, mid == "News", false, true, root + "topID=News", "News");
  MenuItem(1, mid == "Press", false, false, root + "topID=Press", "Presse");
  MenuItem(1, mid == "Contact", false, false, root + "topID=Contact", "Kontakt");
  MenuItem(1, mid == "About", false, false, root + "topID=About", "Impressum");
  //MenuItem(0, false, false, false, null, "&nbsp;");
  document.writeln('</table></td></tr>');
  document.writeln('</table>');
}

function MenuProducts(fOpen, root, mid)
{
  document.writeln('<table border="0"  bgcolor="#e4eff5" width="100%" height="1" cellspacing="0" cellpadding="0" style="border-bottom: #CCCCCC 1px solid;">');
  document.writeln('<tr><td>');
  document.writeln('<img src="/images/space.gif" width="160" height="1"><br>');
  document.writeln('<table border="0" width="100%" height="1" cellspacing="0" cellpadding="0">');
  MenuItem(0, false, true, false, null, "Produkt");
  MenuItem(1, mid == "Products", false, false, root + "topID=Products", "&Uuml;bersicht");
  MenuItem(1, mid == "Profile", false, false, root + "topID=Profile", "Kurzbeschreibung");
  MenuItem(2, mid == "ProfileDesign", false, false, root + "topID=ProfileDesign", "Design");
  MenuItem(2, mid == "ProfileRendering", false, false, root + "topID=ProfileRendering", "Rendering");
  MenuItem(1, mid == "License", false, false, root + "topID=License", "Lizenzen&nbsp;&amp;&nbsp;Preise");
  //MenuItem(0, false, false, false, null, "&nbsp;");
  document.writeln('</table></td></tr>');
  document.writeln('</table>');
}

function MenuSupport(fOpen, root, mid)
{
  document.writeln('<table border="0"  bgcolor="#e4eff5" width="100%" height="1" cellspacing="0" cellpadding="0" style="border-bottom: #CCCCCC 1px solid;">');
  document.writeln('<tr><td>');
  document.writeln('<img src="/images/space.gif" width="160" height="1"><br>');
  document.writeln('<table border="0" width="100%" height="1" cellspacing="0" cellpadding="0">');
  MenuItem(0, false, true, false, null, "Support");
  MenuItem(1, mid == "Support", false, false, root + "topID=Support", "&Uuml;bersicht");
  MenuItem(1, mid == "LogOn", false, true, root + "topID=LogOn", "Anmelden");
  MenuItem(1, mid == "LogOnHints", false, true, root + "topID=LogOnHints", "Hinweise zur Anmeldung");
  MenuItem(1, mid == "LogOnBugTracker", false, false, root + "topID=LogOnBugTracker", "Zur Fehlerdatenbank");
  MenuItem(1, mid == "Register", false, false, root + "topID=Register", "Registrierung");
  MenuItem(1, mid == "Password", false, false, root + "topID=Password", "Kennwort vergessen?");
  //MenuItem(0, false, false, false, null, "&nbsp;");
  document.writeln('</table></td></tr>');
  document.writeln('</table>');
}

function MenuDownloads(fOpen, root, mid)
{
  document.writeln('<table border="0"  bgcolor="#e4eff5" width="100%" height="1" cellspacing="0" cellpadding="0" style="border-bottom: #CCCCCC 1px solid;">');
  document.writeln('<tr><td>');
  document.writeln('<img src="/images/space.gif" width="160" height="1"><br>');
  document.writeln('<table border="0" width="100%" height="1" cellspacing="0" cellpadding="0">');
  MenuItem(0, false, true, false, null, "Downloads");
  MenuItem(1, mid == "Downloads", false, false, root + "topID=Downloads", "&Uuml;bersicht");
  MenuItem(1, mid == "DlDesigner", false, false, root + "topID=DlDesigner", "Entwicklungsumgebung");
  MenuItem(1, mid == "DlClient", false, false, root + "topID=DlClient", "Laufzeitumgebung");
  MenuItem(1, mid == "DlOffice", false, false, root + "topID=DlOffice", "Office Converter");
  MenuItem(1, mid == "DlSamples", false, false, root + "topID=DlSamples", "Beispielanwendungen");
  MenuItem(1, mid == "DlPdfLib", false, false, root + "topID=DlPdfLib", "PDFlib Integration");
  MenuItem(1, mid == "DlLinks", false, false, root + "topID=DlLinks", "Querverweise");
  //MenuItem(0, false, false, false, null, "&nbsp;");
  document.writeln('</table></td></tr>');
  document.writeln('</table>');
}

function MenuSamples(fOpen, root, mid)
{
  document.writeln('<table border="0"  bgcolor="#e4eff5" width="100%" height="1" cellspacing="0" cellpadding="0" style="border-bottom: #CCCCCC 1px solid;">');
  document.writeln('<tr><td>');
  document.writeln('<img src="/images/space.gif" width="160" height="1"><br>');
  document.writeln('<table border="0" width="100%" height="1" cellspacing="0" cellpadding="0">');
  MenuItem(0, false, true, false, null, "Beispiele");
  MenuItem(1, mid == "Samples", false, false, root + "topID=Samples", "&Uuml;bersicht");
  MenuItem(1, mid == "DlDesigner", false, true, root + "topID=DlDesigner", "Entwicklungsumgebung");
  MenuItem(1, mid == "DlOffice", false, true, root + "topID=DlOffice", "Office Converter");
  MenuItem(1, mid == "DlSamples", false, true, root + "topID=DlSamples", "Beispielanwendungen");
  MenuItem(1, mid == "DlPowerToys", false, true, root + "topID=DlSamples", "PowerToys");
  //MenuItem(0, false, false, false, null, "&nbsp;");
  document.writeln('</table></td></tr>');
  document.writeln('</table>');
}
