	/************************************************************************************************************
	(C) www.dhtmlgoodies.com, November 2005
	
	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
	
	Terms of use:
	You are free to use this script as long as the copyright message is kept intact. However, you may not
	redistribute, sell or repost it without our permission.
	
	Thank you!
	
	www.dhtmlgoodies.com
	Alf Magne Kalleland
	
	************************************************************************************************************/
	var lharrowImageHeight = 35;	// Height of arrow image in pixels;
	var lhdisplayWaitMessage=false;	// Display a please wait message while images are loading?
	
	var lhpreviewImage = false;
	var lhpreviewImageParent = false;
	var lhslideSpeed = 0;//0//
	var lhpreviewImagePane = false;
	var lhslideEndMarker = false;
	var lhgalleryContainer = false;

	function lhgetTopPos(inputObj)
	{		
	
	  var lhreturnValue = inputObj.offsetTop;
	  while((inputObj = inputObj.offsetParent) != null)lhreturnValue += inputObj.offsetTop;
	  return lhreturnValue;
	}
	
	function lhgetLeftPos(inputObj)
	{

	  var lhreturnValue = inputObj.offsetLeft;
	  while((inputObj = inputObj.offsetParent) != null)lhreturnValue += inputObj.offsetLeft;
	  return lhreturnValue;
	}
		
	function lhinitSlide(e)
	{
		if(document.all)e = event;
		
		if(this.src.indexOf('over')<0)this.src = this.src.replace('.gif','-over.gif');
		
		lhslideSpeed = e.clientY + Math.max(document.body.scrollTop,document.documentElement.scrollTop) - lhgetTopPos(this);
		if(this.src.indexOf('down')>=0){
			lhslideSpeed = (lhslideSpeed)*-1;	//-1//
		}else{
			lhslideSpeed = lharrowImageHeight - lhslideSpeed;
		}
		lhslideSpeed = Math.round(lhslideSpeed * 10 / lharrowImageHeight); // 10
	}
	
	function lhstopSlide()
	{		
		lhslideSpeed = 0;
		this.src = this.src.replace('-over','');
	}
	
	function lhslidePreviewPane()
	{
		if(lhslideSpeed!=0){
			var lhtopPos = lhpreviewImagePane.style.top.replace(/[^\-0-9]/g,'')/1;	
		
			if(lhslideSpeed<0 && lhslideEndMarker.offsetTop<(lhpreviewImageParent.offsetHeight - lhtopPos)){
				lhslideSpeed=0;
			
			}
			lhtopPos = lhtopPos + lhslideSpeed;
			if(lhtopPos>0)lhtopPos=0;

		 	lhpreviewImagePane.style.top = lhtopPos + 'px';
	 	
		}
	 	setTimeout('lhslidePreviewPane()',30);		
	}
	
	function lhrevealThumbnail()
	{
		this.style.filter = 'alpha(opacity=100)';
		this.style.opacity = 1;
	}
	
	function lhhideThumbnail()
	{   
		this.style.filter = 'alpha(opacity=50)';
		this.style.opacity = 0.5;
	}
	
	function lhinitGalleryScript()
	{	
		lhpreviewImageParent = document.getElementById('lhtheImages');
		lhpreviewImagePane = document.getElementById('lhtheImages').getElementsByTagName('DIV')[0];
		lhpreviewImagePane.style.top = '0px';
		lhgalleryContainer  = document.getElementById('lhgalleryContainer');
		var lhimages = lhpreviewImagePane.getElementsByTagName('IMG');
		for(var nov=0;nov<lhimages.length;nov++){
			lhimages[nov].onmouseover = lhrevealThumbnail;
			lhimages[nov].onmouseout = lhhideThumbnail;
		}	
		lhslideEndMarker = document.getElementById('lhslideEnd');
		lhimages[2].onmouseover = lhrevealThumbnail;
		lhimages[2].onmouseout = lhrevealThumbnail;
		document.getElementById('lharrow_up_image').onmousemove = lhinitSlide;
		document.getElementById('lharrow_up_image').onmouseout = lhstopSlide;
		
		document.getElementById('lharrow_down_image').onmousemove = lhinitSlide;
		document.getElementById('lharrow_down_image').onmouseout = lhstopSlide;
			
		lhslidePreviewPane();
		
	}
	
	
	//window.onload = lhinitGalleryScript;//
