// IF statement, if browsers understands image objects execute code
if (document.images) {

// Variables, browser creates 3 'image objects'
advert = new Image
pic27 = new Image
pic23 = new Image
pic18 = new Image
pic24 = new Image
pic14 = new Image
pic1 = new Image
pic2 = new Image
pic12 = new Image

// Sets the SCR (source) attribute for each new 'image object'
advert.src = "images/pics/pic02.jpg"
pic27.src = "images/pics/pic27.jpg"
pic23.src = "images/pics/pic23.jpg"
pic18.src = "images/pics/pic18.jpg"
pic24.src = "images/pics/pic24.jpg"
pic14.src = "images/pics/pic14.jpg"
pic1.src = "images/pics/pic01.jpg"
pic2.src = "images/pics/pic02.jpg"
pic12.src = "images/pics/pic12.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")
		}
	}