// FUNCTIONS FOR IMAGE ROTATOR
function changeMainImage(imgNum){
  var imgs = new Array;
  imgs[0]  = "images/homepage/rotator/ayyuthaya.jpg";
  imgs[1]  = "images/homepage/rotator/ayyuthayabox.jpg";
  imgs[2]  = "images/homepage/rotator/byronpresentation.jpg";
  imgs[3]  = "images/homepage/rotator/chiangmai.jpg";
  imgs[4]  = "images/homepage/rotator/fighterflag.jpg";
  imgs[5]  = "images/homepage/rotator/firstgrading.jpg";
  imgs[6]  = "images/homepage/rotator/fishnet.jpg";
  imgs[7]  = "images/homepage/rotator/jay.jpg";
  imgs[8]  = "images/homepage/rotator/jumproundhouse.jpg";
  imgs[9]  = "images/homepage/rotator/king.jpg";
  imgs[10] = "images/homepage/rotator/leighbedford2004.jpg";
  imgs[11] = "images/homepage/rotator/marcusbedford2004.jpg";
  imgs[12] = "images/homepage/rotator/marcuswaikru.jpg";
  imgs[13] = "images/homepage/rotator/shaunmarcus.jpg";
  imgs[14] = "images/homepage/rotator/traditionalwaikru.jpg";
  imgs[15] = "images/homepage/rotator/wmtofightnight.jpg";

//  Cyclical Image code:
//  imgNum = imgNum + 1;
//  if (imgNum == imgs.length){imgNum = 0;}

//  Random Image code:
  temp = randomNum(0,imgs.length)
  while (temp == imgNum){
    temp = randomNum(0,imgs.length)
  }
  imgNum = temp;

  document.main.src = imgs[imgNum];
  eval("setTimeout(\"changeMainImage("+imgNum+")\", 3500);");
}
function randomNum(lBound,uBound){
  var rndNum = Math.random();
  rndNum = Math.floor(lBound+(rndNum*(uBound-lBound)));
  return rndNum;
}
