/* File: webcards.js as of 20001225
   Author: Tobias Ferber <ferber@icada.de> */

function setimg(img,suffix) {
  img.src= img.src.substring(0,img.src.length-suffix.length)+suffix;
}

// Change an image for approx 1/2 second
function flashimg(img,suffix) {
  var old= img.src.substring(img.src.length-suffix.length)
  setimg(img,suffix);
  window.setTimeout("setimg(document."+img.name+",'"+old+"')", 420);
}

// pre-load images
var imgcache= new Array();
function cacheImage(src) {
  var x= imgcache.length;
  imgcache[x]= new Image();
  imgcache[x].src= src;
}

cacheImage('../share/1x1.gif');

cacheImage('../share/icada-0.gif');
cacheImage('../share/icada-1.gif');
cacheImage('../share/icada-2.gif');
		    
cacheImage('../share/slogan-0.gif');
cacheImage('../share/slogan-1.gif');
cacheImage('../share/slogan-2.gif');
cacheImage('../share/slogan-3.gif');
cacheImage('../share/slogan-4.gif');
		    
cacheImage('../share/dots-0.gif');
cacheImage('../share/dots-1.gif');
cacheImage('../share/dots-2.gif');

// Blink the i-dot (once) after 4 seconds
//window.setTimeout("flashimg(document.icada,'-1.gif')", 4000);

// Flash the slogan.

// Note: This also replaces the GIF anim with a single static image
// which (a) returns the static image when un-flashing and (b) makes
// sure the correct image is displayed, even if the browser does not
// support GIF animations.

// Note also that the <body onload="..."> tag sets the anim so that we
// can be sure to display the anim only if the user's browser supports
// JavaScript.

window.setTimeout("setimg(document.slogan,'-3.gif')", 5000);
window.setTimeout("setimg(document.slogan,'-1.gif')", 7000);

/*
// Start the i-dot blinker for 10 seconds ...
var blinker=
  window.setInterval("flashimg(document.icada,'-1.gif')", 1000);
window.setTimeout("clearInterval("+blinker+")", 10000);
*/

//alert( window.prompt("Foo", "Bar") );

