// super slim image preload and rollover script
// preloads any number of nav images named with the convention 
// nav_title_0.ext and nav_title_1.ext for off and on states respectively.  
// No need to name the files specifically!  Also requires much less code within the
// link tags themselves.
// Author: Paul Gutches

a = new Array();

function preloadImages(){

i = 1; s = 0; s2 = 0; done = false;
itag = new Object();

	while(!done){
	itag = eval("document.getElementById('n" + i + "')");
	
		if (itag != null){
		s = itag.src.indexOf('-');
		s2 = itag.src.lastIndexOf('-');
		imgName = itag.src.substring(s+1,s2);
		a[i-1] = new Image(itag.width,itag.height); 
		a[i-1].src = imgPre + imgName + imgPostOn;
		a[i-1][0] = new Array();
		a[i-1][0] = new Image(itag.width,itag.height);
		a[i-1][0].src = imgPre + imgName + imgPostOff;
		i++;
		}else{
		done = true;
		}	
	}
}

function on(i) {
		
		//if (!loggedin){
		//document.getElementById('sdlogbubble').style.visibility = "visible";
		//}else{
		imgTag = "n" + i;
		document.getElementById(imgTag).src = a[i-1].src; 
		//}
		
		return;
		
		
}

function off(i) {

		//if (!loggedin){
		//document.getElementById('sdlogbubble').style.visibility = "hidden";
		//}else{
		
		imgTag = "n" + i;
		document.getElementById(imgTag).src = a[i-1][0].src;
		//}
		return;
}
