/*
 * ActiveLinks.js
 * 
 * Sets a link active at load time
 * 
 * Requires SwapImage.js
 */


var linkImages; /* Image files for active links */

/* preload images */
preloadImage("assets/i/about_us_active.gif");
preloadImage("assets/i/projects_active.gif");
preloadImage("assets/i/process_active.gif");
preloadImage("assets/i/people_active.gif");

linkImages = images;

/* Reset images array so another script can use it */
images = new Array();


/*
 * activateLinkImage() - set an img element inside an anchor
 * to denote it is active or turned on or selected etc
 * 
 * id - element id of the image that needs to be changed
 * i - index of the image being swapped in
 * 
 * returns success
 */
function activateLinkImage(id, i) {
	var e = document.getElementById(id);
	
	if (e) {
		e.src = linkImages[i].src;
		return true;
	} else {
		return false;
	}
}