/* ----------------------------------------------------- */
/* Defines design of website, inclusive navigation       */
/* (Parameter "textcolumns" defines number of columns.   */
/* Valid values are 1 or 2)                              */
/* ----------------------------------------------------- */

function DesignOfWebsite(textcolumns)
{
  if   (textcolumns == 2) { columnspan = ''; } else { columnspan = 'colspan=3'; } /* note 10 */

	var homeStatus    = 'Einstiegsseite';
	var contactStatus = 'Kontaktadressen';
	var contactLink   = 'KONTAKT';



  document.write('<body background="http;//www.renostar.de/legal-office/legal-office/images/_icon-top.gif" bgproperties="fixed">');
  preloadImages(); /* note 1 */
  document.write('<a name="top"></a>'); /* note 2 */
  /* note 3 + 4 */
  document.write('<table cellpadding="0" cellspacing="0" height="100%" width="1004" valign="top" border="0">');
  document.write('<colgroup> <col width="16"> <col width="142"> <col width="82"> <col width="50"> <col width="480"> <col width="40"> <col width="178"> <col width="16"> </colgroup>');

  /* 1. TR: spacer | home-contact-language | blue cell | 4.-8. empty cells */
  document.write('<tr><td width="16" height="41">&nbsp;</td>');
  document.write('<td width="142" height="41" valign="bottom">');
  document.write('<table width="125" cellpadding="0" cellspacing="0" border="0">');
  if   (!locContains('index.html'))
       { document.write('<tr><td class="menu" align="left"><a class="menu" href="http://www.renostar.de/index.html" onmouseover="window.status=\'' + homeStatus + '\'; return true;" onmouseout="window.status=\'\'; return true;">HOME&nbsp;</a></td>'); }
  else { document.write('<tr><td class="menuactive" align="left">HOME&nbsp;</td>'); }
  if   (!locContains('contact.html'))
       { document.write('<td class="menu" align="left"><a class="menu" href="contact.html" onmouseover="window.status=\'' + contactStatus + '\'; return true;" onmouseout="window.status=\'\'; return true;">' + contactLink + '</a></td>'); }
  else { document.write('<td class="menuactive" align="left">' + contactLink + '</td>'); }
  document.write('</table></td>');
  /* Statements for English: see note 12 */
  document.write('<td background="http://www.renostar.de/legal-office/legal-office/images/ci_bluecell.gif" width="82" height="41" valign="top">&nbsp;</td>');
  document.write('<td height="41" colspan="5" valign="top">&nbsp;</td></tr>');

  /* 2. TR: spacer | blue line | blue line | 4.-8. empty cells */
  document.write('<tr><td width="16" height="2"></td>');
  document.write('<td width="142" height="2" valign="top"><img src="http://www.renostar.de/legal-office/legal-office/images/ci_blueline.gif" width="142" height="2" alt=""></td>');
  document.write('<td width="82" height="2" valign="top"><img src="http://www.renostar.de/legal-office/legal-office/images/ci_blueline.gif" width="82" height="2" alt=""></td>');
  document.write('<td height="2" colspan="5" valign="top"></td></tr>');

  /* 3. TR - 1.+2. TD: spacer | navigation bar and top-button */
  document.write('<tr><td width="16" height="100%"><img src="http://www.renostar.de/legal-office/legal-office/images																																					/_blank.gif" width="16" height="1" alt="" border="0"></td>');
  document.write('<td width="142" onClick="self.location.href=\'#top\'" title="zur&uuml;ck zum Seitenanfang" height="100%" valign="top">');
  document.write('<img src="http://www.renostar.de/legal-office/legal-office/images/_blank.gif" width="142" height="21" alt="" border="0"><br>');
  showMenu("company");
  showMenu("products");
  showMenu("services");
  showMenu("customers");
  showMenu("download");
  document.write('<br>');
/*  showMenu("campaigns");*/
  /* Link zu aktuellem Newsletter
     document.write('<p style="margin-top:42px"><a href="legal_office_newsletter_2004-01.html" class="newsletter">Newsletter 01/04</a></p>');
  */
  document.write('</td>');

  /* 3. TR - 3.-5. TD: picture stripe | spacer | logo and content */
  document.write('<td width="82" height="100%" valign="top" rowspan="2" background="http://www.renostar.de/legal-office/legal-office/images/ci_picture-stripe.jpg" bgcolor="white" title="">&nbsp;</td>');
  document.write('<td width="50" height="100%" valign="top"><img src="http://www.renostar.de/legal-office/legal-office/images/_blank.gif" width="50" height="1" alt="" border="0"></td>');
  document.write('<td ' + columnspan + ' height="100%" valign="top" align="left">'); /* note 10 */
  document.write('<a href="index.html"><img src="http://www.renostar.de/legal-office/legal-office/images/ci_logo.gif" width="154" height="65" alt="" border="0"><br></a>'); /* note 11 */
  document.write('<img src="http://www.renostar.de/legal-office/legal-office/images/_blank.gif" width="10" height="53" alt="" border="0"><br>');
}


/* ----------------------------------------------------- */
/* Show main and its submenu                             */
/* Main and submenu html-file has to follow the          */
/* conventions: xxx.html and xxx_submenu.html            */
/* ----------------------------------------------------- */

function showMenu(menu)
{ 
  /* ---- show main menu items ---- */
  var menuLink = menu + ".html";
  var str;

  if   (!locContains(menu)) /* note 6 */
       { str = 'style="display:none"';
         document.write('<p class="navimain"><a href="' + menuLink + '"' +
         'onmouseover="changeImages(\'m_' + menu + '\', \'images/m_' + menu + '-over.gif\'); window.status=\'\'; return true;"' +
         'onmouseout="changeImages(\'m_' + menu + '\', \'images/m_' + menu + '.gif\'); window.status=\'\'; return true;">' +
         '<img name="m_' + menu + '" src="images/m_' + menu + '.gif" alt="" width="125" height="14" border="0"></a></p>');
       }
  else { str = ''; 
         document.write('<p class="navimain"><a href="' + menuLink + '"' +
         'onmouseover="changeImages(\'m_' + menu + '\', \'images/m_' + menu + '-over.gif\'); window.status=\'\'; return true;"' +
         'onmouseout="changeImages(\'m_' + menu + '\', \'images/m_' + menu + '-down.gif\'); window.status=\'\'; return true;">' +
         '<img name="m_' + menu + '" src="images/m_' + menu + '-down.gif" alt="" width="125" height="14" border="0"></a></p>');
       }

  /* define content of submenus ------------------------ */
  if   (navigator.appName.indexOf("Netscape") != -1) 
       { var linefeed = "<br>" } 
  else { var linefeed = ""; }
  var companySub1   = linefeed + linefeed + '&nbsp;&nbsp;Managementteam'; /* note 7 */
  var companySub2   = linefeed + '&nbsp;&nbsp;Name &raquo;eunomitec&laquo;';
  var servicesSub2  = linefeed + '&nbsp;&nbsp;Grundlagenschulungen';
  var servicesSub3  = linefeed + '&nbsp;&nbsp;Aufbauschulungen';
  var servicesSub4  = linefeed + '&nbsp;&nbsp;Beratung';
  var servicesSub5  = linefeed + '&nbsp;&nbsp;Kompletter Dienst-<br>&nbsp;&nbsp;leistungskatalog';
  var servicesSub6  = linefeed + '&nbsp;&nbsp;Partnerschulungen';
  var productsSub1  = linefeed + linefeed + '&nbsp;&nbsp;legal:office<br>&nbsp;&nbsp;Produktfamilie';
  var productsSub2  = linefeed + '&nbsp;&nbsp;legal:office Highlights';
  var productsSub3  = linefeed + '&nbsp;&nbsp;Leistungen im Detail';
  var productsSub4  = linefeed + '&nbsp;&nbsp;legal:office 2004<br>&nbsp;&nbsp;Servicerelease 2';  
  var customersSub1 = linefeed + linefeed + '&nbsp;&nbsp;Referenzen';
  var customersSub2 = linefeed + '&nbsp;&nbsp;Anwenderberichte';

  /* ---- show or hide submenu, depending on variable str ---- (If error: note 8) */
  if (menu == "company")
     { document.write('<div id="div_company"' + str + '>');
       if   (locContains('_mgmt'))
            { document.write('<p class="naviactive"><a href="http://www.renostar.de/?q=node/89" class="naviactive" title="">' + companySub1 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="company_mgmt.html" class="navi" title="">' + companySub1 + '</a></p>'); }
       if   (locContains('_name'))
            { document.write('<p class="naviactive"><a href="http://www.renostar.de/?q=node/89" class="naviactive" title="">' + companySub2 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="http://www.renostar.de/?q=node/89" class="navi" title="">' + companySub2 + '</a></p>'); }
       document.write('</div>');
     }
  if (menu == "products")
     { document.write('<div id="div_products"' + str + '>');
       if   (locContains('_suite'))
            { document.write('<p class="naviactive"><a href="http://www.renostar.de/?q=produkte" class="naviactive" title="">' + productsSub1 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="http://www.renostar.de/?q=produkte" class="navi" title="">' + productsSub1 + '</a></p>'); }
       if   (locContains('_highlights'))
            { document.write('<p class="naviactive"><a href="http://www.renostar.de/?q=MAC" class="naviactive" title="">' + productsSub2 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="http://www.renostar.de/?q=MAC" class="navi" title="">' + productsSub2 + '</a></p>'); }
       if   (locContains('_detail'))
            { document.write('<p class="naviactive"><a href="products_detail.html" class="naviactive" title="">' + productsSub3 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="products_detail.html" class="navi" title="">' + productsSub3 + '</a></p>'); }
	   document.write('<p class="navi"><a href="http://www.renostar.de/?q=legal-office-anmeldung" class="navi" title="">' + productsSub4 + '</a></p>');

	   
	   
       document.write('</div>');
     }
  if (menu == "services")
     { document.write('<div id="div_services"' + str + '>');
       if   (locContains('_consulting.'))
            { document.write('<p class="naviactive"><a href="services_consulting.html" class="naviactive" title="">' + servicesSub4 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="services_consulting.html" class="navi" title="">' + servicesSub4 + '</a></p>'); }
       if   (locContains('_trainingbasic'))
            { document.write('<p class="naviactive"><a href="services_trainingbasic.html" class="naviactive" title="">' + servicesSub2 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="services_trainingbasic.html" class="navi" title="">' + servicesSub2 + '</a></p>'); }
       if   (locContains('_traininggraduate'))
            { document.write('<p class="naviactive"><a href="services_traininggraduate.html" class="naviactive" title="">' + servicesSub3 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="services_traininggraduate.html" class="navi" title="">' + servicesSub3 + '</a></p>'); }
       if   (locContains('_trainingpartner'))
            { document.write('<p class="naviactive"><a href="services_trainingpartner.html" class="naviactive" title="">' + servicesSub6 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="services_trainingpartner.html" class="navi" title="">' + servicesSub6 + '</a></p>'); }
       if   (locContains('_catalog'))
            { document.write('<p class="naviactive"><a href="services_catalog.html" class="naviactive" title="">' + servicesSub5 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="services_catalog.html" class="navi" title="">' + servicesSub5 + '</a></p>'); }
       document.write('</div>');
     }
  if (menu == "customers")
     { document.write('<div id="div_customers"' + str + '>');
       if   (locContains('_references'))
            { document.write('<p class="naviactive"><a href="customers_references.html" class="naviactive" title="">' + customersSub1 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="customers_references.html" class="navi" title="">' + customersSub1 + '</a></p>'); }
       if   (locContains('_casestories'))
            { document.write('<p class="naviactive"><a href="customers_casestories.html" class="naviactive" title="">' + customersSub2 + '</a></p>'); }
       else { document.write('<p class="navi"><a href="customers_casestories.html" class="navi" title="">' + customersSub2 + '</a></p>'); }
       document.write('</div>');
     }
}


/* ----------------------------------------------------- */
/* Add footer to main content column                     */
/* (you can add additional text in the html page, but    */
/* without <p>, i.e. write only the text after calling   */
/* Footer();)                                            */
/* ----------------------------------------------------- */

function Footer(spacing)
{ 
  var topStatus = 'zum Seitenanfang';
  var copyrightLink = 'Rechtliche Hinweise und Datenschutz';
  var optimized = 'Optimiert f&uuml;r 1024&times;768 Pixel und den Microsoft IE ab Version 4.x.';

  /* spacing (standard is 85px) | legal notice | optimized */
  if   (spacing == 0)
       { document.write('<p class="smallgray" style="line-height:2.0; margin-top:85px; text-align:center"><a href="http://www.renostar.de/?q=renostar-impressum-fuer-anwaelte-online" onmouseover="window.status=\'\'; return true;">' + copyrightLink + '</a><br>' + optimized + '<br>'); }
  else { document.write('<p class="smallgray" style="line-height:2.0; margin-top:' + spacing + 'px; text-align:center"><a href="http://www.renostar.de/?q=renostar-impressum-fuer-anwaelte-online" onmouseover="window.status=\'\'; return true;">' + copyrightLink + '</a><br>' + optimized + '<br>'); }
}

/* ----------------------------------------------------- */
/* Closes main content cell                              */
/* And opens small content column if needed              */
/* ----------------------------------------------------- */

function SmallColumn()
{ 
  /* 3. TR - 5.-7. TD: close main content cell and if 2-columns for text: add spacer and open sub content cell */
  document.write('</p>');
  document.write('</td>');
  if   (columnspan == '') /* note 10 */
       { document.write('<td width="40" height="100%" valign="top"><img src="http://www.renostar.de/legal-office/legal-office/images/_blank.gif" width="40" height="1" alt="" border="0"></td>');
         document.write('<td width="178" height="100%" valign="top"><img src="http://www.renostar.de/legal-office/legal-office/images/_blank.gif" width="178" height="199" alt="" border="0"></p>');
       }
}

/* ----------------------------------------------------- */
/* Closes website                                        */
/* ----------------------------------------------------- */

function EndOfWebsite()
{ 
  /* 3. TR - 7.+8. TD: if 2-columns for text, close sub content cell | spacer */
  if   (columnspan == '') { document.write('</td>'); } /* note 10 */
  document.write('<td width="16" height="100%" valign="top"><img src="http://www.renostar.de/legal-office/legal-office/images/_blank.gif" width="16" height="1" alt="" border="0"></td></tr>');

  /* 4. TR: small empty row | close table and website */
  document.write('<tr><td height="5" colspan="8"></td></tr>'); /* note 9 */
  document.write('</table></body></html>');
}


/* ----------------------------------------------------- */
/* Global variables and utilities                        */
/* ----------------------------------------------------- */

var preloadFlag = false;
var columnspan; /* note 10 */

function newImage(arg)
{ if (document.images)
     { rslt = new Image();
       rslt.src = arg;
       return rslt;
     }
}

function changeImages()
{ if (document.images && (preloadFlag == true))
     { for (var i=0; i<changeImages.arguments.length; i+=2)
           { document[changeImages.arguments[i]].src = changeImages.arguments[i+1]; }
     }
}

/* Does URL contains certain string (=strSubstr)? */
function locContains(strSubstr)
{
  var strHREF = new String(window.location.href);
  strHREF = strHREF.toLowerCase();
  if   (strHREF.indexOf(strSubstr) != -1)
       { return true; }
  else { return false; }
}

/* Preload navigation buttons */
function preloadImages()
{ if (document.images)
     { m_company_over = newImage("http://www.renostar.de/legal-office/legal-office/images/m_company-over.gif");
       m_company_down = newImage("http://www.renostar.de/legal-office/legal-office/images/m_company-down.gif");
       m_products_over = newImage("http://www.renostar.de/legal-office/legal-office/images/m_products-over.gif");
       m_products_down = newImage("http://www.renostar.de/legal-office/legal-office/images/m_products-down.gif");
       m_services_over = newImage("http://www.renostar.de/legal-office/legal-office/images/m_services-over.gif");
       m_services_down = newImage("http://www.renostar.de/legal-office/legal-office/images/m_services-down.gif");
       m_customers_over = newImage("http://www.renostar.de/legal-office/legal-office/images/m_customers-over.gif");
       m_customers_down = newImage("http://www.renostar.de/legal-office/legal-office/images/m_customers-down.gif");
       m_download_over = newImage("http://www.renostar.de/legal-office/legal-office/images/m_download-over.gif");
       m_download_down = newImage("http://www.renostar.de/legal-office/legal-office/images/m_download-down.gif");
       preloadFlag = true;
     }
}


/* ----------------------------------------------------- */
/* Notes to implementation                               */
/* ----------------------------------------------------- */
/*
Note 1:  document.write('<body onload="preloadImages()">'); would not work, 
         because the body statement will only be written in HTML file, i.e. 
         function would not be called
Note 2:  Only necessary for NS (top of page)
Note 3:  Table width = 1004 px (+ scrollbar 20px = 1024px).
         If set to 100% and screen resolution is different
         to 1024, then content will be pressed or stretched
Note 4:  Design with 8 columns: 
         spacer 16px + menu 142px + picture-stripe 82px + spacer 50px + 
         main content 480px + spacer 40px + sub content 178px + spacer 16px = 1004px 
         Proof with alert(document.body.offsetWidth);
Note 5:  Variable parentDir set in first called statement = preloadImages 
         Necessary for the lower customer directories
Note 6:  Set "menuLink" instead of "menu" if you don't want to 
         show submenu when certain submenu item is clicked
Note 7:  Indent of sub menus made with "&nbsp", because margin-left 
         in css doesn't work with IE 6
Note 8:  If error: See whether div=name is defined and closed (</div>)
Note 9:  "colspan=7" (instead of 8) because picture-stripe has rowspan=2
Note 10: Web page is standardized programmed with 2-columns for text -- 
         call function "DesignOfWebsite(2)".
         For special pages a 1-column page is possible (DesignOfWebsite(1)) 
         -- this is programmed with the help of "colspan".
Note 11: Logo with transparent space on the left side is only used for pages 
         with only 1 text column (otherwise logo would be at the right border). 
         Logo 2px smaller (478 instead 480) to be sure not to stretch 
         text column.
Note 12: Vor preloadImages den Befehl redirectLang(); setzen
         var languageStatus = 'Englisch-sprachige Website - English website';
         var languageLink  = 'ENGLISH';
         var languageHref  = 'en/index.html';
         document.write('<td class="menu" align="right"><a class="menu" href="' + languageHref + '" onmouseover="window.status=\'' + languageStatus + '\'; return true;" onmouseout="window.status=\'\'; return true;">' + languageLink + '</a></td>');
         Englisch als grauer nicht-anklickbarer Link: document.write('<td class="menu" style="color:#71757F" align="right">' + languageLink + '</td>');
*/
