// $Header: /srv/sources/pkg/salbabixware/web-salbaba-presentation/salbaba/s.salbaba.js 25.2 2007/12/16 01:35:10 martin Exp $
//++
//  FACILITY:  WEB
//
//      Copyright (c) Martin Salbaba $RelFromTo$
//
//      All  Rights Reserved. Unpublished rights reserved under the copyright laws
//      of Austria.
//
//      The software contained on this media is proprietary to  and  embodies  the
//      confidential  technology  of  Martin Salbaba. Possession, use, duplication or
//      dissemination of the software and media is authorized only pursuant  to  a
//      valid written license from Martin Salbaba.
//
//  PACKAGE DESCRIPTION:
//
//      salbaba.js:
//        scripts to implement home page
//
//  MODIFICATION HISTORY:
//
//      $Log$
//
//--

//++
//  FUNCTIONAL DESCRIPTION:
//
//      WindowWidth:
//        compute window width
//
//  FORMAL PARAMETERS:
//
//      none
//
//  GLOBAL PARAMETERS:
//
//      none
//
//  RETURN VALUE:
//
//      window width
//
//  EXCEPTIONS:
//
//      <tbd>
//
//  PRECONDITIONS:
//
//      <tbd>
//
//--

function WindowWidth () {
  if (window.innerWidth)
    {
      return window.innerWidth;
    }
  else
    if (document.body && document.body.offsetWidth)
      {
        return document.body.offsetWidth;
      }
    else
      {
        return screen.width;
      }
}

//++
//  FUNCTIONAL DESCRIPTION:
//
//      WindowHeight:
//        compute window height
//
//  FORMAL PARAMETERS:
//
//      none
//
//  GLOBAL PARAMETERS:
//
//      none
//
//  RETURN VALUE:
//
//      window height
//
//  EXCEPTIONS:
//
//      <tbd>
//
//  PRECONDITIONS:
//
//      <tbd>
//
//--

function WindowHeight () {
  if (window.innerHeight)
    {
      return window.innerHeight;
    }
  else
    if (document.body && document.body.offsetHeight)
      {
        return document.body.offsetHeight;
      }
    else
      {
        return screen.heigth;
      }
}

//++
//  FUNCTIONAL DESCRIPTION:
//
//      ResizeLogo:
//        insert the correct logo into page. logo size depends on window size
//
//  FORMAL PARAMETERS:
//
//      REL string with relocation info
//
//  GLOBAL PARAMETERS:
//
//      none
//
//  RETURN VALUE:
//
//      none
//
//  EXCEPTIONS:
//
//      <tbd>
//
//  PRECONDITIONS:
//
//      <tbd>
//
//--

function ResizeLogo(REL) {

// debug info
// window.document.write("<p>heigth="+WindowHeight()+"</p>");

  if (REL != "")
    {
       window.document.write("<a href='"+REL+"index.de.html' class='hidden'>");
    }
  if (WindowHeight()  < 601)
    {
      window.document.write("<img src='"+REL+"salbabalogo-2.gif' alt='' border='0' class='menulogo'>");
    }
  else
    {
      if (WindowHeight()  < 769)
        {
          window.document.write("<img src='"+REL+"salbabalogo-1.gif' alt='' border='0' class='menulogo'>");
        }
      else
        {
          window.document.write("<img src='"+REL+"salbabalogo.gif' alt='' border='0' class='menulogo'>");
        }
    }
  if (REL != "")
    {
       window.document.write("</a>");
    }
}

//++
//  FUNCTIONAL DESCRIPTION:
//
//      ResizeStern:
//        insert the correct Stern into page. Stern size depends on window size
//
//  FORMAL PARAMETERS:
//
//      REL string with relocation info
//
//  GLOBAL PARAMETERS:
//
//      none
//
//  RETURN VALUE:
//
//      none
//
//  EXCEPTIONS:
//
//      <tbd>
//
//  PRECONDITIONS:
//
//      <tbd>
//
//--

function ResizeStern(REL) {

// debug info
// window.document.write("<p>heigth="+WindowHeight()+"</p>");

  if (WindowHeight()  < 601)
    {
      window.document.write("<img src='"+REL+"stern-2.png' alt='i.mdm' border='0'>");
    }
  else
    {
      if (WindowHeight()  < 769)
        {
          window.document.write("<img src='"+REL+"stern-1.png' alt='i.mdm' border='0' class='menuStern'>");
        }
      else
        {
          window.document.write("<img src='"+REL+"stern.png' alt='i.mdm' border='0' class='menuStern'>");
        }
    }
}

