// author: Sebastian Waschik
// created: 2003/02/08
// changed: 2003/03/01
// last changed: 2003/03/29

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 doLoad() {
  return true;
}


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



// *************** scroll bottom line ****************************************
function scrolButtomLine(seed) {
  var msg = "-stop-  Rainer Suter - www.idc-pro.com  -stop-  Mobile: +63  916 640 0629 -stop-";
  var out = " ";
  var c   = 1;
  if (seed > 100) {
    seed = seed -1;
    var cmd = "scrolButtomLine(" + seed + ")";
    timerTwo = window.setTimeout(cmd,100);
  }
  else if (seed <= 100 && seed > 0) {
    for (c = 0; c < seed; c++) {
      out += " ";
    }
    out += msg;
    seed = seed -1;
    var cmd="scrolButtomLine(" + seed + ")";
    window.status = out;
    timerTwo = window.setTimeout(cmd,100);
  }
  else if (seed <= 0) {
    if (-seed < msg.length) {
      out += msg.substring(-seed, msg.length);
		seed = seed -1;
      var cmd="scrolButtomLine(" + seed + ")";
      window.status = out;
      timerTwo = window.setTimeout(cmd,100);
    }
    else {
      window.status = " ";
      timerTwo = window.setTimeout("scrolButtomLine(100)",75);
    }
  }
}

