// ColorCarousel.action v1.6 - February, 2009
// Copyright ? 1999 by Walter Blady
// All rights reserved
var CCisNav4 = navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) == 4;
var CCisIE4 = navigator.appVersion.indexOf("MSIE 4") >= 0;
var CCW3C = document.getElementById ? true : false;
var CCparams;
function WBColorCarousel(action) { 
	if (CCVersion()) {
		if (action[1] == 0 || action[1] == 2) {
			CCparams = action[39].length > 0 ? eval(action[39] + ".document") : eval("document");
		}
		else if ((action[1] == 1 || action[1] == 3) && action[2] != "") {
			CCparams = CCgetObject(action[2]);
		}
		if (action[1] == 4) {
			if (CCparams.t) clearInterval(CCparams.t);
			return;
		}
		if (!CCparams.parray) {
			CCparams.parray = new Array();
			CCparams.carray = new Array();
			CCparams.counter = 0;
			CCparams.action = action;
			CCparams.start = CCStartUp;
		}
		var j = CCparams.parray.length == 0 ? 1 : CCparams.parray.length;
		for (var i = 3; i < 39 && (action[i] != "" || action[i+2] != ""); i += 3) {
			CCparams.parray[j] = action[i];
			CCparams.carray[j] = action[i+2];
			j++;
		}
		CCparams.counter += CCparams.parray.length - 1;
		if (!action[42]) return;
		CCparams.isIndex = action[41] ? (Math.floor((Math.random() * 1000)) % (CCparams.parray.length-1))+1 : 1;
	}
	CCparams.start(CCparams);
	return;
}
function CCStartUp() {
	if (document.parray[document.isIndex] != "") {
		var img = document.parray[document.isIndex];
		CCimgn = new Image();
		CCimgn.src = img;
	}
	if (this.action[1] == 0) {
		var t = setTimeout("CCDoPage()", 200);
	}
	else if (this.action[1] == 1 && this.action[2] != "") {
		var t = setTimeout("CCDoBox(CCparams)", 200);
	}
	else if (this.action[1] == 2) {
		if (!this.action[41]) this.isIndex = 1;
		this.t = setInterval("CCDoPage()", parseInt(document.action[40]) * 1000);
	}
	else if (this.action[1] == 3 && this.action[2] != "") {
		if (!this.action[41]) this.isIndex = 1;
		this.t = setInterval("CCDoBox(CCparams)", parseInt(this.action[40]) * 1000);
	}
	return;
}
function CCDoPage() {
	document.isUrl = document.parray[document.isIndex] != "" && document.parray[document.isIndex] != "#";
	if (document.isUrl) {
		document.body.style.backgroundImage = "url(" + escape(document.parray[document.isIndex]) + ")";
	}
	else {
		document.body.style.backgroundImage = "url(" + escape(' ') + ")";
		document.bgColor = document.carray[document.isIndex];
	}
	document.isIndex++;
	if (document.isIndex > document.parray.length-1) {
		document.isIndex = 1;
	}
	if (document.parray[document.isIndex] != "") {
		var img = document.parray[document.isIndex];
		CCimgn = new Image();
		CCimgn.src = img;
	}
	return;
}
function CCDoBox(params) {
	if (params.isIndex > params.parray.length-1) {
		params.isIndex = 1;
	}
	params.isUrl = params.parray[params.isIndex] != "" && params.parray[params.isIndex] != "#";
	if (params.isUrl) {
		if (CCisNav4) {
			params.bgImage = params.parray[params.isIndex];
		}
		else {
			params.style.backgroundImage = "url(" + escape(params.parray[params.isIndex]) + ")";
		}
	}
	else {
		if (CCisNav4) {
			params.bgImage = "";
			params.bgColor = params.carray[params.isIndex];
		}
		else if (CCW3C || CCisIE4) {
			params.style.backgroundImage = "";
			params.style.backgroundColor = params.carray[params.isIndex];
		}
	}
	params.isIndex++;
	return;
}
function CCgetObject(objName) {
	var params;
	if (CCisIE4) {
		params = eval("document.all." + objName);
	}
	else if (CCW3C) {
		params = eval('document.getElementById("' + objName + '")');
	}
	else {
		params = CCFindLayerObject(objName, 0);
	}
	return params;
}
function CCFindLayerObject(layer, thisLayer) {
	if (thisLayer) {
		var thisDocument = thisLayer.document;
	}
	else {
		var thisDocument = document;
	}
	var layerObj = thisDocument[layer];
	if (layerObj) {
		return layerObj;
	}
	else {
		for (var i = 0; i < thisDocument.layers.length; i++) {
			layerObj = CCFindLayerObject(layer, thisDocument.layers[i]); 
			if (layerObj) {
				break;
			}
		}
	}
	return layerObj;
}
function CCVersion() {
	return true;
}
//

