if(typeof window.addEventListener != 'undefined'){
	window.addEventListener('load', setupImageSlider, false);
}else if(typeof window.attachEvent != 'undefined'){
	window.attachEvent('onload', setupImageSlider);
}
function setupImageSlider(){
	var imageFrame=document.getElementById('image-frame');
	var imageWindow=document.getElementById('image-window');
	var imageList=document.getElementById('image-list');
	var imageNodes=imageList.getElementsByTagName('img');
	var imageWidth=Number(imageNodes[0].width);
	var imageHeight=Number(imageNodes[0].height);
	var numImages=imageNodes.length;
	var curImage=0, curY=0, targetY=0;
	var movY=Math.round(imageHeight / 24);
	var intervalId;
	
	var updateTargetY=function(){
		targetY = ++curImage * -imageHeight;
		intervalId=setInterval(movetoTargetY, 67);//15 fps
	};
	
	var movetoTargetY=function(){
		curY-=movY;
		//if target has been reached...
		if(curY < targetY){
			//line up with target
			curY=targetY;
			clearInterval(intervalId);
			//if last image has moved out of view...
			if(curImage == numImages){
				//loop back to first image
				curImage = curY = targetY = 0;
			}
		}
		imageList.style.top=curY + 'px';
	};
	
	//copy first item to end of list for seamless loop
	var firstLi=imageList.getElementsByTagName('li')[0];
	imageList.appendChild(firstLi.cloneNode(true));
	
	//start image slider
	imageFrame.style.width=imageWidth + 'px';
	imageWindow.style.width=imageWidth + 'px';
	imageWindow.style.height=imageHeight + 'px';
	setInterval(updateTargetY, 8000);
}