/***                                                                        ***\
    init.js                                  Last Updated: 2002.12.17 (xris)
    basic javascript routines
\***                                                                        ***/

// Define some variables
	var isCSS, isW3C, isIE4, isNN4, isIE6;
	var img_on  = new Array();
	var img_off = new Array();

// Load the initialization routine
	window.onload = init;

// Figures out what kind of browser the user is running
	function init() {
		isCSS = (document.body && document.body.style) ? true : false;
		isW3C = (isCSS && document.getElementById)     ? true : false;
		isIE4 = (isCSS && document.all)                ? true : false;
		isNN4 = (document.layers)                      ? true : false;
		isIE6 = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
	}

// A function to get an element id
	function get_element(id) {
		if (typeof id != 'string') return id;
		if (isW3C)
			return document.getElementById(id);
		return document.all[id];
	}

// Image Preloader
	function preload_image(id, on, off) {
		img_on[id]      = new Image();
		img_on[id].src  = on;
		if (off) {
			img_off[id]     = new Image();
			img_off[id].src = off;
		}
	}

// Functions to swap on/off states of images
	function on(which) {
		var img = get_element(which);
		img.src=img_on[which].src;
	}
	function off(which) {
		var img = get_element(which);
		img.src=img_off[which].src;
	}

