// Only thing you should need to customize in here is the thumbboxTop variable....  The 50s are the amount of pxls that the images move per click, change em if you want kk

function changeImage(newImage,newimage1,producttitle) {
//	alert(producttitle);
	
	c="http://www.resortworld.com"+newimage1;
	document.getElementById("mainimage").innerHTML='<a href="#" onclick="javascript:pop(\'popup.php?image='+newimage1+'\', \'650\', \'470\'); return false;"><img src="'+newImage+'" border="0" alt="'+producttitle+'" title="'+producttitle+'"></a>';
	//var imagevae='<a href="#"  onClick="javascript:window.open(popup.php); return false;"><img src="'+newImage+"' border="0" alt="Necker Island" title=" Necker Island " width="352"></a>';
	//alert(document.getElementById("mainimage").innerHTML);
}

var currentPosB = 0;
function changeThumb(changeDirection, startPosY, currentPosB) {
	var thumbboxTop = 227; //thumbbox top value, dont include the negative sign...
	var startPosB = document.getElementById("thumbbox").offsetHeight - 227;
	var currentPosY = document.getElementById("thumbbox").offsetTop;
	var correctPosYsum = currentPosY - startPosY;
	var correctPosY = correctPosYsum - thumbboxTop;
	
	if (changeDirection == 'up') {
		
		if (currentPosY != startPosY) {
			currentPosB = currentPosB - 25;
			newPos = correctPosY + 25;
			if (currentPosB < 0) {
				currentPosB = 0;
				newPos = - thumbboxTop;
			}
			document.getElementById("thumbbox").style.top = newPos+"px";
			
			if(newPos != "0"){
				
			setTimeout("changeThumb('up',0,newPos)",10);
			}
	

		}

		
	} else {
		newPos = correctPosY - 100;
		var nextPosB = currentPosB + 100;
		var newPosB = correctPosY - (nextPosB - startPosB);
		if (nextPosB < startPosB) {
			currentPosB = currentPosB + 100;
			document.getElementById("thumbbox").style.top = newPos+"px";
		} else {
			var adjustPos = currentPosB - startPosB;
			currentPosB = startPosB;
			newPos = correctPosY + adjustPos;
			document.getElementById("thumbbox").style.top = newPos+"px";
		}
	}
return currentPosB;
}
function initScrollLayers() {
  
 
  var wndo2 = new dw_scrollObj('wn2', 'thumbbox');
 
 
}
