var brwIMG = new Array(20);
var brwIMGCount = 0;
var position = 0;
var list = 0;

function imgBRWLoad(imgURL)
{
	brwIMG[brwIMGCount] = new Array(3);
	brwIMG[brwIMGCount][0] = 0;
	brwIMG[brwIMGCount][1] = new Image();
	brwIMG[brwIMGCount][1].src = imgURL;
	brwIMGCount++;
}

function setPictures()
{
	var nr = 1;
	for (x = 0; x < brwIMGCount; x++)
	{
		if (x >= position && x < position + 3)
		{
			document.getElementById('brw' + nr).src = brwIMG[x][1].src;
			nr++;
		}
	}
	document.getElementById('brw').src = brwIMG[list][1].src;
}

function moveBack()
{
	if (position > 0) position--;
	setPictures();
}

function moveForward()
{
	if (position < brwIMGCount - 4) position++;
	setPictures();
}

function move(nr)
{
	if (position + nr < brwIMGCount) list = position + nr;
	setPictures();
}

function popup(file, width, height)
{
//	file = document.getElementById(file).src;
	var me;
	var left = (screen.width / 2) - (width / 2);
	var top = (screen.height / 2) - (height / 2);
	
	me = window.open('viewpictures.asp?id=' + file,'foto', 'scrollbars=no,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}
