<!--- Begin
var currentImage = 0;  
var totalImages = 4; 
var imageList = new Array('btn_on.gif', 'btn_on2.gif', 'btn_err.gif', 'btn_off.gif');

function preload() 
{
  this.img = new Image();  
  this.img.src = imageList[currentImage];  
  this.img.onload = proceed;  
}

function proceed() 
{
  if (currentImage < totalImages - 1) 
  {
    currentImage++;    
    preload();    
  } 
} 

var robotTop = 0;
var robotMid = 0;
var robotLow = 0;

function setImage(name, source) { document.images[name].src = source; return true; }

function radioKeypad(section, type, source) 
{
  var image = ' ';
  if (section == 'head') 
  { 
    if (robotTop != type) 
    { 
      if (robotTop != 0) { image = section + robotTop; setImage(image, 'btn_off.gif'); };
      robotTop = type; 
    };
    image = section + type;
    setImage(image, source);
  };

  if (section == 'torso') 
  {
  if (robotMid != type) 
    { 
      if (robotMid != 0) { image = section + robotMid; setImage(image, 'btn_off.gif'); } 
      robotMid = type; 
    };
    image = section + type;
    setImage(image, source);
  };

  if (section == 'feet') 
  {
  if (robotLow != type) 
    { 
      if (robotLow != 0) { image = section + robotLow; setImage(image, 'btn_off.gif'); } 
      robotLow = type; 
    };
    image = section + type;
    setImage(image, source);
  };

}

function loadpart(component, type)
{
  if (component == 1) {section='alpha';}
  if (component == 2) {section='beta';}
  if (component == 3) {section='gamma';}
  document[section].src = section + type + '.gif';
}

function loadrandom()
{
  pic1 = 1+Math.round(Math.random()*8);
  pic2 = 1+Math.round(Math.random()*8);
  pic3 = 1+Math.round(Math.random()*8);
  loadpart(1, pic1);
  if (robotTop != 0) {setImage('head' + robotTop,'btn_off.gif');};
  setImage('head' + pic1,'btn_on2.gif');
  robotTop = pic1;
  loadpart(2, pic2);
  if (robotMid != 0) {setImage('torso' + robotMid,'btn_off.gif');};
  setImage('torso' + pic2, 'btn_on2.gif');
  robotMid = pic2;
  loadpart(3, pic3);
  if (robotLow != 0) {setImage('feet' + robotLow,'btn_off.gif');};
  setImage('feet' + pic3, 'btn_on2.gif');
  robotLow = pic3;
}
// End --->