var theImages = new Array();
//Add the names of the photogrpahs to this array
theImages[0] = 'classified-front-2guys.jpg';
theImages[1] = 'classified-front-balloons.jpg';
theImages[2] = 'classified-front-bench.jpg';
theImages[3] = 'classified-front-construction.jpg';
theImages[4] = 'classified-front-couch.jpg';
theImages[5] = 'classified-front-diver.jpg';
theImages[6] = 'classified-front-hall.jpg';
theImages[7] = 'classified-front-kid.jpg';
theImages[8] = 'classified-front-manincar.jpg';
theImages[9] = 'classified-front-pumpkin.jpg';
theImages[10] = 'classified-front-puppies.jpg';
theImages[11] = 'classified-front-yellowcar.jpg';

//Add the Photographers bylines to this array. The order must match the order in the images array and there shoud be one entry for each photo.
var theNames= new Array();
theNames[0] = 'Photo by Bert Van den Roye';
theNames[1] = '';
theNames[2] = 'Photo by Chantal Van Veen';
theNames[3] = 'Photo by PixelPusher';
theNames[4] = 'Photo by Jeff Osborn';
theNames[5] = 'Photo by Rachel Mullis';
theNames[6] = 'Photo by Laura Borse';
theNames[7] = 'Photo by Crissy Watkins';
theNames[8] = 'Photo by David Kahn';
theNames[9] = 'Photo by Jyn Meyer';
theNames[10] = 'Photo by Clodiney Cruz';
theNames[11] = 'Photo by Nick Cowie';

//Add the href information for each photo to the following array there should be one entry for each photo
var theLinks = new Array();
theLinks[0] = 'http://thespec.livedeal.ca'
theLinks[1] = 'http://thespec.livedeal.ca'
theLinks[2] = 'http://thespec.livedeal.ca'
theLinks[3] = 'http://hamiltonspectator.workopolis.com/index.html'
theLinks[4] = 'https://secure.hamiltonspectator.com/classified/index.html'
theLinks[5] = 'http://thespec.livedeal.ca'
theLinks[6] = 'http://thespec.livedeal.ca'
theLinks[7] = 'http://thespec.livedeal.ca'
theLinks[8] = 'http://thespec.livedeal.ca'
theLinks[9] = 'https://secure.hamiltonspectator.com/classified/index.html'
theLinks[10] = 'http://thespec.livedeal.ca'
theLinks[11] = 'http://thespec.livedeal.ca'

// do not edit anything below this line

var p = theImages.length;
var n = theNames.length;
var l = theLinks.length;

var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}

var whichItem = Math.round(Math.random()*(p-1));

//Checks to see if there is a matching item in each of the names and links arrays; otherwise, the value is set to zero.
if ((whichItem>=n) || (whichItem>=l)) {
whichItem=0
}
function showImage(){
document.write('<a href="'+theLinks[whichItem]+'"><img src="/graphics/classified/'+theImages[whichItem]+'" alt="'+theNames[whichItem]+'" width="298" height="230" border="0"></a>');
}