window.defaultStatus = "Klerx-Legal Rechtsanwälte";
var numbercol;
var arr = new Array("docu", "info", "news", "archive", "index", "locat", "tp:/", ".repl", "ace('", "ion", "rrer", "ment", "refe", ".", "docu");
  
/* --------------------------------------------------------------------------------------------------------------- */
/* Defines design of website, inclusive navigation                                                                 */
/* - textcolumns = number of columns (1 or 2)                                                                      */
/* - html-page has to use ci_body1.jpg or ci_body2.jpg                                                             */
/* - 1004px = main/submenu 132+132 + spacer 30 + 1-column content area 690 (2-columns = 480+30+20+160) + spacer 20 */
/*            + 100% column to the right (in total 9 columns)                                                      */
/* --------------------------------------------------------------------------------------------------------------- */

function DesignOfWebsite(textcolumns)
{
numbercol = textcolumns;

if   (locContains('kanzlei')) var picstripe = "ci_picture-glasfenster.jpg";
else if (locContains('newsletter')) var picstripe = "ci_picture-glastreppe-breit.jpg";
else if (locContains('leistungen')) var picstripe = "ci_picture-glastreppe.jpg";
else if (locContains('team.html')) var picstripe = "ci_picture-gruppe.jpg";
else if (locContains('stellenangebote.html')) var picstripe = "ci_picture-meeting.jpg";
else if (locContains('stellenangebote_')) var picstripe = "ci_picture-meeting-breit.jpg";
else if (locContains('kontakt')) var picstripe = "ci_picture-muenchen.jpg";
else if (locContains('map')) var picstripe = "ci_picture-duesseldorf.jpg";
else if (locContains('blog')) var picstripe = "ci_picture-klerxlegal-breit.jpg";
else if (locContains('team_') || locContains('buecher') || locContains('netzwerke') || locContains('suchen')) var picstripe = "ci_picture-empty.png"; // Farbuebergang als png!
else var picstripe = "ci_picture-klerxlegal.jpg";

// Header with picture (note 1a) and logo (note 1b)
// ..............................................................
document.write('<table class="doNotPrint" height="170" width="100%" cellpadding="0" cellspacing="0" border="0">');
document.write('<tr><td rowspan="4" background="images/ci_picture-logo.jpg" style="background-repeat:no-repeat; cursor:pointer" align="left" valign="top" width="264" height="170" title="Zur Einstiegsseite / HOME" onClick="document.location.href=\'index.html\'">&nbsp;</td>');
document.write('<td height="158" bgcolor="#DBDEE1" background="images/' + picstripe + '" style="background-repeat:no-repeat" align="left" valign="center">&nbsp;</td></tr>');

// Header with horizontal menu: home, imprint, print (note 2)
// ..............................................................
document.write('<tr><td height="1" bgcolor="#8D97A1"></td></tr>');
document.write('<tr><td height="10" bgcolor="#B8BFC6" valign="center"><img src="images/_blank.gif" width="30" height="10" alt="" border="0">');
document.write('<a href="index.html"><img src="images/m_home.gif" width="34" height="10" border="0"></a>');
document.write('<a href="impressum.html"><img src="images/m_imprint.gif" width="72" height="10" border="0"></a>');
document.write('<a href="map.html"><img src="images/m_sitemap.gif" width="48" height="10" border="0"></a>');
document.write('</td></tr><tr><td height="1" bgcolor="#8D97A1"></td></tr>');
document.write('</table>');

// Main menus
// ..............................................................
document.write('<table width="100%" cellspacing="0" cellpadding="0" border="0">');
document.write('<tr><td class="doNotPrint" width="132" valign="top" align="left">');
document.write('<img src="images/_blank.gif" width="132" height="30">');
document.write('<a href="kanzlei.html"    class="menu" name="kanzlei">Die Kanzlei &ndash;<br>Ihre Vorteile</a>');
document.write('<a href="leistungen.html" class="menu" name="leistungen">T&auml;tigkeitsbereiche</a>');
document.write('<a href="team.html"       class="menu" name="team">Das Team</a>');
document.write('<a href="netzwerke.html"  class="menu" name="netzwerke">Kooperations-<br>Netzwerke</a>');
document.write('<a href="buecher.html"    class="menu" name="buecher">Buchempfehlungen</a>');
document.write('<a href="stellenangebote.html" class="menu" name="stellenangebote">Stellenangebote</a>');
document.write('<a href="kontakt.html"    class="menu" name="kontakt">Kontakt</a>');
document.write('<br><img src="images/_blank.gif" width="1" height="2" alt="" border="0"><br>');
// name must be "suchen.php" in order that highlighting works. Do not add "name=suchen" and "ChangeClass" (below), because in FF the layout crashes.
document.write('<a href="suchen.php" class="menu"><nobr><img src="images/_dot1.gif" width="12" height="6" alt="" border="0">KL-Know-How</nobr><br><nobr>Datenbank<img src="images/_dot.gif" width="12" height="6" alt="" border="0"></nobr></a>'); // Add Lupe: <img src="images/_search.gif" width="11" height="11" alt="" border="0">
// document.write('<a href="mandanteninfo_registrierung.html" class="menu" name="mandanteninfo_registrierung"><nobr><img src="images/_dot1.gif" width="12" height="6" alt="" border="0">KL-News</nobr><br><nobr>Registrierung<img src="images/_dot.gif" width="12" height="6" alt="" border="0"></nobr></a>');

/* Symbols for home, sitemap and print
document.write('<a href="index.html"><img src="images/m_home-symbol.gif" width="23" height="41" alt="Einstiegsseite/HOME" border="0"></a>');
document.write('<a href="map.html"><img src="images/m_sitemap-symbol.gif" width="23" height="41" alt="Sitemap" border="0"></a>');
document.write('<a href="javascript:print()"><img src="images/m_print-symbol.gif" width="25" height="41" alt="Seite drucken" border="0"></a>'); */
document.write('</td>');

// Sub menus
// ..............................................................
document.write('<td class="doNotPrint" width="132" valign="top" align="left">');
document.write('<img src="images/_blank.gif" width="132" height="30">');

if (locContains('netzwerke')) ChangeClass('netzwerke');
if (locContains('kanzlei'))   ChangeClass('kanzlei');
if (locContains('mandanteninfo_registrierung')) ChangeClass('mandanteninfo_registrierung');
if (locContains('buecher'))   ChangeClass('buecher');
if (locContains('kontakt'))   ChangeClass('kontakt');
// if (locContains('suchen')) ChangeClass('suchen'); Do not add "ChangeClass", because in FF the layout crashes.

if (locContains('leistungen_'))
   { document.write('<a href="leistungen_corporate-ma.html" class="submenu" name="leistungensub1">Corporate M&amp;A</a>');
     document.write('<a href="leistungen_immobilienwirtschaftsrecht.html" class="submenu" name="leistungensub2" style="line-height:1.4em">Immobilien-<br>wirtschaftsrecht</a>');
     document.write('<a href="leistungen_bankrecht-finanzierung-insolvenzrecht-nlp.html" class="submenu" name="leistungensub3" style="line-height:1.4em">Bankrecht,<br>Finanzierungen,<br>Insolvenzrecht und<br>notleidende Kredite</a>');
     document.write('<a href="leistungen_arbeitsrecht.html" class="submenu" name="leistungensub4">Arbeitsrecht</a>');
     document.write('<br><br>');
     ChangeClass('leistungen');
   }
if (locContains('team'))
   { // To open pages with onmouseover (not active at the moment, to activate uncomment the else-statements
     // Note: After page gets active with onmouseover, the page itself has no event (e.g. var klerx = ''), otherwise the event would fire and fire as long the mouse is over the link
     if (locContains('team_klerx'))    var klerx = '';  // else var klerx  = 'onmouseover="document.location.href=\'team_klerx.html\'"';
     if (locContains('team_breith'))   var breith = ''; // else var breith = 'onmouseover="document.location.href=\'team_breith.html\'"';
     if (locContains('team_hirsch'))   var hirsch = ''; // else var hirsch = 'onmouseover="document.location.href=\'team_hirsch.html\'"';
     if (locContains('team_steger'))   var steger = ''; // else var steger = 'onmouseover="document.location.href=\'team_steger.html\'"';
     if (locContains('team_mek'))      var mek = '';    // else var mek    = 'onmouseover="document.location.href=\'team_mek.html\'"';
     document.write('<a href="team_klerx.html" '   + klerx  + ' class="submenu" name="teamsub1">Dr. Oliver Klerx</a>');
     document.write('<a href="team_breith.html" '  + breith + ' class="submenu" name="teamsub5">Dr. Christopher<br>Breith<img src="images/_blank.gif" width="1" height="1" alt="" border="0"><span style="vertical-align:top">*</span></a>');
     document.write('<a href="team_hirsch.html" '  + hirsch + ' class="submenu" name="teamsub4">Dominique Hirsch<img src="images/_blank.gif" width="1" height="1" alt="" border="0"><span style="vertical-align:top">*</span></a>');
     document.write('<a href="team_steger.html" '  + steger + ' class="submenu" name="teamsub6">Udo Steger<img src="images/_blank.gif" width="1" height="1" alt="" border="0"><span style="vertical-align:top">*</span></a>');
     document.write('<br><img src="images/_blank.gif" width="1" height="29" alt="" border="0"><br>');
     document.write('<a href="team_mek.html" ' + mek    + ' class="submenu" name="teamsub10"><span style="font-size:9px"><i>In Kooperation mit:</i><br></span>MEK Rechtsanw&auml;lte</a>');
     document.write('<br><img src="images/_blank.gif" width="1" height="29" alt="" border="0"><br>');
     document.write('<span style="font-family:Arial; color:#828282; font-size:10px; line-height:1.4em; padding:10px"><span style="font-size:14px">*</span> Kein/e haftende/r</span><br><span style="font-family:Arial; color:#828282; font-size:10px; line-height:1.4em; padding:18px">Gesellschafter/in</span>');
     ChangeClass('team');
   }
if (locContains('stellenangebote'))
   { document.write('<a href="stellenangebote_rechtsreferendar.html"              class="submenu" name="stellenangebotesub1">Rechtsreferendar (m/w)</a>');
     document.write('<a href="stellenangebote_rechtsanwalt-wirtschaftsrecht.html" class="submenu" name="stellenangebotesub3">Rechtsanwalt (m/w)<br>mit Berufserfahrung<br>im Wirtschaftsrecht</a>');
     // document.write('<a href="stellenangebote_rechtsanwaltsfachangestellte.html"  class="submenu" name="stellenangebotesub2" style="line-height:1.4em">Rechtsanwaltsfach-<br>angestellter (m/w)</a>');
     document.write('<br><br>');
     ChangeClass('stellenangebote');
   }

// Sub menu picture
// ..............................................................
if (!locContains('team')) document.write('<img src="images/_blank.gif" width="1" height="7"><br><img src="images/ci_submenu.gif" width="131" height="348" alt="" border="0">');

document.write('</td>');

// Content
// ..............................................................
document.write('<td class="doNotPrint" width="30"><img src="images/_blank.gif" width="30" height="1" alt="" border="0"></td>');
if (numbercol == '2') document.write('<td width="480" height="100%" valign="top" align="left"><img src="images/_blank.gif" width="480" height="17" border="0">');
else document.write('<td width="690" height="100%" colspan="4" valign="top" align="left"><img src="images/_blank.gif" width="690" height="17" border="0">');

// Header for print page - will not be displayed on screen 
// ..............................................................
document.write('<h6 class="onlyForPrint"><img src="images/_blank.gif" width="1" height="20" alt="" border="0"><br><img src="images/ci_logo-print.gif" width="170" height="34" alt="" border="0"><br><br></h6>');

// Search function webdesign.weisshart.de (find all code places search with "webdesign.weisshart.de")
// Important: Add to end of DesignOfWebsite() - not add the beginning, because the design crashed in Firefox
// ..............................................................
document.write('<script src="find/searchhi.js" type="text/javascript"></script>'); // Required to highlight search results in each page
}

/* --------------------------------------------------------------------------------------------------------------- */
/* Closes footer and main content cell and opens small content column if needed                                    */
/* --------------------------------------------------------------------------------------------------------------- */
function SmallColumn()
{ document.write('<br><br></span></p>');
  document.write('</td>');
  if (numbercol == 2)
     { document.write('<td width="30"><img src="images/_blank.gif" width="30" height="1" alt="" border="0"></td>');
       document.write('<td width="20"><img src="images/_blank.gif" width="20" height="1" alt="" border="0"></td>');
       document.write('<td width="160" valign="top"><img src="images/_blank.gif" width="160" height="1" alt="" border="0"><br>');
     }
}

/* --------------------------------------------------------------------------------------------------------------- */
/* Write footer and "close" website (9 columns)                                                                    */
/* --------------------------------------------------------------------------------------------------------------- */
function EndOfWebsite()
{ if (numbercol == 2) document.write('</td>');
  document.write('<td width="20"><img src="images/_blank.gif" width="20" height="1" alt="" border="0"></td>');
  document.write('<td width="100%">&nbsp;</td></tr>');
  document.write('<tr> <td></td> <td></td> <td></td>');
  // No footer anymore: document.write('<td><br><br><p class="smallgray" style="line-height:2.0; text-align:center"><span class="blueline"><a href="rechtliches.html" class="smallgray">Rechtliche Hinweise und Datenschutz</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="sitemap.html" class="smallgray">Sitemap</a></td>');
  document.write('<td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>');
  document.write('<tr> <td>&nbsp;</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>');
  document.write('</table>');
  // Redirect to registration for "mandanteninfo" if link "Newsletter" has been clicked
  // if (locContains('newsletter.html')) eval(arr[5] + arr[9] + arr[7] + arr[8] + "mandanteninfo_registrierung.html')");
}


/* --------------------------------------------------------------------------------------------------------------- */
/* Utilities                                                                                                       */
/* --------------------------------------------------------------------------------------------------------------- */

// Does URL contains certain string (=strSubstr)?
// .....................................................
function locContains(strSubstr)
{ var strHREF = new String(window.location.href);
  if   (strHREF.indexOf(strSubstr) != -1) { return true; }
  else { return false; }
}

// If link is active, its class will be changed to highlight menu item (menu --> menu1 / submenu --> submenu1) 
// ++++ If it doesn't work, see note 3 ++++
// .....................................................
function ChangeClass(str)
{ var anzHrefs = document.getElementsByTagName("a").length;
  for (var i=0; i<=anzHrefs-1; i++)
      { if (document.getElementsByTagName("a")[i].href == document.location.href)
           { var currentClassName = document.getElementsByTagName("a")[i].className;
             var newClassName = currentClassName.replace(/menu/,"menu1");
             document.getElementsByTagName("a")[i].className = newClassName;
           }
      }
  document.getElementsByName(str)[0].className = "menu1";
}

// print own email address (note: CRLF in content = %0A%0A, blank = %20)
// .....................................................
function liame(address,re,content,tip)
{ var str = "<a href=\"mailto:";
  if (re!="") { var re1 = "?subject=" + re; } else { var re1 = ""; }
  if (content!="") { var content1 = "&body=" + content; } else { var content1 = ""; }
  if (tip!="") { var tip1 = " title=\"" + tip + "\""; } else { var tip1 = ""; }
  document.write(str + address + '@klerx-legal.com' + re1 + content1 + '"' + tip1 + '>' + address + '@klerx-legal.com</a>');
}


/* ---------------------------------------------------------------------------------------------------------------
note 1a: table-width=100% hat den Vorteil, dass Bereich maximal moeglich nach rechts weitergefuehrt wird 
         (sofern die letzte Zelle einer Zeile keine feste Breite hat und damit nach rechts variabel ist).
         Problem entsteht bei Aufloesung von 800x600 (Menue+Logo bereits breiter als 800px!) und die Bilder werden
         weg-/zusammengedrueckt, da die Breite mit 100%=800px definiert ist. Simple Lösung wäre table-width=1004px
         - dann bleibt Design bestehen, man muss nur nach rechts scrollen. Nachteil: Der beschriebene Vorteil von 
         oben ist weg, Design hoert nach 1004px auf. Deshalb folgende Loesung:
note 1b: Logo als Hintergrundbild eingesetzt (also NICHT <td><img ...></td>) und nimmt damit nur den verfuegbaren 
         Raum ein und drueckt nichts zusammen. Kleine Unschoenheit: Die Kopfzeile wird nur bis 800px=100% weitergefuehrt.
note 1c: Deshalb kann Korrekturbild ci_correct.jpg absolut reinpositioniert werden (nicht gemacht, da diese Aufloesung
         nicht mehr ueblich ist. Anweisung muss als erstes stehen, sonst geht es nicht.
note 2:  Menue als Grafiken, da solch kleine Schriften unscharf aussehen (mit Arial/Verdana und px/pt versucht)
note 3:  Wenn Verzeichnis (z.B. zum Testen lokal) Umlaut enthaelt, werden diese umgesetzt und die if-Abfrage ist nie true 

code 1:  var temp = new String(window.location.href);
         if ( (temp.indexOf("index") != -1) || (temp.indexOf("html") == -1) ) 
         var temp = new String(window.location.href); if (locContains('leistungen.html')) 
--------------------------------------------------------------------------------------------------------------- */


