// JavaScript Document
//declare constants for the number of images
// anytime we update the number of actual jpg images in the respective folders, these
// constants have to be updated
// Script Created by - Owiso Odera (Noon Media)
// created Date - July 20 2007
// modified Date - March 20 2008 for ImagoMoves.com
var numBackGroundImages = 9;

// Random number generator
function randomNumber(limit){
  return Math.floor(Math.random()*limit);
}
// random image selector - for document backgrounds
function randomBackGroundImage(imagePath,elementID)
{
  var imgSrc, r, currImage;
  r = randomNumber(numBackGroundImages)+1;
  
  imgSrc = imagePath+r+".jpg";
  currImage = new Image();
  currImage.src = imgSrc;
  //print a transparent dash for the browser bug
  //document.writeln('<font color="#000000">-</font>');
  document.getElementById(elementID).style.backgroundImage = "url(" + currImage.src +")"; 
}

