//debug=window.open("debug.html","Fenster1","width=710,height=700,left=0,top=0,scrollbars=yes");
//debug.document.write('<pre style="font-size:11px;">debug</pre>');

function hover() {
  tmp=this.src;
//debug.document.write('<pre style="font-size:11px;">hover old: '+tmp+'</pre>');
  window.status=tmp;
  suffix=tmp.substring(tmp.lastIndexOf('.'));
  newsrc=tmp.substring(0,tmp.lastIndexOf('link'))+'active'+suffix;
  if (newsrc=='active'+suffix) return false;
//debug.document.write('<pre style="font-size:11px;">hover new: '+newsrc+'</pre>');
  this.src=newsrc;
}

function link() {
  tmp=this.src;
//debug.document.write('<pre style="font-size:11px;">link  old: '+tmp+'</pre>');
  window.status=tmp;
  suffix=tmp.substring(tmp.lastIndexOf('.'));
  newsrc=tmp.substring(0,tmp.lastIndexOf('active'))+'link'+suffix;
  if (newsrc=='link'+suffix) return false;
//debug.document.write('<pre style="font-size:11px;">link  new: '+newsrc+'</pre>');
  this.src=newsrc;
}


function prepare_rollover() {
  var preloadedImages=new Array();

  var imageCount=document.images.length;
  for (var i=0; i<imageCount; i++) {

    path=document.images[i].src.split("/");      
    file=path[path.length-1];
    parts=file.split(".");
    ext=parts[parts.length-1];
    if (parts.length > 2) {
      status=parts[parts.length-2];
      if (status=="link") {
        preloadedImages[i]=new Image();
        suffix = document.images[i].src.substring(document.images[i].src.lastIndexOf('.'));
        preloadedImages[i].src=document.images[i].src.substring(0,document.images[i].src.lastIndexOf('link'))+'active'+suffix;
        document.images[i].onmouseover=hover;
        document.images[i].onmouseout=link;
      }
    }
  }
return('ende');
}
