var scrolling=[];
var reset=[];
var hover=[];
var height=25;//height of the image
var linkh=25;//height of the link (may need to be ajdusted by +-1)
//var linktop=0;
function scroll(sdiv1, k){
	//if(scrolling[k]){
	//alert(sdiv);
		sdiv = document.getElementById(sdiv1);
		sdiv2 = document.getElementById(sdiv1+'b');
		
		if(parseInt(sdiv.style.top)>-height){
			
		var top = parseInt((-(height+20)-parseInt(sdiv.style.top))/12);
		//alert(top);
		sdiv.style.top=parseInt(sdiv.style.top)+top+"px";
		
		//var top2 = parseInt((-(height+11)-parseInt(sdiv.style.top))/5);
		sdiv2.style.top=parseInt(sdiv2.style.top)-top+"px";
		//linktop=top-parseInt(linkh/10);
		//alert(linktop);
			//scroll(sdiv);
			setTimeout(function (){scroll(sdiv1, k);}, 25);
			
		}else{
			//hover[1]=false;setTimeout(function (){resetScroll('inner1', 1);},20);
			
			scrolling[k]=false;
			resetScroll(sdiv1, k);
			//sdiv.style.top=0+"px";
			//resetStitle(sdiv1+'b',k);
			//time=5;
		}
	//}
}
function startScroll(sdiv1,k){
	//sdiv = document.getElementById(sdiv1);
	hover[k]=true;
	if(!scrolling[k] && !reset[k]){
		//sdiv.scrollTop=0;
		scrolling[k]=true;
		scroll(sdiv1, k);
	}else{
		
	}
	
}

function resetScroll(sdiv1,k){
	//document.write("<br>test");
	if(!hover[k]){
	sdiv = document.getElementById(sdiv1);
	sdiv.style.top=0+"px";
	resetStitle(sdiv1+'b',k);
	
	}//else{
	
		//setTimeout(resetScroll(sdiv1,k),50);
	//}
}
function resetStitle(sdiv2,k){
	//if(!hover[k]){
	sdivb = document.getElementById(sdiv2);
	sdivb.style.top=height-25+"px";
	//}
}

//setTimeout(function (){resetScroll(sdiv1, k);}, 20);


//-->