//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/tristates468.jpg';
theImage[0].hyperlink = 'http://www.tristateswater.com/'


theImage[1] = new objImage()
theImage[1].url = 'images/innerwisdom468.jpg';
theImage[1].hyperlink = 'http://innerwisdombookstore.com';


theImage[2] = new objImage()
theImage[2].url = 'images/remax468.jpg';
theImage[2].hyperlink = 'http://www.tomknapp.com';


theImage[3] = new objImage()
theImage[3].url = 'images/stmarys468.jpg';
theImage[3].hyperlink = 'http://www.osfstmary.org';


theImage[4] = new objImage()
theImage[4].url = 'images/CSC468.jpg';
theImage[4].hyperlink = 'http://www.sandburg.edu'


theImage[5] = new objImage()
theImage[5].url = 'images/roggenkamp468.jpg';
theImage[5].hyperlink = 'http://www.roggenkamptire.com'


theImage[6] = new objImage()
theImage[6].url = 'images/discoverydepot468.jpg';
theImage[6].hyperlink = 'http://www.discoverydepot.org'


theImage[7] = new objImage()
theImage[7].url = 'images/cratty468.jpg';
theImage[7].hyperlink = 'http://www.century21.com/search/agent.jsp?svf=lsa&agentname=+michael+cratty&where=&lang=&x=22&y=9'

theImage[8] = new objImage()
theImage[8].url = 'images/owen468.jpg';
theImage[8].hyperlink = 'http://www.owendds.com'

theImage[9] = new objImage()
theImage[9].url = 'images/galesburgcommunity468.jpg';
theImage[9].hyperlink = 'http://www.endowgburg.org'

theImage[10] = new objImage()
theImage[10].url = 'images/fm468.jpg';
theImage[10].hyperlink = 'http://www.thefmbank.com'

theImage[11] = new objImage()
theImage[11].url = 'images/kensington468.jpg';
theImage[11].hyperlink = 'http://simplythefinest.net'

theImage[12] = new objImage()
theImage[12].url = 'images/century21468.jpg';
theImage[12].hyperlink = 'http://www.century21galesburg.com'

theImage[13] = new objImage()
theImage[13].url = 'images/rheinschmidts468.jpg';
theImage[13].hyperlink = 'http://www.rheinschmidts.com/'

theImage[14] = new objImage()
theImage[14].url = 'images/rheinschmidts468.jpg';
theImage[14].hyperlink = 'http://www.rheinschmidts.com/'

theImage[15] = new objImage()
theImage[15].url = 'images/midwestbank468.jpg';
theImage[15].hyperlink = 'http://www.mbwi.com'

theImage[16] = new objImage()
theImage[16].url = 'images/tompkins468.jpg';
theImage[16].hyperlink = 'http://www.tompkinsstatebank.com/'















//================================
//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>');





