function changeimage(x, total) {
	d = document.getElementById("currentimage");
	if (!d) return;
	d.value = (parseInt(d.value) + parseInt(total) + parseInt(x)) % parseInt(total);
	if (d.value == 0) d.value = total;
	sp = document.getElementById("numspan");
	if (sp) sp.innerHTML = d.value; 
	//alert(d.value);

	for (i=1; i<=parseInt(total); i++) {
	//alert(i);
		s = "image" + i;
	  	if (i == parseInt(d.value)) {
			e = document.getElementById(s);
			if (e) e.style.display = "block";
			e = document.getElementById(s + "a");
			if (e) e.style.display = "block";
		//	alert("on " + s);
		} else {
			e = document.getElementById(s);
			if (e) e.style.display = "none";
			e = document.getElementById(s + "a");
			if (e) e.style.display = "none";
			//alert("off " + s);
		}
	}
}