// determine relevant browser attributes
browser = (document.images) ? 1 : 0;

// preload function
function preLoad(imageName, imageLength, imagePath) {
	if (browser == 1) {
		if (imagePath == null) {
			imagePath = "images/";
		}
		if (imageLength == null) {
			eval(imageName + " = new Image()");
			eval(imageName + ".src = \"" + imagePath + imageName + ".gif\"");
		} else {
			for (var i=0; i < imageLength; i++) {
				eval(imageName + "_0" + i + " = new Image()");
				eval(imageName + "_0" + i + ".src = \"" + imagePath + imageName + "_0" + i + ".gif\"");
				// unComment to confirm image preloads
				// alert("Loaded: " + imagePath + imageName + "_0" + i)
			}
		}
	}
}
	                                                                                  
/*                      ... highlight function...                 */
	        
	        
function trilight(imageName,imageFile) {
	if (browser == 1) {
	    document.images[imageName].src = eval(imageName + "_0" + imageFile + ".src");
		sRef = imageName.slice(4,imageName.length);
		sRef = "ref_" + sRef;
	    document.images[sRef].src = eval(sRef + "_0" + imageFile +  ".src");
	}
}
	
function highlight(imageName,imageFile,iTriToggle){
	if (browser == 1) {
			document.images[imageName].src = eval(imageName + "_0" + imageFile + ".src");
		if (iTriToggle != null) {
			if (oCurrPri != null && oCurrPri == imageName) {
				imageFile = 1;
			}
			sRef = imageName.slice(4,imageName.length);
			sRef = "ref_" + sRef;
	    	document.images[sRef].src = eval(sRef + "_0" + imageFile +  ".src");
		}
	}
}


function init() {
	if (oCurrPri != null) {
		highlight(oCurrPri,2,1);
	}
}

function popWin(wFileLoc,w,h) {
 newWindow = window.open(wFileLoc,'urfa_win','width='+w+',height='+h+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0'); 
 newWindow.focus();
}
