
here the code:
function active is new, you have to create an object of it with all images,
that should stay clicked (see end of code).

  function active() {
    z1=active.arguments.length;
    if (z1>0) {
      this.dat=new mArray(z1);
      for (z2=0;z2<z1;z2++) {
        this.dat[z2]=active.arguments[z2];
        this.dat[z2].ac=this;
      }
    }
    this.dea=deactiveall;
  }
  function deactiveall() {
    for (z1=0;z1<this.dat.length;z1++) this.dat[z1].mdeactv();
  }

  function img_s(name,norm_pic,over_pic,over_txt,clck_pic) {
    this.name=name;
    if (over_txt==null) this.over_txt=''; else this.over_txt=over_txt;
    if (flip_img) {
      this.dat=new mArray(3);
      for (z1=0;z1<3;z1++) this.dat[z1]=new Image();
      this.dat[0].src=norm_pic;
      this.dat[1].src=over_pic;
      if (clck_pic==null) this.dat[2]=this.dat[1];
        else this.dat[2].src=clck_pic;
    }
    this.active=false;
    this.disp=display_pic;
    this.mactv=make_active;
    this.mdeactv=make_deactive;
    this.out=display_pic_out;
    this.ovr=display_pic_ovr;
    this.clk=display_pic_clk;
    this.ac=null;
  }
  function display_pic(n) {
    if (n==1) window.status=this.over_txt; else window.status='';
    if (flip_img)
      if (this.active==true) document[this.name].src=this.dat[2].src; else
        document[this.name].src=this.dat[n].src;
  }
  function display_pic_out() { this.disp(0); };
  function display_pic_ovr() { this.disp(1); };
  function display_pic_clk() {
    this.disp(2);
    if (!this.active) {		//avoid flicker
      this.ac.dea();
      this.mactv();
     } };
  function make_active() {
    this.active=true;
    this.disp(0);
  }
  function make_deactive() {
    this.active=false;
    this.disp(0);
  }

  flip_img=false;
  play_snds=false;
  if ( ((navigator.appName.indexOf('Netscape') != -1) &&
        (parseInt(navigator.appVersion) >= 3))
    || ((navigator.appName.indexOf('Microsoft') != -1) &&
        (parseInt(navigator.appVersion) >= 4))
    || (navigator.userAgent.indexOf("Mozilla/3.0") != -1)
    || (navigator.userAgent.indexOf("Mozilla/4.0") != -1) ) {
      flip_img=true;
      play_snds=true;
  }

here an example with 4 images (summary from example-website (main.html)):
  img1 = new img_s('title','p00pat.gif','p00move.gif','Title','p00on.gif');
  img2 = new img_s('page1','p01pat.gif','p01move.gif','Page 1','p01on.gif');
  img3 = new img_s('page2','p02pat.gif','p02move.gif','Page 2','p02on.gif');
  img4 = new img_s('page3','p03pat.gif','p03move.gif','Page 3','p03on.gif');
  acti = new active(img1,img2,img3,img4);
You could use this object in the target-frames to be sure that the right
button is pressed, but as I said before: there is a risk that this object
is already deleted if called, or if the page is loaded directly without
frames (summary from example-website (title.html)):
  <BODY BGCOLOR="#000000" TEXT="#ffffff" LINK="#ff00ff" VLINK="#00ffff"
   onLoad="top.toc.img1.clk()" onUnload="top.toc.acti.dea()">

