var startPos = 0;
var currPos = 0;
var endPos = 0;
var divheight = 500;

var mu = false;
var md = false;


function loadFoto(fotodiv,numfoto)
{
	foto = document.getElementById(fotodiv);
	foto.style.marginLeft = "0px";
	foto.style.width = (numfoto * 79) + "0px";
	endPos = numfoto * 79;
}

function overUp(fotodiv)
{
	mu = true;	
	moveUp(fotodiv)
}

function overDown(fotodiv)
{
	md = true;	
	moveDown(fotodiv)
}

function exitUp()
{
	mu = false;	
}

function exitDown()
{
	md = false;	
}

function moveDown(fotodiv)
{
	foto = document.getElementById(fotodiv);
	
	currPos = currPos - 2;
	if(currPos<divheight-endPos)
		currPos = divheight-endPos;
		
	foto.style.marginLeft = currPos + "px";
	
	if(md)
		setTimeout("moveDown('"+fotodiv+"')",5);
}

function moveUp(fotodiv)
{
	foto = document.getElementById(fotodiv);
	currPos = currPos + 2;
	if(currPos>startPos)
		currPos = startPos;
		
	foto.style.marginLeft = currPos + "px";
	
	if(mu)
		setTimeout("moveUp('"+fotodiv+"')",5);
	
}

function LoadGallery(img)
{
	cnt = document.getElementById('fotobig');
	cnt.innerHTML = "<img src='"+ img +"' width='439' />";
}

function LoadText(txt)
{
	cnt = document.getElementById('txtfoto');
	cnt.innerHTML = txt;
}
