// IF statement, if browsers understands image objects execute code
if (document.images) {

// Variables, browser creates 3 'image objects'
advert = new Image
pic25 = new Image
pic10 = new Image
pic21 = new Image
pic19 = new Image
pic16 = new Image
pic11 = new Image
pic9 = new Image
pic4 = new Image

// Sets the SCR (source) attribute for each new 'image object'
advert.src = "images/pics/pic24.jpg"
pic25.src = "images/pics/pic25.jpg"
pic10.src = "images/pics/pic10.jpg"
pic21.src = "images/pics/pic21.jpg"
pic19.src = "images/pics/pic19.jpg"
pic16.src = "images/pics/pic16.jpg"
pic11.src = "images/pics/pic11.jpg"
pic9.src = "images/pics/pic09.jpg"
pic4.src = "images/pics/pic04.jpg"


}
// Using a 'function code' to streamline the javscript. Firstly the function creates 'chgImg' with two parameters 'imgField' & 'newImg'. Then it askes the browser if it understands 'document.objects' again!, this elimates the need for 'else', if it doesn't understand nothing happens. Then it sets the (object  'document') document[imgField].src to the result of the newImg variable (also joining) .src, using the 'eval' method (The command executes the JavaScript contained within the brackets) to turn the text string into an object. The rollover anchor tag passes the needed parameters to the ChgImg function (i.e 'imgField' = intro (home.jpg) and the 'newImg'= introOn (home1.jpg)
function chgImg(imgField,newImg) {
		if (document.images) {
			document[imgField].src= eval(newImg + ".src")
		}
	}