var myImage = new Image;

var images = new Array;

images[0] = "chrome/aboutus_.png"
images[1] = "chrome/news_.png"
images[2] = "chrome/gallery_.png"
images[3] = "chrome/casestudies_.png"
images[4] = "chrome/blog_.png"
images[5] = "chrome/clientarea_.png"
images[6] = "chrome/guides_.png"
images[7] = "chrome/contact_.png"
images[7] = "chrome/home_.png"

for (a = 0; a < images.length; a++){
	myImage.src = images[a];
}


var imageList = {
	aboutusButton: {
		over: "chrome/aboutus_.png",
		out: "chrome/aboutus.png"
	},
	newsButton: {
		over: "chrome/news_.png",
		out: "chrome/news.png"
	},
	galleryButton: {
		over: "chrome/gallery_.png",
		out: "chrome/gallery.png"
	},	
	casestudiesButton: {
		over: "chrome/casestudies_.png",
		out: "chrome/casestudies.png"
	},	
	blogButton: {
		over: "chrome/blog_.png",
		out: "chrome/blog.png"
	},
	clientareaButton: {
		over: "chrome/clientarea_.png",
		out: "chrome/clientarea.png"
	},	
	guidesButton: {
		over: "chrome/guides_.png",
		out: "chrome/guides.png"
	},	
	contactButton: {
		over: "chrome/contact_.png",
		out: "chrome/contact.png"
	},
	homeButton: {
		over: "chrome/home_.png",
		out: "chrome/home.png"
	}	
}

function applyMenuEvents(){
	menuButtons = _class("a", "mainNavLink");
	for (a=0; a < menuButtons.length; a++){
		thisButton = menuButtons[a];
		img = _class("img", "menuLink", thisButton);
		addEvent(img[0], 'mouseover', rollover, false);
		addEvent(img[0], 'mouseout', rollout, false);
	}
}

function rollover(e){

	if (e == null) 
		e = window.event; 	
	var target = e.target != null ? e.target : e.srcElement;

	if (target.className == "menuLink"){
		img = target;
		aNode = img.parentNode;
		imgName = aNode.name;
		newImage = imageList[imgName].over
		img.src = newImage;
	}
}

function rollout(e){

	if (e == null) 
		e = window.event; 	
	var target = e.target != null ? e.target : e.srcElement;

	if (target.className == "menuLink"){
		img = target;
		aNode = img.parentNode;
		imgName = aNode.name;
		newImage = imageList[imgName].out
		img.src = newImage;
	}
}


