function rand(num)
{
	return (Math.floor(Math.random() *num));
}

Images=new Array();
Images[0]="images/ad_laser.jpg"
Images[1]="images/ad_healthycheck.jpg"
Images[2]="images/ad_daycare.jpg"
Images[3]="images/ad_grooming.jpg"
Images[4]="images/ad_boarding.jpg"
Images[5]="images/ad_staff.jpg"


// This array holds the site links for each image
LinkLocations = new Array();
LinkLocations[0] = "<a href=\"pr_lasersurgery_dec06.html\">";
LinkLocations[1] = "<a href=\"veterinary.html\">";
LinkLocations[2] = "<a href=\"dogdaycare.html\">";
LinkLocations[3] = "<a href=\"grooming.html\">";
LinkLocations[4] = "<a href=\"boarding.html\">";
LinkLocations[5] = "<a href=\"ourteam.html\">";

NumberOfImages=Images.length -1;
var coachIndex = 0;
var this_cookie = new String(document.cookie);
if ( this_cookie.match(/adIndex\=(\d+)/) )
{
	adIndex = RegExp.$1;
	adIndex = ((adIndex * 1) + 1) % Images.length;
}
else
{
  adIndex = rand(NumberOfImages);
}
document.cookie = "adIndex=" + adIndex;

//Choose a random image from the list and display it on the web page
document.write(LinkLocations[adIndex],"<img src=\"", Images[adIndex], "\" border=0></a>");

