   NameArray = new Array();
   ImgArray  = new Array();
   MenuSel   = null;

   function preload()
    {
     var preloadarg = preload.arguments;
     var i = NameArray.length;
     for (var j=0; j<preloadarg.length; j+=3)
      {
        if (preloadarg[j].search(/document/) != -1)
          objStr = preloadarg[j];   // document kommt im Parameter bereits vor
        else
          objStr = 'document.'+preloadarg[j];
	obj = eval(objStr);
	if (obj != null) {
	 NameArray[i] = preloadarg[j];
	 ImgArray[i]  = new Array;
	 ImgArray[i][0] = new Image;
	 ImgArray[i][0].src = obj.src;
	 ImgArray[i][1] = new Image;
	 if (preloadarg[j+1] != null)
	   ImgArray[i][1].src = preloadarg[j+1];
	 else
	   ImgArray[i][1].src = obj.src;
	 ImgArray[i][2] = new Image;
	 if (preloadarg[j+2] != null)
	   ImgArray[i][2].src = preloadarg[j+2];
	 else
	   ImgArray[i][2].src = obj.src; 
/*	 ImgArray[i][1].src = preloadarg[j+1];
	 ImgArray[i][2] = new Image;
	 ImgArray[i][2].src = preloadarg[j+2]; */
	 i++;
	}
      }
    } // end of function preload()

   function resetimg()
    {
      LastSel = MenuSel;		// letzte Selection kurz zwischenspeichern
      if (LastSel != null)
      {
	showimg(LastSel, 0, 1);		// letzte Selection wieder normal
	MenuSel = null;			// aktuelle Selektion loeschen
      }
    }

   function showimg()
    {
     var showimgarg = showimg.arguments;
     if (MenuSel != showimgarg[0] || showimgarg.length > 2) {
      if (showimgarg[0].search(/document/) != -1)
        objStr = showimgarg[0];   // document kommt im Parameter bereits vor
      else
        objStr = 'document.'+showimgarg[0];
      obj = eval(objStr);
      if (obj != null)
       for (var i=0; i<NameArray.length; i++)
        if (NameArray[i] == showimgarg[0]) {
	 j = showimgarg[1];
	 obj.src = ImgArray[i][j].src;
	 if (j == 2) { // bei Event onclick
	  resetimg();			// letzte Selection wieder normal anzeigen
	  MenuSel = showimgarg[0];	// aktuelle Selection merken
	 }
	 break;
        }
     }
    } // end of function showimg()

