	var currentThumbIndex = 1;
	
	function preload(img) {
		var a = new Image();
		a.src = img;
		return a;
	}
	
	function swapimage(item, substitute) {
	 	item.src = substitute.src;
	}  
	
  function thumbout(item, substitute, index) {
   	if (index != currentThumbIndex)
    	swapimage(item, substitute);
  }
 
  function thumbclick(item, substitute, index) {   
		swapimage(item, substitute);   
		
		if (currentThumbIndex != index) {
			streval = "document.thumb" + currentThumbIndex + ".src = " + "thumb" + currentThumbIndex + "OFF.src";
			eval (streval);			
			currentThumbIndex = index;
		}
  }
