var pictures = new Array();
var content="<table><tr><td>";
var thumb_suffix=".jpg"; 
var full_suffix=".jpg"; 
var thumb_prefix; 
var full_prefix; 

function makeGallery(){
	for(i=0;i<pictures.length;i++){							
		content=content+"<img class='thumb' src='"+thumb_prefix+""+pictures[i]+""+thumb_suffix+"' width='50' height='50' onMouseover='hover(this)' onMouseout='onout(this)' onClick='swap(\""+full_prefix+""+pictures[i]+""+full_suffix+"\")' onMouseDown='press(this)' onMouseUp='hover(this)'/> ";
		if(i%4==3){
			content=content+"</td></tr><tr><td> \n";
		}
	}
content=content+"</tr></td></table>";
}

function setThumbPref(s){
	thumb_prefix=s;
}

function setFullPref(s){
	full_prefix=s;
}

function setThumbSuf(s){
	thumb_suffix=s;
}

function setFullSuf(s){
	full_suffix=s;
}

function setPics(pics){
	for(i=0;i<pics.length;i++){
		pictures[i] = pics[i];
	}
}

function swap(img){
	document.getElementById('gallery').src=img;
}

function hover(img){
	img.width=48;
	img.height=48;
	img.border=1;
	img.style.borderColor='#003366'
}

function onout(img){
	img.width=50;
	img.height=50;
	img.border=0;
}

function press(img){
	img.width=46;
	img.height=46;
	img.border=2;
	img.style.borderColor='#003366'
}