// <!-- hide from unwicked browsers
	// constants
	var HOME 		= "home.htm";
	var INDEX 		= "index.htm";
	var VOID0 		= "JavaScript:void(0)";	
	var LO 			= "lo";
	var HI 			= "hi";
	var SEL 		= "sel";	
	var LARGE 		= "";
	var SMALL 		= "_s";
	var HIDDEN 		= "hidden";
	var VISIBLE		= "visible";
	var UP			= "../";
	var THEMES		= "_themes/";
	var IMAGES 		= "images/";	
	var CAP 		= "cap";
	var ICO 		= "ico";
	var MNU 		= "mnu";	
	var SPACER 		= "spacer";	
	var SLASH 		= "/";
	var PIPE		= "|";
	var HASH 		= "#";
	var STAR 		= "*";
	var TILDA 		= "~";	
	var GIF 		= ".gif";
	var JPG 		= ".jpg";
	var CSS 		= ".css";	
	var CLICK 		= "Yeah !";	
	var READY 		= "";	
	var K_ 			= "_";	
	var FORWARD		= 1;
	var NEUTRAL		= 0;
	var REVERSE		= -1;
	
	// variables
	var root 			= "";
	var _invert			= "";
	var theme 			= "";
	var borderColour 	= "";
	var buttonColour 	= "";
	var bannerColour 	= "";
	
	var imageCache 		= null;
	
	// initialise
	defaultStatus = "Wicked";

	// browser detection
	var ie4 = (document.all) ? true : false;
	var ns4 = (document.layers) ? true : false;
	var dom = (document.getElementById) ? true : false;
	var ie5 = (navigator.appVersion.indexOf("MSIE 5") > -1 && this.dom) ? true : false;
	var mac = (navigator.appVersion.toLowerCase().indexOf('mac') != -1) ? true : false;
	
	// animation possible?
	setTimeout("tmr=true", 0);

function setTheme(pTheme, pBorderColour, pButtonColour, pBannerColour) {
	if (!pTheme) pTheme = "kickdrum";
	theme = pTheme + SLASH;
	if (pBorderColour && pBorderColour != "blue") borderColour = pBorderColour + SLASH;
	if (pButtonColour && pButtonColour != "blue") buttonColour = pButtonColour + SLASH
	else buttonColour = borderColour;	
	if (pBannerColour && pBannerColour != "blue") bannerColour = pBannerColour + SLASH
	else bannerColour = buttonColour;
   	
	document.writeln();
	
	if (mac) document.writeln('<LINK href="' + root + '_css_mac/' + pTheme + CSS + '" rel="stylesheet" type="text/css"\>');
   	else document.writeln('<LINK href="' + root + '_css/' + pTheme + CSS + '" rel="stylesheet" type="text/css"\>');
	
	document.writeln('<STYLE type="text/css"\><!--');
	themeElement("lborder", 169);
	themeElement("ltrim", 36);
	themeElement("rtrim", 36);
	themeElement("rborder");
	themeElement("bborder");
	document.writeln('--\></STYLE\>');
}
function themeElement(name, width) {
	if (width) width = "; width:" + width
	else width = "";
	document.writeln(HASH + name + '{background-image:url(' + root + THEMES + theme + borderColour + name + JPG + ')' + width + '}');
}

function cacheImages() {
	imageCache = new ImageCache();
	with (imageCache) {	
		image.onload = cacheNextImage;
		
		if (ie4 && !mac) disco.src = root + "traxx/images/disco.gif";		

		add(root + THEMES + theme + "icohi.gif");
		add(root + THEMES + theme + "icolo.gif");
		add(root + "news/images/caplo.gif");
		add(root + "nuwidol/images/caplo.gif");
		add(root + "traxx/images/caplo.gif");
		add(root + "ness/images/caplo.gif");
		add(root + "news/images/caphi.gif");
		add(root + "nuwidol/images/caphi.gif");
		add(root + "traxx/images/caphi.gif");
		add(root + "ness/images/caphi.gif");
		add(root + "nuwidol/images/banner_s.gif");
/*		
		add(root + "traxx/images/ww000.jpg");
		add(root + "traxx/images/ww001aa.jpg");
		add(root + "traxx/images/deck.jpg");
		add(root + "nuwidol/images/banner.jpg");
		
		add(root + THEMES + theme + "banner.jpg");
		add(root + THEMES + theme + "grey/banner.jpg");
		add(root + THEMES + theme + "lborder.jpg");
		add(root + THEMES + theme + "rborder.jpg");
		add(root + THEMES + theme + "ltrim.jpg");
		add(root + THEMES + theme + "rtrim.jpg");
		add(root + THEMES + theme + "bborder.jpg");
		
		add(root + "traxx/images/ww001a.jpg");
		add(root + "traxx/images/ww002a.jpg");
		add(root + "traxx/images/ww002aa.jpg");
		add(root + "traxx/images/ww003a.jpg");
		add(root + "traxx/images/ww003aa.jpg");
		add(root + "traxx/images/ww004a.jpg");
		add(root + "traxx/images/ww004aa.jpg");
		add(root + "traxx/images/ww005a.jpg");
		add(root + "traxx/images/ww005aa.jpg");
		add(root + "traxx/images/ww006a.jpg");
		add(root + "traxx/images/ww006aa.jpg");
		add(root + "traxx/images/ww007a.jpg");
		add(root + "traxx/images/ww007aa.jpg");
		add(root + "traxx/images/ww008a.jpg");
		add(root + "traxx/images/ww008aa.jpg");
	//	add(root + "traxx/images/ww009a.jpg");
	//	add(root + "traxx/images/ww009aa.jpg");
	//	add(root + "traxx/images/ww010a.jpg");
	//	add(root + "traxx/images/ww010aa.jpg");
	//	add(root + "traxx/images/ww011a.jpg");
	//	add(root + "traxx/images/ww011aa.jpg");
*/	
		start();
	}
}
function cacheNextImage() {
//	alert(imageCache.image.src);
	if (imageCache.image.src)
		if (!imageCache.finished) imageCache.next();
}
function ImageCache() {
	this.images = new Array(35);
	this.length = 0;
	this.max = 0;
	
	this.image = new Image();
	this.disco = new Image(200, 200);

	this.current = null;
	this.started = false;
	this.finished = false;
	
//	this.loadFunction = null;
	
	this.start = _imagecache_start;
	this.stop = _imagecache_stop;
	this.add = _imagecache_add;
	this.next = _imagecache_next;
	
	return this;
}
function _imagecache_start() {
	if (this.started || this.finished) return;
	this.started = true;
	this.current = 0;
	this.image.src = this.images[0];
}
function _imagecache_stop() {
	if (this.disco) this.disco.src = "";
	if (this.image) this.image.src = "";
	this.finished = true;
}
function _imagecache_add(url) {
	this.images[this.length++] = url;
	this.max = this.length - 1;
}
function _imagecache_next() {
	if (this.current >= this.max) this.finished = true;
	if (this.finished) return;
	this.current++;
	this.image.src = this.images[this.current];
}
function mimeTypeSupported(mimeType) {
	return (mimeType && 
	        navigator.mimeTypes && 
	        navigator.mimeTypes[mimeType] && 
			navigator.mimeTypes[mimeType].enabledPlugin) ? true : false;
}
function pluginSupported(plugin) {
	return (plugin && 
	        navigator.plugins && 
	        navigator.plugins[plugin]) ? true : false;
}
function playSound(sound) {
	return true;
	var wav = null;
	if (document.embeds) wav = document.embeds[sound];
  	if (wav == null) return false;
	if (navigator.appVersion.indexOf('MSIE') != -1) wav.Run()
	else if (mimeTypeSupported("audio/basic")) wav.play();
	return true;
}
function large_click(A, params, w, h) {
	if (!ie4 && !ns4) return true;
	if (ie4 && A) A.blur();
	A.href = VOID0;
	
	window.params = unescape(params) + PIPE + w + PIPE + h;

	var l = 50;
	var t = 25;	
	var scrollbars = "no";
	
	if (window.screen) {
		if (w > (screen.width - 20)) {
			w = screen.width - 20;
			scrollbars = "yes";
		}
		if (h > (screen.height - 40)) {
			h = screen.height - 40;
			scrollbars = "yes";
		}
		l = (screen.width - w) / 2;
		t = (screen.height - h) / 2;
		if (((t + h) > (screen.height - 50)) && (t > 5)) t = 5;
	}
	var settings = 'height='+h+',width='+w+',top='+t+',left='+l+',resizable='+scrollbars+',scrollbars='+scrollbars;
	window.open(root + 'large.htm', 'large', settings);
	
	return true;
}
// end -->