

function preload(imgObj,imgSrc) {
	if (document.images){
	 	eval(imgObj + ' = new Image()');
	  	eval(imgObj + '.src = "' + imgSrc + '"');
	}
}

// preloads
var loaded = false;

preload( 'about_us', 'images/about_us.gif');
preload( 'about_us_hl', 'images/about_us_hl.gif');
preload( 'activities', 'images/activities.gif');
preload( 'activities_hl', 'images/activities_hl.gif');
preload( 'team', 'images/team.gif');
preload( 'team_hl', 'images/team_hl.gif');
preload( 'career', 'images/career.gif');
preload( 'career_hl', 'images/career_hl.gif');
preload( 'contact', 'images/contact.gif');
preload( 'contact_hl', 'images/contact_hl.gif');

loaded = true;

// standard image switching function
// layer - the name of the layer to switch
// imgName - the name of the image tag to substitute.
// imgObj - the name of the preloaded image object.

function changeImage(layer, imgName, imgObj) {
	if (loaded == true){
		if (document.layers && layer!=null)
			eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');	
		else
			document.images[imgName].src = eval(imgObj+".src");
	}
}