// JavaScript Document
function toggleLayer(whichLayer, obj) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	} else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	} else if (document.layers)	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}

	if (obj) {
		var coors = findPos(obj);
		var x = document.getElementById(whichLayer);
		x.style.top = coors[1] + 'px';
		// x.style.left = coors[0] + 'px';
		window.scrollTo(x.style.left,coors[1]-20)
		
	}


}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}


function getImg(hup) {
	start = hup.src.lastIndexOf('/');
	image = hup.src.substring(start+1);
	return image;
}

function selectImage(image) {
	document.getElementById('fotogroot').src = "html/scrapbook/big/"+image;
}

function showBigOne(ref) {
	image = getImg(ref);
	selectImage(image);
	document.getElementById('fotogroot').src = "html/scrapbook/big/"+image+"";
}


