// JavaScript Document

<!--

function get_random(maxNum)
{
  if (Math.random && Math.round)
  {
    var ranNum= Math.round(Math.random()*(maxNum-1));
    ranNum+=1;
    return ranNum;
  }
  else
  {
  today= new Date();
  hours= today.getHours();
  mins=   today.getMinutes();
  secn=  today.getSeconds();
  if (hours==19)
   hours=18;
  var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
  return ranNum;
  }
}
function getCookieData(Name)
{   
  var search = Name + "=";
  if (document.cookie.length > 0) // if there are any cookies
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)  // if cookie exists
    {
      offset += search.length;
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
      {
        end = document.cookie.length;
      }
      return unescape(document.cookie.substring(offset, end));
    }
  }
}

function changeRandomImage()
{
  var numOfPic = 11;
  var imageSources = new Array(numOfPic);
  
		imageSources[0] = "images/image_random0.jpg";
		imageSources[1] = "images/image_random13.jpg";
		imageSources[2] = "images/image_random2.jpg";
		imageSources[3] = "images/image_random3.jpg";
		imageSources[4] = "images/image_random4.jpg";
		imageSources[5] = "images/image_random11.jpg";
		imageSources[6] = "images/image_random6.jpg";
		imageSources[7] = "images/image_random7.jpg";
		imageSources[8] = "images/image_random8.jpg";
		imageSources[9] = "images/image_random9.jpg";
		imageSources[10] = "images/image_random10.jpg";
  
  if(document.images["randomizer"])
  {
    var cook = getCookieData("grandview.grandviewsite");
    var intcook = parseInt(cook);


//    document.write(intcook.toString());

    if(cook == null)
    {
      var temp = get_random(numOfPic-1);
      document.cookie = "grandview.grandviewsite=" + temp.toString();
      document.images["randomizer"].src = imageSources[temp];

    }
    else
    {

      intcook = (intcook+1)%numOfPic;
      var pic = new Image(215,216);
      pic.src = imageSources[intcook];
      document.images["randomizer"].src = pic.src;
      document.cookie = "grandview.grandviewsite=" + intcook.toString();

    }
  }
}

-->