// JavaScript Document
	var moveValue = 5; // léptetés (pixel)
	var galleryWidth = 320+14; // képgaléria szélessége (pixel)
	var thumbHeight = 48; // kis képek magassága
	var leftPos = 0; // kezdő pozíció
	var thumbsDivWidth = 0; // thumbs div szélessége - kezdőérték
	var mouseOver = 0; // mouse over ellenőrzés > 0 - mouseOut, 1 - mouseOver

function startInit() {
	var x = document.getElementsByName('thumb');
	for (i=0; i<x.length; i++) { 
		x[i].height = thumbHeight;
		thumbsDivWidth += x[i].width+4;
	}
		document.getElementById("Frame").style.width = galleryWidth+"px";
		document.getElementById("fullImgFrame").style.height = galleryWidth+"px";
		galleryWidth -= 4;
		document.getElementById("thumbs").style.width = (galleryWidth-40)+"px";
		document.getElementById("thumbsDiv").style.width = thumbsDivWidth+"px";
		document.getElementById("fullImg").src = x[0].src.replace("thumbs/","");		
		document.getElementById("fullImg").style.maxWidth = (galleryWidth-10)+"px";
		document.getElementById("fullImg").style.maxHeight = (galleryWidth-10)+"px";
}

function moveRight() {
	if ( (leftPos > -thumbsDivWidth+(galleryWidth-40)+moveValue) ) {
		leftPos -= moveValue;
		document.getElementById("thumbsDiv").style.left = leftPos + "px";
	} else if (thumbsDivWidth > (galleryWidth-40)) {
		document.getElementById("thumbsDiv").style.left = -thumbsDivWidth + (galleryWidth-40) + "px";
	}
	if (mouseOver == 1) setTimeout("moveRight()", 50);
}

function moveLeft() {
	if ( leftPos <= -moveValue ) {
		leftPos += moveValue;
		document.getElementById("thumbsDiv").style.left = leftPos + "px";
	}
	if (mouseOver == 1) setTimeout("moveLeft()", 50);
}

function setOver(x) {
	mouseOver = x;
}

function showImg(x) {	
	document.getElementById("fullImg").src = x.replace("thumb","full");
}

