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

// Variables, browser creates 3 'image objects'
advert = new Image
pic28 = new Image
pic15 = new Image
pic7 = new Image
pic9 = new Image
pic10 = new Image
pic20 = new Image
pic27 = new Image
pic22 = new Image

// Sets the SCR (source) attribute for each new 'image object'
advert.src = "images/pics/pic14.jpg"
pic28.src = "images/pics/pic28.jpg"
pic15.src = "images/pics/pic15.jpg"
pic7.src = "images/pics/pic07.jpg"
pic9.src = "images/pics/pic09.jpg"
pic10.src = "images/pics/pic10.jpg"
pic20.src = "images/pics/pic20.jpg"
pic27.src = "images/pics/pic27.jpg"
pic22.src = "images/pics/pic22.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")
		}
	}