﻿
 var iTime=0;
function StartScrollDown(obj)	{
    
	if (obj.scrollHeight>160)	{
	  
	//document.write(obj.scrollWidth);
		//display the fade divs
		if (typeof(obj.parentNode.parentNode.firstChild.style)!='undefined')
			obj.parentNode.parentNode.firstChild.style.display = 'block';

		//obj.parentNode.parentNode.all(1).style.display = '';
		var iLastScrollLeft = obj.scrollTop;
		obj.scrollTop = obj.scrollTop + 1;
		if (obj.scrollTop==iLastScrollLeft)	{
			if (obj.attributes['endScrollPosition'].value==0)	{
				//obj.innerHTML = obj.innerHTML + "<br/><br/><br/><br/><br/><br/>";

				//obj.attributes['endScrollPosition'].value = obj.scrollTop + 14; //10-width of image
				//obj.innerHTML += obj.innerHTML;
	           //document.getElementById('downImg').style.display='none';				
			}
			else 
			{
			    obj.scrollTop = obj.attributes['endScrollPosition'].value;
			}
		}
		if (iTime==0)	{
			iTime = setInterval(function(){StartScrollDown(obj);},23);
		}
	}
}
function StartScrollUp(obj)	{

	if (obj.scrollHeight>180)	{
	//document.write(obj.scrollWidth);
		//display the fade divs
		if (typeof(obj.parentNode.parentNode.firstChild.style)!='undefined')
			obj.parentNode.parentNode.firstChild.style.display = 'block';

		//obj.parentNode.parentNode.all(1).style.display = '';
		var iLastScrollLeft = obj.scrollTop;
		obj.scrollTop = obj.scrollTop - 1;
		if (obj.scrollTop==iLastScrollLeft)	{
			if (obj.attributes['endScrollPosition'].value==0)	{
				//obj.innerHTML = obj.innerHTML + "<br/><br/><br/><br/><br/><br/>";

				//obj.attributes['endScrollPosition'].value = obj.scrollTop - 14; //10-width of image
				//obj.innerHTML += obj.innerHTML;
			}
			else obj.scrollTop = obj.attributes['endScrollPosition'].value;
		}
		if (iTime==0)	{

			iTime = setInterval(function(){StartScrollUp(obj);},23);
		}
	}
}
function StopScroll(obj)	{
	//alert(obj.scrollLeft);
	//hide the fade divs
	//obj.parentNode.parentNode.all(0).style.display = 'NONE';
	//obj.parentNode.parentNode.all(1).style.display = 'NONE';
	clearInterval(iTime);
	iTime = 0;
}

