<!--
// <![CDATA[

  var currid = -1;
  var currname = null;
  var blinknodes = new Array( );
  var blinknodesclass = new Array( );
  var blinkcurrent = 0;
  var direction = 0;
  var blinkdelay = 60;
  var menutimeout = 500;

  /* function displays provided object */
  function display( o )
  {
    var id = o.id;
    id = id.replace( 'menu', '' );
    id = id.replace( 'sub', '' );
    
    if( document )
    {
      var d = document.getElementById( "sub" + id );
      if( d )
      {
        cleartimeouts( id );
        d.style.display = 'block';
      }
    }
  }

  /* hide object object with specfied id */
  function hide( id )
  {
    if( document )
    {
      var d = document.getElementById( "sub" + id );

      if( d )
      {
        currid = -1;
        currname = null;
        d.style.display = 'none';
      }
    }
  }

  /* set timer for menu to disappear */
  function timeout( o )
  {
    var id = o.id;
    id = id.replace( 'menu', '' );
    id = id.replace( 'sub', '' );

    cleartimeouts( id );
    currid = setTimeout( "hide( '" + id + "' );", menutimeout );
    currname = id;
  }

  /* remove timer if object is activated again, or hide current disp. item */
  function cleartimeouts( id )
  {
    if( currname == id )
    {
      clearTimeout( currid );
      currid = -1;
      currname = null;
    }
    else if( currname != null )
    {
      if( document )
      {
        var f = document.getElementById( "sub" + currname );
        if( f )
          f.style.display = 'none';

        clearTimeout( currid );
        currid = -1;
        currname = null;
      }
    }
  }

  /* initiate the javascripts on the menu items */
  function init_menu( )
  {
    var stop = 0;
    var run = 0;
  
    while( stop < 2 )
    {
      var d = document.getElementById( "menu" + run );

      if( d )
      {
        d.onmouseover = function( ) { display( this ) };
        d.onmouseout = function( ) { timeout( this ) };

        d = document.getElementById( "sub" + run );
        if( d )
        {
          d.onmouseover = function( ) { display( this ) };
          d.onmouseout = function( ) { timeout( this ) };
        }
      }
      else
        stop++;

      run++;
    }
    
    var executeblink = true;
    var ref = document.referrer;
    
    var start = ref.lastIndexOf( "/" );
    if( start != -1 )
    {
      start += 1;
      var len = ref.length - start;
      ref = ref.substr( start, len );
      var stop = ref.indexOf( "?" );
      if( stop != -1 )
        ref = ref.substr( 0, stop );
    }

    run = 1;
    var b = document.getElementById( "blink" + run );
    while( b )
    {
      blinknodes[run-1] = b;
      blinknodesclass[run-1] = b.className;
      
      if( blinknodes[run-1].href.indexOf( ref ) >= 0 )
        executeblink = false;

      run++;
      b = document.getElementById( "blink" + run );
    }

    if( executeblink == true )
      blink( );
  }
  
  /* blink the displayed sub menu */
  function blink( )
  {
    if( blinkcurrent >= blinknodes.length )
      return;

    var size = blinknodes[blinkcurrent].style.fontSize.indexOf( "px" );
    if( size == -1 )
      size = 11;
    else
      size = parseInt( blinknodes[blinkcurrent].style.fontSize.substring( 0, size ), 10 );

    if( direction == 0 )
    {
      if( size <= 4 )
      {
        size++;
        blinknodes[blinkcurrent].style.fontSize = size + "px";
        blinknodes[blinkcurrent].className = "subrootitemblink";
        setTimeout( 'blink( );', blinkdelay );      
        direction = 1;
      }
      else
      {
        size--;
        blinknodes[blinkcurrent].style.fontSize = size + "px";
        blinknodes[blinkcurrent].className = "subrootitemblink";
        setTimeout( 'blink( );', blinkdelay );
      }
    }
    else
    {
      if( size >= 11 )
      {
        blinknodes[blinkcurrent].style.fontSize = "11px";
        blinknodes[blinkcurrent].className = blinknodesclass[blinkcurrent];
        direction = 0;
        setTimeout( 'blink( );', blinkdelay );
        blinkcurrent++;
      }
      else
      {
        size++;
        blinknodes[blinkcurrent].style.fontSize = size + "px";
        blinknodes[blinkcurrent].className = "subrootitemblink";
        setTimeout( 'blink( );', blinkdelay );
      }
    }
  }
  
  /* function hides the displayed menu when mouse is pressed */
  function hide_menu( )
  {
    if( currid != -1 )
    {
      var d = document.getElementById( "sub" + currname );
      if( d )
        d.style.display = 'none';

      clearTimeout( currid );
      currid = -1;
      currname = null;
    }
  }
  
  if( window )
  {
    window.onload = function( ) { init_menu( ); }
    if( document )
      document.body.onmousedown = function( ) { hide_menu( ); }
  }

// ]]>
//-->
