
var thumbs = new Array;
var curr = 0;

function thumbClick( position ) {
	thumbs[curr].thumbElement.style.borderColor = '#000000';
	curr = position;
	myGallery.goTo(position);
}

function thumbMouseOver( position ) {
	thumbs[position].thumbElement.style.borderColor = '#FFFFFF';
}

function thumbMouseOut( position ) {
	if (position != curr) {
		thumbs[position].thumbElement.style.borderColor = '#000000';
	}
}


function galleryCallerObj( thumbId, galleryPos ) {
	this.thumbElement = document.getElementById( thumbId );
	this.thumbElement.onclick = function() { thumbClick( galleryPos ); };
	this.thumbElement.onmouseover = function() { thumbMouseOver( galleryPos ); };
	this.thumbElement.onmouseout = function() { thumbMouseOut( galleryPos ); };
}

function prepareGalleryCaller() {
	for ( var i = 0; i < thumbNumbers.length; i++ ) {
		var param1 = 'thumb' + thumbNumbers[i];	
		thumbs[i] = new galleryCallerObj( param1, i );
	}
	thumbs[curr].thumbElement.style.borderColor = '#FFFFFF';
}

