//////////////////////////////////////
// rollover.js
//////////////////////////////////////
// Copyright 2005 Christopher Gronbeck
// christopher@susdesign.com
//////////////////////////////////////


var preloadFlag = false;

var currentThumbImageName = '';
var currentThumbImagePrefix = '';


	/////////////////////////////////////////////////////////
	//
	//  FUNCTION:  HideDiv
	//
	/////////////////////////////////////////////////////////
	
		function HideDiv (id) {
		
			if (document.getElementById) { // DOM3 = IE5, NS6
		
				document.getElementById(id).style.display = 'none';
			}
		
			else {
		
				if (document.layers) { // Netscape 4
				
					document.id.display = 'none';
				}
				
				else { // IE 4
				
					document.all.id.style.display = 'none';
				}
			}
			
			return true;
		}


	/////////////////////////////////////////////////////////
	//
	//  FUNCTION:  ShowDiv
	//
	/////////////////////////////////////////////////////////
	
		function ShowDiv (id) {

			if (document.getElementById) { // DOM3 = IE5, NS6
		
				document.getElementById(id).style.display = 'block';
			}
		
			else {
		
				if (document.layers) { // Netscape 4
		
					document.id.display = 'block';
				}
		
				else { // IE 4
		
					document.all.id.style.display = 'block';
				}
			}
			
			return true;
		}

function changeImages() {

	if (document.images && (preloadFlag == true)) {
		for (i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function MouseOverThumb (imageName, imagePrefix) {

	// swap images if the thumb isn't the currently active one
	
	if (imageName != currentThumbImageName) {
	
		// set the new main image
		
		changeImages ('main', imagePrefix + '.jpg');		

		// hilite the current thumb
		
		changeImages (imageName, imagePrefix + '_thumb.jpg');		

		// dim the previous thumb

		changeImages (currentThumbImageName, currentThumbImagePrefix + '_thumb_dim.jpg');		

		// set the global variables indicating the currently active thumb

		currentThumbImageName = imageName;
		currentThumbImagePrefix = imagePrefix;
	}
}

function newImage(arg) {

	if (document.images) {

		var rslt = new Image();

		rslt.src = arg;
		
		return rslt;

	}

	else {
	
		return (0);
	}
}
