var isIE4 = false;
var isNav4 = false;
var isNav6 = false;

var gLayer;
var tTimer;

if (navigator.appVersion.charAt(0) == "4")
{
	if (navigator.appName.indexOf("Explorer") >= 0)
	{
		isIE4 = true;
	}
	else
	{
		isNav4 = true;
	}
}
else if (navigator.appVersion.charAt(0) > "4")
{
  isNav6 = true;
}

function Scroll(layername, step) 
{
	gLayer = layername;
	if (isIE4 || isNav6)
	{
		if (isIE4)
		{
			tCurrObj  = document.all[gLayer];
		}
		else
		{
			if (step > 0) { step = 10; } else {step = -10; }
			tCurrObj  = document.getElementById(gLayer)
		}
		
		tCurrClip = tCurrObj.style.clip
		tLength                      = tCurrClip.length - 1;
		tCleanClip                   = tCurrClip.substring(5, tLength);
		tSplit                       = tCleanClip.split(" ");
		tTop                         = parseInt(tSplit[0]);
		tRight                       = parseInt(tSplit[1]);
		tBottom                      = parseInt(tSplit[2]);
		tLeft                        = parseInt(tSplit[3]);
		tTop                         = tTop + (0 - step);
		tBottom                      = tBottom + (0 - step);
		if (tTop >= 0)
		{ 
		   	tCurrObj.style.top  = (parseInt(tCurrObj.style.top) + step);
		  	tCurrObj.style.clip = "rect("+tTop+" "+tRight+" "+tBottom+" "+tLeft+")";
		 	tTimer                         = setTimeout("Scroll(gLayer, "+step+")", 20);
		}
	}
	else if (isNav4)
	{
		tCurrClip                    = document.layers[gLayer].clip;
		tTop                         = tCurrClip.top;
		tRight                       = tCurrClip.right;
		tBottom                      = tCurrClip.bottom;
		tLeft                        = tCurrClip.left;
		tTop                         = tTop + (0 - step);
		tBottom                      = tBottom + (0 - step);
		if (tTop >= 0)
		{ 
		   	document.layers[gLayer].top  = (parseInt(document.layers[gLayer].top) + step);
		  	document.layers[gLayer].clip.top    = tTop;
		  	document.layers[gLayer].clip.bottom = tBottom;
		  	document.layers[gLayer].clip.left   = tLeft;
		  	document.layers[gLayer].clip.rigth  = tRight;
		 	tTimer                         = setTimeout("Scroll(gLayer, "+step+")", 20);
		}
	}
}

function stopScroll()
{
	clearTimeout(tTimer);
}

if(isNav4) { document.captureEvents(Event.MOUSEUP); }

document.onmouseup = stopScroll;