  /**
  * Navigation platzieren
  * @author Margrit Schnackenberg / Torsten K?hler
  * @param  -
  * @return -
  */ 
  
  // Eventhandler setzen
  window.onresize = setAllWidthAndHeight;	
	
  /*
    Funktion
  */  
  function jumpTo(jump) {
    if (document.getElementById('ende') && document.getElementById(jump)) {
      document.getElementById('ende').scrollIntoView(true);
      document.getElementById(jump).scrollIntoView(true);
    }
  }
  
  /*
    Funktion
  */  
  function setMainWidth () {
    if (!document.getElementById('main'))
      return;

    var windowWidth = 0;
    var windowHeight = 1;
  
    var aWindowSize = getWindowSize();

    var aContentElement = document.getElementsByName('contentelement');
    var newWidth = (aContentElement.length * 1099 + 202 * (aContentElement.length-1) + 20 );
    var w;
    if (newWidth < aWindowSize[windowWidth])
      w = aWindowSize[windowWidth] - 20;
    else
      w = newWidth;
    
    document.getElementById('main').style.width = w + "px";
    aContentElement[aContentElement.length-1].style.width = "1099px";
  }
  
  /*
    Funktion
  */  
  function setMainContainerHeight (height) {
    if (document.getElementById('mainContainer'))
      document.getElementById('mainContainer').style.height = height + "px";
  }

  /*
    Funktion
  */  
  function setMainContainerWidth (width) {
    if (document.getElementById('mainContainer'))
      document.getElementById('mainContainer').style.width = width + "px";
  }
  
  /*
    Funktion
  */  
  function setTopWidth (width) {
    if (document.getElementById('top'))
      document.getElementById('top').style.width = width + "px";
  }
  
  /*
    Funktion
  */  
  function getWindowSize() {
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
      myWidth = window.innerWidth;
      myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      //IE 4 compatible
      myWidth = document.body.clientWidth;
      myHeight = document.body.clientHeight;
    }

    var windowWidth = 0;
    var windowHeight = 1;
    var aWindowSize = new Array(2);
    
    aWindowSize[windowWidth] = myWidth;
    aWindowSize[windowHeight] = myHeight;
    
    return aWindowSize;
  }  

  /*
    Funktion
  */  
  function setAllWidthAndHeight () {
    var windowWidth = 0;
    var windowHeight = 1;
  
    var aWindowSize = getWindowSize();
   
    setTopWidth (aWindowSize[windowWidth] - 20);

    if (navigator.userAgent.match(/AppleWebKit/i) && navigator.userAgent.match(/Mobile/i)) { 
      //alert("Ich bin ein iPhone");
      /*window.location.replace('/iphone'); hier ein Beispiel mit Weiterleitung*/
    }
    else {
      setMainContainerWidth(aWindowSize[windowWidth]);
      setMainWidth();
      setMainContainerHeight(aWindowSize[windowHeight] - 86);
    }
  }
  
  
  /*
    Funktion
  */  
  function showSubnaviAsText (subnavitext, show) {
    if (!document.getElementById('path'))
      return;
      
    if (show == true)
      document.getElementById('path').innerHTML = subnavitext;
    else
      document.getElementById('path').innerHTML = '';
  }
  
  /*
    open a popup window in Part Watches /Collectible
  */
  function nw (url) {
    window.open (url, "Freisfeld Uhren", "width=600,height=700,scrollbars=yes");
    //return false;
  }
  