// author: Sebastian Waschik
// created: 2003-02-08
// RCS-ID: $Id: funcs.js,v 1.2 2009-05-19 10:27:22 ssh-145505-sebastian Exp $

function preLoadImage(image) {
  var i=new Image();
  i.src=image;
}



// TODO: ueberarbeiten, nicht abhaengig von gif Dateien machen (TE)

function getImageBase(src) {
  index=src.lastIndexOf(".")-1;
  if(index<0) {
    return "";
  } else {
     if( src.substr(index,1)=="1") {
       index--;
       if (index<0) {
         return "";
       }
     }
     return src.substr(0,index+1);
  }
}


function doClick(name) {
  if(document.images) {
    document.images[name].src=getImageBase(document.images[name].src)+"1.gif";
  }
  return true;
}


function doMouseOver(name) {
  if(document.images) {
    document.images[name].src=getImageBase(document.images[name].src)+"1.gif";
  }
  //window.status=document.images[name].alt;
  return true;
}


function doMouseOut(name) {
  if(document.images) {
    document.images[name].src=getImageBase(document.images[name].src)+".gif";
  }
  //window.status="";
  return true;
}


function gotoSelect(select) {
  var url=select.options[select.options.selectedIndex].value;
  if (url!="#") {
    top.window.location.href = url;
  }
  select.options.selectedIndex=0;
  select.blur();
}


function preLoadImages() {
  var args=preLoadImages.arguments;
  if (document.images) {
    for (var i=0; i<args.length; i++) {
      preLoadImage(getImageBase(document.images[args[i]].src)+"1.gif");
    }
  }
}


function changeFrame(frame, url) {
    parent.frames[frame].location.href = url;
}


function doLoad() {
  if ((typeof myLoad) == "function") {
    return myLoad();
  } else {
    return true;
  }
}


function doBegin() {
  return true;
}


function doEnd() {
  return true;
}

// Local Variables:
// delete-trailing-whitespace: t
// tab-width: 2
// End:

