	function getTopPos(inputObj)
	{		
	//alert('a');
	  var returnValue = inputObj.offsetTop;
	  while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetTop;
	  return returnValue;
	}
	
	function getLeftPos(inputObj)
	{

	  var returnValue = inputObj.offsetLeft;
	  while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetLeft;
	  return returnValue;
	}
		
	function initSlide(e)
	{
		if(document.all)e = event;
        // this line replaces the arrow when hover over
		if(this.src.indexOf('over')<0)this.src = this.src.replace('.gif','_over.gif');
		
		slideSpeed = e.clientY + Math.max(document.body.scrollTop,document.documentElement.scrollTop) - getTopPos(this);
		if(this.src.indexOf('down')>=0){
			slideSpeed = (slideSpeed)*-1;	
		}else{
			slideSpeed = arrowImageHeight - slideSpeed;
		}
		slideSpeed = Math.round(slideSpeed * 4 / arrowImageHeight);
	}
	
	function stopSlide()
	{		
		slideSpeed = 0;
		this.src = this.src.replace('_over','');
	}
	
	function slidePreviewPane()
	{
		if(slideSpeed!=0){
		
			var topPos = previewImagePane.style.top.replace(/[^\-0-9]/g,'')/1;	
//		alert(slideSpeed + '|' + slideEndMarker.offsetTop  + '|' + previewImageParent.offsetHeight + '|' + topPos);
			if(slideSpeed<0 && slideEndMarker.offsetTop<(previewImageParent.offsetHeight - topPos)){
				slideSpeed=0;
			
			}
			topPos = topPos + slideSpeed;
			if(topPos>0)topPos=0;

		 	previewImagePane.style.top = topPos + 'px';
	 	
		}
	 	setTimeout('slidePreviewPane()',30);		
	}
	
	function revealThumbnail()
	{
		this.style.filter = 'alpha(opacity=100)';
		this.style.opacity = 1;
	}
	
	function hideThumbnail()
	{
		this.style.filter = 'alpha(opacity=50)';
		this.style.opacity = 0.5;
	}