
function imagetool_swap() { this.imageobj.src = ( (this.imageobj.src==this.offsrc) ? this.onsrc : this.offsrc ); }
function imagetool_on() { this.imageobj.src = this.onsrc; }
function imagetool_off() { this.imageobj.src = this.offsrc; }

function ImageTool(layer,name,onsrc) {
  this.name     = name;
  if(layer && document.layers) { this.imageobj = document.layers[layer].document.images[name]; }
  else                         { this.imageobj = document.images[name]; }
  this.offsrc   = this.imageobj.src;
  this.onsrc    = onsrc;
  this.on_imgobj = new Image();
  this.on_imgobj.src = onsrc;
  this.swap     = imagetool_swap;
  this.on       = imagetool_on;
  this.off      = imagetool_off;
  return this;
}



var odas_noe,
    ospeisekarte,
    odiese_woche,
    oweinkarte,
    ozum_cafe,
    oevent_tipps,
    ohome,
    oimpressum;

function initimg() {
  odas_noe = new ImageTool( "", "das-noe", "images/button/das-noe-1.gif" );
  ospeisekarte = new ImageTool( "", "speisekarte", "images/button/speisekarte-1.gif" );
  odiese_woche = new ImageTool( "", "diese-woche", "images/button/diese-woche-1.gif" );
  oweinkarte = new ImageTool( "", "weinkarte", "images/button/weinkarte-1.gif" );
  ozum_cafe = new ImageTool( "", "zum-cafe", "images/button/zum-cafe-1.gif" );
  oevent_tipps = new ImageTool( "", "event-tipps", "images/button/event-tipps-1.gif" );
  ohome = new ImageTool( "", "home", "images/button/home-1.gif" );
  oimpressum = new ImageTool( "", "impressum", "images/button/impressum-1.gif" );
  opostkarte = new ImageTool( "", "postkarte", "images/button/postkarte-1.gif" );
}

function on( img ) { if( img ) img.on(); }

function off( img ) { if( img ) img.off(); }

