window.defaultStatus = "Klerx-Legal Rechtsanwälte";
var numbercol;

/* --------------------------------------------------------------------------------------------------------------- */
/* 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;

// 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.jpg" valign="top" width="264" height="170">&nbsp;</td>');
document.write('<td height="158" bgcolor="#DBDEE1" background="images/ci_logo.jpg" style="background-repeat:no-repeat; cursor:pointer" align="left" valign="center" title="Zur Einstiegsseite / HOME" onClick="document.location.href=\'index.html\'">&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="355" 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="kontakt_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="index.html" class="menu" name="entry">Startseite</a>');
document.write('<a href="kanzlei.html" class="menu" name="kanzlei">Unsere Kanzlei<br>und Mandanten</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="mandanteninfo_registrierung.html" class="menu" name="mandanteninfo_registrierung">Mandanten-<br>Informationen</a>');
document.write('<a href="buecher.html" class="menu" name="buecher">Buchempfehlungen</a>');
document.write('<a href="kontakt.html" class="menu" name="kontakt">Kontakt</a>');
document.write('<a href="impressum.html" class="menu" name="impressum">Impressum und<br>rechtliche Hinweise</a>');
// 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('index')) ChangeClass('entry');
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('impressum')) ChangeClass('impressum');

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'))
   { document.write('<a href="team_klerx.html" class="submenu" name="teamsub1">Dr. Oliver Klerx</a>');
     document.write('<a href="team_jung.html" class="submenu" name="teamsub2">Sonja Jung</a>');
     document.write('<a href="team_kimmelmann.html" class="submenu" name="teamsub3">Dr. Andreas Kimmelmann*</a>');
     document.write('<a href="team_oppolzer.html" class="submenu" name="teamsub4">Annette Oppolzer*</a>');
     document.write('<a href="team_breith.html" class="submenu" name="teamsub5">Dr. Christopher Breith*</a>');
     document.write('<span class="submenu">Christian Queisner*</span>');
     document.write('<br><a href="team_mek.html" class="submenu" name="teamsub10"><span style="font-size:9px"><i>In Kooperation mit:</i><br></span>MEK Rechtsanw&auml;lte</a>');
     document.write('<br><br>');
     document.write('<img src="images/_blank.gif" width="1" height="100" alt="" border="0"><br><span style="font-family:Arial; color:#828282; font-size:10px; padding:10px">* Nicht Gesellschafter/in</span><br><span style="font-family:Arial; color:#828282; font-size:10px; padding:17px">der Sozietät</span>');
     ChangeClass('team');
   }

// Sub menu picture
if (!locContains('leistungen_')) 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>');
}

/* --------------------------------------------------------------------------------------------------------------- */
/* 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>');
  // 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>');
  // document.write('</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>');
}


/* --------------------------------------------------------------------------------------------------------------- */
/* 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')) 
--------------------------------------------------------------------------------------------------------------- */

