function navHover(el, src) {
	// Swap out an image, unless it is the current page
	if (el.current != true) {
		swap(el, src);
	}
}

function navHeart(on) {
	if (on) {
		swap($('heart-top'), 'heart-top-on.png');
		swap($('heart-middle'), 'heart-middle-on.png');
		swap($('nav-about'), 'nav-about-heart-on.png');
		swap($('heart-left'), 'heart-left-on.png');
		swap($('ds-left-heart'), 'ds-left-heart-on.png');
	} else {
		// Turn them off.
		swap($('heart-top'), 'heart-top.png');
		swap($('heart-middle'), 'heart-middle.png');
		swap($('nav-about'), 'nav-about-off.png', true);
		swap($('heart-left'), 'heart-left.png');
		swap($('ds-left-heart'), 'ds-left-heart.png');
	}
}

function navInit(id) {
	// Initialize the navigation to the current page.
	navHover($(id), id + '-on.png');
	$(id).current = true;
}

function swap(el, src, last) {
	if (last && el.lastSrc) {
		el.src = el.lastSrc;
	} else {
		el.lastSrc = el.src;
		src = '_images/' + src;
		el.src = src;
	}
}

function $(id) {
	return document.getElementById(id);
}
