function sdmSetColor (td, colour) {
        if (document.getElementById) {
                cell = document.getElementById(td);
                link = cell.getElementsByTagName('a')[0];
                link.style.color = colour;
        }
}

function featureRoll(i) {
	var box;
	for (n=0; n<=3; n++) {
		box = document.getElementById("featurebox"+n);
		box.style.opacity = .2;
		box.style.filter = 'alpha(opacity=20)';
	}
	box = document.getElementById("featurebox"+i);
	box.style.opacity = 1;
	box.style.filter = 'alpha(opacity=100)';

	var text;
	for (n=0; n<=3; n++) {
		text = document.getElementById("featuretext"+n);
		text.style.visibility = "hidden";
	}
	text = document.getElementById("featuretext"+i);
	text.style.visibility = "visible";

	var feature = document.getElementById("feature");
	feature.style.background = "url(/pix/feature/"+i+".jpg) no-repeat";

	window.currentSlot = i;
}

function featureNext(currentSlot) {
	var newSlot;
	newSlot = currentSlot + 1;
	if (newSlot > 3) {
		newSlot = 0;
	}
	window.currentSlot = newSlot;

	var box;
	for (n=0; n<=3; n++) {
		box = document.getElementById("featurebox"+n);
		box.style.opacity = .2;
		box.style.filter = 'alpha(opacity=20)';
	}
	box = document.getElementById("featurebox"+newSlot);
	box.style.opacity = 1;
	box.style.filter = 'alpha(opacity=100)';

	var text;
	for (n=0; n<=3; n++) {
		text = document.getElementById("featuretext"+n);
		text.style.visibility = "hidden";
	}
	text = document.getElementById("featuretext"+newSlot);
	text.style.visibility = "visible";
}


