tertNavLoaded = false;
var NUMBUTTONS = 0;

function loadTertNavImages() {
	var docRef = (ns4) ? document.tertiaryNav.document : document;

	for (var i= 0; i < docRef.images.length; i++) {
		if (docRef.images[i].src.indexOf('_tirtnav_') != -1) NUMBUTTONS++;
		
	}

	tertNavImages = new Array(NUMBUTTONS*2);
	var imgRef;
	
	for (var i = 0; i < NUMBUTTONS; i++) {
		tertNavImages[i] = new Image;
		tertNavImages[i+NUMBUTTONS] = new Image;
		imgRef = docRef.images["tertiary" + i].src;
		tertNavImages[i].src = imgRef;
		tertNavImages[i+NUMBUTTONS].src = imgRef.replace(/_off/,"_on");
	}
	return true;
}

function tertiaryOn(imgID) {
	if (tertNavLoaded == false) return;
	var docRef = (ns4) ? document.tertiaryNav.document : document;
	docRef.images["tertiary" + imgID].src = docRef.images["tertiary" + imgID].src.replace(/_off/,"_on");
}

function tertiaryOff(imgID) {
	if (tertNavLoaded == false) return;
	var docRef = (ns4) ? document.tertiaryNav.document : document;
	docRef.images["tertiary" + imgID].src = docRef.images["tertiary" + imgID].src.replace(/_on/,"_off");
}

function poptertiaryOn(imgID) {
	if (tertNavLoaded == false) return;
	var docRef = (ns4) ? document.popupTertiary.document : document;
	docRef.images["popTert" + imgID].src = docRef.images["popTert" + imgID].src.replace(/_off/,"_on");
}

function poptertiaryOff(imgID) {
	if (tertNavLoaded == false) return;
	var docRef = (ns4) ? document.popupTertiary.document : document;
	docRef.images["popTert" + imgID].src = docRef.images["popTert" + imgID].src.replace(/_on/,"_off");
}
