var floater;

function init() {

	floater = document.getElementById('floater');

}

function photo(pic) {

	helper = document.getElementById('content');

	position = findPos(helper);
	width = helper.offsetWidth;
	height = helper.offsetHeight;

	floater.innerHTML = '<img src="/img/photo/' + pic + '" alt="" border="0" />';
	floater.style.visibility = "hidden";
	floater.style.display = "block";
	floater.style.left = (position[0] + Math.round(width / 2) - Math.round(floater.offsetWidth / 2)) + "px";
	floater.style.top = (position[1] + Math.round(height / 2) - Math.round(floater.offsetHeight / 2)) + "px";
	floater.style.visibility = "visible";

}

function hide(obj) {

	obj.style.display = "none";

}

function findPos(obj) {

	var curleft = curtop = 0;
	
	if (obj.offsetParent) {
	
		do {

			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		
		} while (obj = obj.offsetParent);

	}
	
	return [curleft,curtop];

}