
var oldSrc;

function preloadimages() {
	/*
	pre-load a highlighted version 
	of each "nav_" image
	*/
	var num = document.images.length;
	var img,posn,temp,orig,newsrc;
	var preload = new Array();
	for(var i = 0; i<num; i++) {
		img = document.images[i].src;
		posn = img.indexOf("nav_");
		if(posn > -1 && img.indexOf("_lit")< 0){
			dot = img.lastIndexOf(".");
			temp = img.substr(dot,img.length);
			orig = img.substr(0,dot);
			newsrc = orig + "_lit" + temp;
			preload[i] = new Image();
			preload[i].src = newsrc;
		}//if
	}//for
	
		
 }

function getSrc(n){
    img = n.toString();
         eval("n = document." + img + ".src");
         if(n.indexOf("_lit")< 0){
                 dot = n.lastIndexOf(".");
                 temp = n.substr(dot,n.length).toString();
                 orig = n.substr(0,dot).toString();
                 newsrc = orig + "_lit" + temp;
                 newsrc = newsrc.toString();
         return newsrc;
         }
        else{return n;}
 }

function swap(imgname) {
       	n = arguments[0].toString();
	eval("oldSrc = document." + n + ".src");
	old = n;
	eval("document." + n + ".src=getSrc('" + imgname + "')");
 }

function restore(){
	eval("document." + img + ".src=oldSrc");
 }
