var arImgNames = new Array("am", "live", "dream", "capture", "relate", "prev", "all", "next");
var arDescriptions = new Array("this is me.", "journal-type things.", "what i wish for.", "my 35mm muse.", "this is them.");

// preload the rollover images.
for(i=0; i<arImgNames.length; i++) {
	eval(arImgNames[i] + "_off = new Image(); " + arImgNames[i] + "_off.src = 'jose/b_" + arImgNames[i] + ".gif';");
	eval(arImgNames[i] + "_on = new Image(); " + arImgNames[i] + "_on.src = 'jose/b_" + arImgNames[i] + "_over.gif';");
}

// set the status text.
window.status = "i " + arImgNames[intCurrentSection] + " - " + arDescriptions[intCurrentSection];

// init for fixing the resize bug in NN.
if(document.layers) {
	intOriginalWidth = window.innerWidth;
	intOriginalHeight = window.innerHeight;
	window.onresize = nnResizeFix;
	strHide = "hide";
	strShow = "show";
} else if(document.all) {
	strHide = "hidden";
	strShow = "visible";
}

// rerender onresize.
function nnResizeFix() {
	if((window.innerWidth != intOriginalWidth) || (window.innerHeight != intOriginalHeight)) {
		document.location = document.location;
	}
}

// the section rollover function.
function mOver(intSection) {
	// rolling over a non-current section.
	if((typeof intSection != "undefined") && (intSection != intCurrentSection)) {
		intLastOver = intSection;
		imgRef("lyrSectionNav", "b" + intCurrentSection).src = eval(arImgNames[intCurrentSection] + "_off.src");
		imgRef("lyrSectionNav", "b" + intSection).src = eval(arImgNames[intSection] + "_on.src");
	// rolling out of a non-current section.
	} else if((typeof intSection == "undefined") && (intLastOver != intCurrentSection)) {
		imgRef("lyrSectionNav", "b" + intCurrentSection).src = eval(arImgNames[intCurrentSection] + "_on.src");
		imgRef("lyrSectionNav", "b" + intLastOver).src = eval(arImgNames[intLastOver] + "_off.src");
	// rolling over/out the current section.
	} else {
		intLastOver = intCurrentSection;
	}
}

// the local nav rollover function.
function navOver(strWhich) {
	if(strWhich) {
		strLastOver = strWhich;
		imgRef("lyrLocalNav", "b_" + strWhich).src = eval(strWhich + "_on.src");
	} else {
		imgRef("lyrLocalNav", "b_" + strLastOver).src = eval(strLastOver + "_off.src");
	}
}

// returns a reference to an image object within a layer.
function imgRef(layerID, imgName) {
	if(document.layers) {
		return document.layers[layerID].document.images[imgName];
	} else if(document.all) {
		return document.images[imgName];
	}
}
