/* This script assumes that each image is named with a suffix to denote the state of the image.
(i.e. home-normal.jpg is the image used when the mouse is not over it, and home-active.jpg is the image used for when the mouse is over it).

The Name attribute applied to each image must be the same as the file name of the image without the suffix.
(i.e. <img src="home-normal.jpg" name="home" onmouseover="rollOver('home');" onmouseout="rollOut('home');" />);  */

var ACTIVE_SUFFIX = "-active";
var NORMAL_SUFFIX = "-normal";
var IMAGES_DIR = "images/navigation/";
var SECURE_DIR = "https://ssl4.westserver.net/treeinabox.com/";

function rollOver(image, ssl_status){
	var active_image = new Image();
	var normal_image = new Image();
	
	if(ssl_status == 'SSL'){
		active_image.src = SECURE_DIR + IMAGES_DIR + image + ACTIVE_SUFFIX + ".gif";
		normal_image.src = SECURE_DIR + IMAGES_DIR + image + NORMAL_SUFFIX + ".gif";
	}
	else {
		active_image.src = IMAGES_DIR + image + ACTIVE_SUFFIX + ".gif";
		normal_image.src = IMAGES_DIR + image + NORMAL_SUFFIX + ".gif";
	}
	
	document[image].src = active_image.src;
}
function rollOut(image, ssl_status){
	var active_image = new Image();
	var normal_image = new Image();
	
	if(ssl_status == 'SSL'){
		active_image.src = SECURE_DIR + IMAGES_DIR + image + ACTIVE_SUFFIX + ".gif";
		normal_image.src = SECURE_DIR + IMAGES_DIR + image + NORMAL_SUFFIX + ".gif";
	}
	else {
		active_image.src = IMAGES_DIR + image + ACTIVE_SUFFIX + ".gif";
		normal_image.src = IMAGES_DIR + image + NORMAL_SUFFIX + ".gif";
	}
	
	document[image].src = normal_image.src;
}