// Dynamic rollover script
function init(){
	//var item = document.getElementById("img1").className;
	//alert(item);
	var imgArray = new Array();
	var imgcount = document.getElementsByTagName('img');
	for (var i = 0; i < imgcount.length; i++){
// if the class is img, build rollover
		if (imgcount[i].className == "img") {
			var n = imgcount[i].getAttribute('id');
		//set, in array, name of the original src
			imgArray[n] = imgcount[i].getAttribute('src');
		// this sets original source and onmouseover events
			imgcount[i].src = imgArray[n];
			imgcount[i].style.visibility = "visible";
			imgcount[i].onmouseover = function(){
				imgOriginSrc = this.getAttribute('src');
				imgNewSrc = imgOriginSrc.slice(0, -8)+"_on.gif";
				this.setAttribute('src', imgNewSrc);
			}
			imgcount[i].onmouseout = function() {
				this.setAttribute('src',imgOriginSrc);
	        }
		}

// if the imgon is set, then make the image static, w/o rollover states
		if (imgcount[i].className == "imgon"){
			var n = imgcount[i].getAttribute('id');
			imgArray[n] = imgcount[i].getAttribute('src');
		// this sets original source 
			imgcount[i].src = imgArray[n].slice(0, -8)+"_on.gif";
			imgcount[i].style.visibility = "visible";
		}
	}
}

/* visibility function */
function setVisibility(objId, sVisibility) {
var obj = document.getElementById(objId);
obj.style.visibility = sVisibility;
}
