//define the objImage and its properties.
function objImage() {
this.url;
this.hyperlink;
}

//Create an Array for holding new objects
var theImage = new Array()


//Create my Image Object and assign its properties.
theImage[0] = new objImage()
theImage[0].url = 'images/collins140.jpg';
theImage[0].hyperlink = 'http://www.collinscommunications.com';

theImage[1] = new objImage()
theImage[1].url = 'images/billsautobody140.jpg';

theImage[2] = new objImage()
theImage[2].url = 'images/remax140.jpg';
theImage[2].hyperlink = 'http://www.tomknapp.com';

theImage[3] = new objImage()
theImage[3].url = 'images/CSC140.jpg';
theImage[3].hyperlink = 'http://www.sandburg.edu'

theImage[4] = new objImage()
theImage[4].url = 'images/roggenkamp140.jpg';
theImage[4].hyperlink = 'http://www.roggenkamptire.com'

theImage[5] = new objImage()
theImage[5].url = 'images/infocus140.jpg';
theImage[5].hyperlink = 'http://www.infocusoptical.biz'

theImage[6] = new objImage()
theImage[6].url = 'images/discoverydepot140.jpg';
theImage[6].hyperlink = 'http://www.discoverydepot.org'

theImage[7] = new objImage()
theImage[7].url = 'images/galesburgcommunity140.jpg';
theImage[7].hyperlink = 'http://www.endowgburg.org'

theImage[8] = new objImage()
theImage[8].url = 'images/seminaryvillage140.jpg';
theImage[8].hyperlink = 'http://simplythefinest.net'

theImage[9] = new objImage()
theImage[9].url = 'images/pizzahouse140.jpg';

theImage[10] = new objImage()
theImage[10].url = 'images/glassspecialty140.jpg';

theImage[11] = new objImage()
theImage[11].url = 'images/kensington140.jpg';
theImage[11].hyperlink = 'http://simplythefinest.net'

theImage[12] = new objImage()
theImage[12].url = 'images/rheinschmidts140.jpg';
theImage[12].hyperlink = 'http://www.rheindchmidts.com'

theImage[13] = new objImage()
theImage[13].url = 'images/galesburgsign140.jpg';

theImage[14] = new objImage()
theImage[14].url = 'images/uofi140.jpg';
theImage[14].hyperlink = 'http://www.extension.uiuc.edu/knox'

theImage[15] = new objImage()
theImage[15].url = 'images/stmarys140.jpg';
theImage[15].hyperlink = 'http://www.osfstmary.org'

theImage[16] = new objImage()
theImage[16].url = 'images/galesburgsewing140.jpg';
theImage[16].hyperlink = 'http://www.sewingcenter123.com'

theImage[17] = new objImage()
theImage[17].url = 'images/sherwinwilliams140.jpg';

theImage[18] = new objImage()
theImage[18].url = 'images/brighterlife140.jpg';
theImage[18].hyperlink = 'http://www.brighterlifebookshoppe.com'

theImage[19] = new objImage()
theImage[19].url = 'images/lincolnmercury140.jpg';
theImage[19].hyperlink = 'http://www.galesburgcars.com'

theImage[20] = new objImage()
theImage[20].url = 'images/innerwisdom140.jpg';
theImage[20].hyperlink = 'http://innerwisdombookstore.com'

theImage[21] = new objImage()
theImage[21].url = 'images/burgland140.jpg';






//================================
//end definitions
//================================

//assign a variable to the length of theImage Array (total images added)
var p = theImage.length;

//Calculate a random number between 0 and the total amount of theImage
var whichImage = Math.round(Math.random()*(p-1));

//Write the HTML onto the page

document.write('<a href="'+theImage[whichImage].hyperlink+'">');
document.write('<img src="'+theImage[whichImage].url+'"');
document.write('</a>');






