function imgLoader(imgSrc)
{
	this.imgsrc = imgSrc;
	this.load = function(imgShow, loadShow) {
		var node = document.getElementById(imgShow);
		var loadimg = document.getElementById(loadShow);
		node.style.display="none";
		loadimg.src = loadimg.src; //fix IE bug, it'll stop the gif animation when there's an event(like js call)
		loadimg.style.display="";
		node.onreadystatechange = function(e) {
			if (this.loader && this.readyState == "complete") {
				loadimg.style.display="none";
				node.style.display="";
				this.loader = null;
			}
		}
		node.onload = function(e) {
			if (this.loader) {
				loadimg.style.display="none";
				node.style.display="";
				this.loader = null;
			}
		}
		node.loader = this;
		node.src = this.imgsrc;
	}
}

var step = 1;

function go(i)
{
	step = i;
	document.getElementById("num").innerHTML=i;
	var imageLoader = new imgLoader(i+".jpg");
	imageLoader.load("albumIMG","loading");
}
function previous()
{
	go((step>1)? (step-1):108);
}
function next()
{
	go((step<108)? (step+1):1);
}

