/**
 * File: show.js
 * Rotates images
 *
 * Included in index.html
 **/

var id, rand;
var aggie = new Array();

/* preload images */
aggie[0] = "<img src=\"images/aggie/aggie01.jpg\">";
aggie[1] = "<img src=\"images/aggie/aggie02.jpg\">";
aggie[2] = "<img src=\"images/aggie/aggie03.jpg\">";
aggie[3] = "<img src=\"images/aggie/aggie04.jpg\">";
aggie[4] = "<img src=\"images/aggie/aggie05.jpg\">";
aggie[5] = "<img src=\"images/aggie/aggie06.jpg\">";
aggie[6] = "<img src=\"images/aggie/aggie07.jpg\">";
aggie[7] = "<img src=\"images/aggie/aggie08.jpg\">";
aggie[8] = "<img src=\"images/aggie/aggie09.jpg\">";
aggie[9] = "<img src=\"images/aggie/aggie10.jpg\">";
aggie[10] = "<img src=\"images/aggie/aggie11.jpg\">";
aggie[11] = "<img src=\"images/aggie/aggie12.jpg\">";
aggie[12] = "<img src=\"images/aggie/aggie13.jpg\">";
aggie[13] = "<img src=\"images/aggie/aggie14.jpg\">";
aggie[14] = "<img src=\"images/aggie/aggie15.jpg\">";
aggie[15] = "<img src=\"images/aggie/aggie16.jpg\">";
aggie[16] = "<img src=\"images/aggie/aggie17.jpg\">";
aggie[17] = "<img src=\"images/aggie/aggie18.jpg\">";
aggie[18] = "<img src=\"images/aggie/aggie19.jpg\">";
aggie[19] = "<img src=\"images/aggie/aggie20.jpg\">";
aggie[20] = "<img src=\"images/aggie/aggie21.jpg\">";
aggie[21] = "<img src=\"images/aggie/aggie22.jpg\">";

function ShowAggie1(rand)
{
   if (document.getElementById)
      document.getElementById("home").innerHTML = aggie[rand];
}

function ShowAggie2(rand)
{
   if (document.getElementById)
      document.getElementById("aggie").innerHTML = aggie[rand];
}

function ShowAggie3(rand)
{
   if (document.getElementById)
      document.getElementById("rice").innerHTML = aggie[rand];
}

function ShowAggie4(rand)
{
   if (document.getElementById)
      document.getElementById("sa").innerHTML = aggie[rand];
}

function ShowAggie5(rand)
{
   if (document.getElementById)
      document.getElementById("austin").innerHTML = aggie[rand];
}

function Rotate()
{
   if (document.getElementById)
      id = setInterval("Display()", 10000);
}

function Display()
{
   var randDiv = Math.round(0.5+(4.999999*Math.random()));
   rand = Math.floor(21*Math.random());

   switch (randDiv)
   {
      case 1: ShowAggie1(rand); break;
      case 2: ShowAggie2(rand); break;
      case 3: ShowAggie3(rand); break;
      case 4: ShowAggie4(rand); break;
      case 5: ShowAggie5(rand); break;
   }
}

function Initialize()
{
   if (document.getElementById)
   {
      document.getElementById("austin").innerHTML = aggie[9];
      document.getElementById("home").innerHTML = aggie[0];
      document.getElementById("sa").innerHTML = aggie[0];
      document.getElementById("aggie").innerHTML = aggie[6];
      document.getElementById("rice").innerHTML = aggie[0];
   }  
}




