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]+".out.gif";
			imgcount[i].style.visibility = "visible";
			imgcount[i].onmouseover = function(){
				imgOriginSrc = this.getAttribute('src');
				this.setAttribute('src', imgArray[this.getAttribute('id')]+".on.gif");
			}
			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]+".on.gif";
			imgcount[i].style.visibility = "visible";
		}
	}
}

// Image fader script
var show = new Array(3);
show[0]= "pic1"
show[1]= "pic2"
show[2]= "pic3"
show[3]= "pic4"

<!--
//document.write("<style type='text/css'>#thephoto {visibility:hidden;}</style>");

function doit(x){
	if(x<4){
		initImage(show[x]);
		var x = x+1;
		setTimeout("doit("+x+")", 1000);
	}
}


function initImage(imageId) {
	//imageId = 'thephoto';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 5;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
		}
	}
}
function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}
// -->