
/*  holds the names/locations of images for
    the buttons in the "pushed state" and "normal state"   */
var the_imagesNotPushedName = new Array('images/FlagCanada.gif','images/FlagUS.gif','images/Register.GIF','images/Register2.GIF');
var the_imagesPushedName = new Array('images/FlagCanada.gif','images/FlagUS.gif','images/RegisterPush.GIF','images/Register2Push.GIF');

/*  holds the actual images (cached) for
    the buttons in the "pushed state" and "normal state"   */
var the_imagesNotPushed = new Array();
var the_imagesPushed = new Array();


/*   Preload Images into cache   */

function doPreload()
{
 for(loop = 0; loop < the_imagesPushedName.length; loop++)
 {
  the_imagesNotPushed[loop] = new Image();
  the_imagesNotPushed[loop].src = the_imagesNotPushedName[loop];
  the_imagesPushed[loop] = new Image();
  the_imagesPushed[loop].src = the_imagesPushedName[loop];
 }
}

/*   Display Images as "Pushed" for onMouseOver or
     "Normal" for onMouseOut   */

function doonMouseOver(buttonPushed)
{
 if(the_imagesPushed[buttonPushed].complete)
   /* only change image if it has loaded */
 {
  document.images[buttonPushed].src = the_imagesPushed[buttonPushed].src;
 }
}

function doonMouseOut(buttonPushed)
{
 if(the_imagesNotPushed[buttonPushed].complete)
   /* only change image if it has loaded */
 {
  document.images[buttonPushed].src = the_imagesNotPushed[buttonPushed].src;
 }
}
