// Buttons creation and image autoloading
// Y.Rutschle
// (c) 1999 NLD


// generates HTML code for a changing button. Call as:
// makeButton ('foo.html','default.gif','select.gif','click.gif')
// default is the normal button aspect
// select is when the mouse is over the button
// click is when the mouse clicks the button

var _buttonNumber=1;

function makeButton(link,img1,img2,img3) {
  var i = _buttonNumber++;
  document.writeln ("<a href='"+link+"'");
  document.writeln ("<img border=no src=\"../"+img1+"\" name=\"Button_"+i+"\"> ");
  document.writeln ("  onClick=\"document.Button_"+i+".src='"+img3+"'\"");
  document.writeln ("  onMouseOver=\"document.Button_"+i+".src='"+img1+"'\"");
  document.writeln ("  onMouseOut=\"document.Button_"+i+".src='"+img2+"'\"> ");
  document.writeln ("</a>");
}

function makeBeanButton( link, caption ) {
  var i = _buttonNumber++;
  document.writeln( "<a href='"+link+"'" );
  document.writeln( "  onClick=\"document.Button_"+i+".src='bean3_down.gif'\"");
  document.writeln ("  onMouseOver=\"document.Button_"+i+".src='bean2_up.gif'\"");
  document.writeln ("  onMouseOut=\"document.Button_"+i+".src='bean_mo.gif'\"> ");
  document.writeln ("<img border=no src=\"bean_mo.gif\" name=\"Button_"+i+"\"><br> ");
  document.writeln (caption);
  document.writeln ("</a>");
}

// allows automatic pre-loading of pictures. Call from the header as:
// autoLoad('pic1.gif','pic2.gif');
var myArrayForPictures = new Array();
function autoLoad () {
  for (var i=0; i<arguments.length; i++) {
    myArrayForPictures[i] = new Image();
    myArrayForPictures[i] = arguments[i];
  }
}

