
	var imageCount = 4;
	imageCount = parseInt(imageCount) - 1;

	function changeClass(obj,itype) {
		if (obj.id != selCP) {
			if (itype==0) {
				document.getElementById(obj.id).className = "imageOff";
			} else {
				document.getElementById(obj.id).className = "imageOn";
			}
		}
	}

	function cpLink() {
		// imageCount addition
		for(i=0;i<=imageCount;i++) {
			if (document.getElementById("img" + i).className == "imageOn") {
				window.location = imgLink[i];
				return;
			}
		}
	}

	function clickCP(obj) {
		var objID = obj.id;
		var strLen = objID.length;
		var newID = objID.substr(strLen - 1, 1);

		// imageCount addition
		for(i=0;i<=imageCount;i++) {
			document.getElementById("img" + i).className = "imageOff";
		}
		document.getElementById(obj.id).className = "imageOn";
		window.clearInterval(oInterval);
		selID = parseInt(newID);
		selCP = obj.id;
		adjustDisplay();
	}

	function changeCP(obj) {
		// imageCount addition
		for(i=0;i<=imageCount;i++) {
			document.getElementById("img" + i).className = "imageOff";
		}
		document.getElementById(obj.id).className = "imageOn";
		window.clearInterval(oInterval);
		adjustDisplay();
		selCP = obj.id;
	}

	function setDefaults() {
		changeCP(document.getElementById("img" + selID));
		increaseCP();
	}

	function adjustDisplay() {
		for(x=0;x<=3;x++) {
			for(y=0;y<=3;y++) {
				if (x != 1) {
					document.getElementById(divList[x] + y).style.display = "none";
				}
			}
		}
		for(i=0;i<=3;i++) {
			document.getElementById(divList[i] + selID).style.display = "block";
			document.getElementById("imageCP").src = imgList[selID];
      document.getElementById("imageCP").alt = imgAlt[selID];
		}
	}

	function increaseCP() {
		// imageCount addition
		if (selID >= imageCount) {
			selID = 0;
		} else {
			selID = selID + 1;
		}

		if (selID == 1) {
			oInterval = window.setInterval(setDefaults, 15000);
		} else {
			oInterval = window.setInterval(setDefaults, 10000);
		}
	}

	function decreaseOne() {
		if (iFirst != 1) {
			selID = selID - 2;
			iFirst = 1;
			if (selID < 0) {
				// imageCount addition
				selID = imageCount;
			}
		} else {
			if (selID <= 0) {
				// imageCount addition
				selID = imageCount;
			} else {
				selID = selID - 1;
			}
		}
		changeCP(document.getElementById("img" + selID));
	}

	function increaseOne() {
		if (iFirst == 1) {
			// imageCount addition
			if (selID >= imageCount) {
				selID = 0;
			} else {
				selID = selID + 1;
			}
		} else {
			iFirst = 1;
		}
		changeCP(document.getElementById("img" + selID));
	}

	function pauseButton() {
		window.clearInterval(oInterval);
	}

	//window.onload = setDefaults;
	setDefaults();


 