//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/sandburgmall200.jpg';
theImage[0].hyperlink = 'http://www.sandburgmall.com';


theImage[1] = new objImage()
theImage[1].url = 'images/innerwisdom200.jpg';
theImage[1].hyperlink = 'http://innerwisdombookstore.com';


theImage[2] = new objImage()
theImage[2].url = 'images/remax200.jpg';
theImage[2].hyperlink = 'http://www.tomknapp.com';


theImage[3] = new objImage()
theImage[3].url = 'images/stmarys200.jpg';
theImage[3].hyperlink = 'http://www.osfstmary.org';


theImage[4] = new objImage()
theImage[4].url = 'images/CSC200.jpg';
theImage[4].hyperlink = 'http://www.sandburg.edu'


theImage[5] = new objImage()
theImage[5].url = 'images/roggenkamp200.jpg';
theImage[5].hyperlink = 'http://www.roggenkamptire.com'


theImage[6] = new objImage()
theImage[6].url = 'images/discoverydepot200.jpg';
theImage[6].hyperlink = 'http://www.discoverydepot.org'

theImage[7] = new objImage()
theImage[7].url = 'images/uofi200.jpg';
theImage[7].hyperlink = 'http://www.extension.uiuc.edu/knox'

theImage[8] = new objImage()
theImage[8].url = 'images/cratty200.jpg';
theImage[8].hyperlink = 'http://www.century21.com/search/agent.jsp?svf=lsa&agentname=karen+cratty&where=&lang=&x=34&y=11'

theImage[9] = new objImage()
theImage[9].url = 'images/seminaryvillage200.jpg';
theImage[9].hyperlink = 'http://www.simplythefinest.net'

theImage[10] = new objImage()
theImage[10].url = 'images/galesburgcommunity200.jpg';
theImage[10].hyperlink = 'http://www.endowgburg.org'

theImage[11] = new objImage()
theImage[11].url = 'images/century21200.jpg';
theImage[11].hyperlink = 'http://www.century21galesburg.com'

theImage[12] = new objImage()
theImage[12].url = 'images/costa200.jpg';
theImage[12].hyperlink = 'http://www.edline.net/pages/costa_catholic_academy'

theImage[13] = new objImage()
theImage[13].url = 'images/glassspecialty200.jpg';

theImage[14] = new objImage()
theImage[14].url = 'images/firstpresbyterian200.jpg';
theImage[14].hyperlink = 'http://www.fpcgalesburg.com'

theImage[15] = new objImage()
theImage[15].url = 'images/fm200.jpg';
theImage[15].hyperlink = 'http://www.thefmbank.com'

theImage[16] = new objImage()
theImage[16].url = 'images/tristates200.jpg';
theImage[16].hyperlink = 'http://www.tristateswater.com'

theImage[17] = new objImage()
theImage[17].url = 'images/tompkins200.jpg';
theImage[17].hyperlink = 'http://www.tompkinsstatebank.com'

theImage[18] = new objImage()
theImage[18].url = 'images/galesburgsewing200.jpg';
theImage[18].hyperlink = 'http://www.sewingcenter123.com'

theImage[19] = new objImage()
theImage[19].url = 'images/owen200.jpg';
theImage[19].hyperlink = 'http://www.owendds.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>');




