window.defaultStatus = "von der Heyden, Großkreuz & Söhngen";
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 = 1004 */
/* -------------------------------------------------------------------------------------------------------------------- */

function DesignOfWebsite(textcolumns)
{
numbercol = textcolumns;

document.write('<table class="doNotPrint" height="170" width="100%" cellpadding="0" cellspacing="0" border="0">'); // note 1a

// Header with picture or video (see note 4 and 5)
document.write('<tr><td background="images/ci_picture-video.jpg" rowspan="4" width="264" height="170" valign="top">');
var params = {menu: "false", quality: "best", scale: "exactfit", align: "lt", wmode: "transparent"}; /* wmode=transparent necessary for pixelraster.gif */
swfobject.embedSWF("images/ci_picture-video.swf", "myContent", "264", "170", "9.0.0", "expressInstall.swf", false, params, false);
document.write('<div id="myContent"><img src="images/ci_picture.jpg" width="264" height="170" alt="" border="0"></div>'); /* required! */
document.write('</td>');

// Header with logo (note 1b)
if   (numbercol == 2)
     { 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>'); }
else { document.write('<td height="158" bgcolor="#DBDEE1" background="images/ci_logo1.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>');
if   (numbercol == 2)
     { document.write('<tr><td height="10" bgcolor="#B8BFC6" valign="center"><img src="images/_blank.gif" width="367" height="1" alt="" border="0">'); }
else { document.write('<tr><td height="10" bgcolor="#B8BFC6" valign="center"><img src="images/_blank.gif" width="585" height="1" alt="" border="0">'); }
document.write('<a href="index.html"><img src="images/m_home.gif" width="26" height="8" border="0"></a><img src="images/_line-v.gif" width="15" height="8">');
document.write('<a href="sitemap.html"><img src="images/m_sitemap.gif" width="41" height="8" border="0"></a><img src="images/_line-v.gif" width="15" height="8">');
document.write('<a href="en/index.html"><img src="images/m_english.gif" width="38" height="8" 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="32">');
document.write('<a href="personalberatung-managementberatung.html" class="menu" name="company">&Uuml;ber uns</a>');
document.write('<a href="personalberatung-executive-search.html" class="menu" name="recruiting">Personalberatung</a>');
document.write('<a href="executive-services.html" class="menu" name="execservices">Executive Services</a>');
document.write('<a href="interim-manager_interim-management.html" class="menu" name="interim">Interim Management</a>');
document.write('<a href="mergers-and-acquisitions.html" class="menu" name="ma_">Mergers &amp; Acquisitions</a>');
document.write('<a href="managementberatung-personalberatung-muenchen.html" class="menu" name="contact">Kontakt</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="32">');

if (locContains('personalberatung-managementberatung.html') || locContains('management-team-vdhg-muenchen.html'))  
   { document.write('<a href="management-team-vdhg-muenchen.html" class="submenu" name="companysub1">Managementteam</a>');
     document.write('<br><br>');
     ChangeClass('company');
   }
if (locContains('personalberatung-executive-search.html') || locContains('personalsuche-personalberater.html') || locContains('personalberatung-personalberater.html'))  
   { document.write('<a href="personalsuche-personalberater.html" class="submenu" name="recruitingsub1">Arbeitsweise</a>');
     document.write('<a href="personalberatung-personalberater.html" class="submenu" name="recruitingsub2">Wahl der richtigen Personalberatung</a>');
     // document.write('<a href="recruiting_resources.html" class="submenu" name="recruitingsub3">Ressourcen</a>');
     document.write('<br><br>');
     ChangeClass('recruiting');
   }
if (locContains('interim-manager_interim-management.html'))
   { ChangeClass('interim');
   }
if (locContains('executive-services.html') || locContains('management-audits.html') || locContains('executive-services-profiling.html') || locContains('management-coaching-coach.html') || locContains('vertriebs-coaching.html'))
   { document.write('<a href="management-audits.html" class="submenu" name="execservicessub1">Management-Audits</a>');
     document.write('<a href="executive-services-profiling.html" class="submenu" name="execservicessub2">Profiling</a>');
     document.write('<a href="management-coaching-coach.html" class="submenu" name="execservicessub3">Management-Coaching</a>');
     document.write('<a href="vertriebs-coaching.html" class="submenu" name="execservicessub4">Vertriebs-Coaching</a>');
     document.write('<br><br>');
     ChangeClass('execservices');
   }
if (locContains('mergers-and-acquisitions.html') || locContains('mergers-and-acquisitions-firmenakquisitionen.html') || locContains('success-story-firmen-akquisition.html'))
   { document.write('<a href="mergers-and-acquisitions-firmenakquisitionen.html" class="submenu" name="masub1">Vorgehensweise</a>');
     document.write('<a href="success-story-firmen-akquisition.html" class="submenu" name="masub2">Success Story</a>');
     document.write('<br><br>');
     ChangeClass('ma_');
   }
if (locContains('managementberatung-personalberatung-muenchen.html') || locContains('vdhg-anfahrt.html') || locContains('contact_disclaimer.html'))
   { document.write('<a href="vdhg-anfahrt.html" class="submenu" name="contactsub1">Anfahrtshinweis</a>');
     document.write('<a href="contact_disclaimer.html" class="submenu" name="contactsub2">Disclaimer</a>');
     document.write('<br><br>');
     ChangeClass('contact');
   }

// Zitat: if (locContains('xxx')) { document.write('<p class="smallgray" style="text-align:right; margin-top:35px; padding-left:20px; padding-right:5px;"><i>text text text text text text text text text text text text text </i></p>'); }
document.write('<img src="images/ci_submenu.gif" width="131" height="360" alt="" border="0">');
document.write('</td>');

// Content
document.write('<td 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">von der Heyden, Großkreutz &amp; Söhngen</h6>');

// Absolute positioning of pixelraster for all pages with video
document.write('<div class="doNotPrint" style="position:absolute; top:0px; left:0px; z-index:100"><img src="images/ci_pixelraster.gif" width="264" height="170" alt="" border="0"></div>');

// Absolute positioning of animation "needs/meets" in header
if   (numbercol == 2)
     { document.write('<div class="animation1"><img src="images/animation.gif" width="54" height="14" alt="" border="0"></div>'); }
else { document.write('<div class="animation2"><img src="images/animation.gif" width="54" height="14" alt="" border="0"></div>'); }

}

/* ---------------------------------------------------------------------------- */
/* Closes footer and main content cell and opens small content column           */
/* ---------------------------------------------------------------------------- */
function SmallColumn()
{ document.write('<br><br></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="35" alt="" border="0"><br>');
       document.write('<div class="onlyForPrint" style="height:52px"></div>');
     }
}

/* ---------------------------------------------------------------------------- */
/* Write footer and "closes" website                                            */
/* ---------------------------------------------------------------------------- */
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 height="50"><td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr>');
  document.write('</table>');
  document.write('<div style="position:absolute; top:156px; left:295px; width:300px; z-index:1"><marquee class="smallblack" behavior="scroll" loop="infinite" scrollamount="3" scrolldelay="0">Wir sind umgezogen &ndash; <a href="managementberatung-personalberatung-muenchen.html">hier</a> unsere neue Adresse</marquee></div>');
}


/* ---------------------------------------------------------------------------- */
/* Utilities                                                                    */
/* ---------------------------------------------------------------------------- */

// Does URL contain (sub)string?
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 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 + '@vdhg.de' + re1 + content1 + '"' + tip1 + ' style="font-weight:normal">' + address + '@vdhg.de</a>');
}

function showDiv(args)
{ 
  var imgDown = "images/_arrow-down.gif";
  var imgUp = "images/_arrow-up.gif";
  var arrow = new Image(16, 11); // width, height
  var img = showDiv.arguments[0] + 'IMG';

  // Hide resp. display div which is passed as arguments 0
  var element = document.getElementById(showDiv.arguments[0]);
  if   (element.style.display == "none")   // if div is hidded, display it now and define new image
       { arrow.src = imgUp;
         element.style.display = "block";  // if div is display, hide it now and define new image
       } 
  else { arrow.src = imgDown;
         element.style.display = "none"; 
       }
  document.images[img].src = arrow.src;    // change to new image

  // Hide all other divs which are passed as arguments 1 - x
  // Error message at 1st statement of for: There is a div which is not defined!
  for (var i=1; i < showDiv.arguments.length; i++)
      { document.getElementById(showDiv.arguments[i]).style.display = "none";
        arrow = new Image(16, 11);
        img = showDiv.arguments[i] + 'IMG';
        arrow.src = imgDown;
        document.images[img].src = arrow.src;
      }
}

// var temp = new String(window.location.href);
// if ( (temp.indexOf("index") != -1) || (temp.indexOf("html") == -1) ) 

/* --------------------------------------------------------------------------------------
note 1a: table-width=100% hat den Vorteil, dass blauer 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 Korrekturbild ci_correct.jpg absolut reinpositioniert. Anweisung muss als erstes stehen, sonst geht es nicht. Keine Ahnung warum.
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 versch. umgesetzt und die if-Abfrage ist nie true 
note 4:  swfobject description: http://code.google.com/p/swfobject/wiki/documentation (-> link to translation)
         Parameter description: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701&sliceId=1
         Google Suche: "swf object param"
note 5:  Versuch flv per swfobject einzubinden:
         var playervars = { playerpath: "", contentpath: "images", video: "ci_picture-video.flv", preview: "ci_picture-video.jpg", skin: "skin-applestyle.swf", captions: "demo-captions.xml"};
         var params = { menu: "false", quality: "best", scale: "exactfit", align: "lt", wmode: "transparent"}; 
         swfobject.embedSWF("flvplayer/flvplayer.swf", "mycontent", "264", "170", "9.0.28", "flvplayer/expressInstall.swf", playervars, params, false); 
         -----
         var flashvars = { file: "images/ci_picture-video.flv", fullscreen: "false", stretching: "fill", autostart: "true"}; 
         swfobject.embedSWF("http://www.longtailvideo.com/jw/embed/player.swf", "myContent", "264", "170", "9.0.0","expressInstall.swf", flashvars, {}, {}); 
-------------------------------------------------------------------------------------- */

