function preloadImages( ) {
  _image1 = new Image( );
  _image1.src = '/grafik/menu-oldtimer.gif';
  _image2 = new Image( );
  _image2.src = '/grafik/menu-anhaenger.gif';
  _image3 = new Image( );
  _image3.src = '/grafik/menu-werkstatt.gif';
  _image4 = new Image( );
  _image4.src = '/grafik/menu-info.gif';
}

var _default_menu = '';
function loadHighlight( _new ) {
  _image = document.getElementById('menu');
  if( !_default_menu ) {
    _default_menu = _image.src;
  }
  _image.src = '/grafik/menu-' + _new + '.gif';
}

function loadDefault( ) {
  if( _default_menu ) {
    _image = document.getElementById('menu');
    _image.src = _default_menu;
  }
}

function openImage( _url , _width , _height ) {
  _width += 30;
  _height += 30;
  var _eigenschaften = 'width=' + _width + ','
                      +'height=' + _height + ','
                      +'menubar=no,'
                      +'left=250,'
                      +'top=150,'
                      +'resizable=yes,'
                      +'scrollbars=yes,'
                      +'toolbar=0,'
                      +'location=0,'
                      +'status=0';
  var newWindow = window.open( _url , 'viewImage' + _width + _height , _eigenschaften );
  newWindow.focus( );
}

var _orig_images = new Array( );
function resizeImage( _this , _src , _width , _height ) {
  _image = _this.firstChild; 
  
  if( !_orig_images[ _src ] ) {
    _orig_images[ _src ] = new Array( );
    _orig_images[ _src ][ 'src' ]    = _image.src;
    _orig_images[ _src ][ 'width' ]  = _image.width;
    _orig_images[ _src ][ 'height' ] = _image.height;
    _orig_images[ _src ][ 'status' ] = 0;
  }
  
  if( _orig_images[ _src ][ 'status' ] ) {
    _image.src    = _orig_images[ _src ][ 'src' ];
    _image.width  = _orig_images[ _src ][ 'width' ];
    _image.height = _orig_images[ _src ][ 'height' ];
    _orig_images[ _src ][ 'status' ] = 0;
  }
  else {
    _image.src    = _src;
    _image.width  = _width;
    _image.height = _height;
    _orig_images[ _src ][ 'status' ] = 1;
  }
}

