var scroller;
var navBar;

function createScroller(contentElement, h) {
	scroller = new ScrollBar("scroller", "ScrollBar", contentElement, "UpBtn", "DownBtn","Bar", h - 24);
	return scroller;
}

function createNavigator(max, onChangeFunc) {
	navBar = new NavigateBar("navBar", document.getElementById("PrevNavBtn"), document.getElementById("NextNavBtn"), max, onChangeFunc);
	return navBar;
}

var img = new Image();

function showPhotoLayer(url) {
	img.src = url;
	img.onload = function() {
		photoLayer = document.getElementById("PhotoLayer");
		fullPhotoImage = document.getElementById("FullPhotoImage");
		if (isIE) {
			photoLayer.style.width = img.width + 2;
			photoLayer.style.height = img.height + 2;
		} else {
			photoLayer.style.width = img.width;
			photoLayer.style.height = img.height;
		}
		photoLayer.style.left = (document.body.scrollWidth - img.width) / 2;
		photoLayer.style.top = (document.body.scrollHeight - img.height) / 2;
		fullPhotoImage.style.width = img.width;
		fullPhotoImage.style.height = img.height;
		fullPhotoImage.style.backgroundImage = "url("+this.src+")";
		hideStatus();
		photoLayer.style.display = "block";
	};
}

function closePhotoLayer() {
	document.getElementById("PhotoLayer").style.display = "none";
	document.getElementById("FullPhotoImage").style.backgroundImage = "none";
}

