//specify speed of scroll (greater=faster)
//defines the amount of pixels by which to scroll (or "jump per scroll")
var hspeed=3;

//another way to adjust scroll speed (greater=slower), default = 20
//defines milliseconds between scrolls
var htimeout = 30;

var hobj = null;
var contentwidth = null;

function moveleft()
{
	if (iens6 && parseInt(hobj.style.left) <= 0)
	{
		hobj.style.left = parseInt(hobj.style.left) + hspeed + "px";
	}
	else if (ns4 && hobj.left <= 0)
	{
		hobj.left += hspeed;
	}
		
	moveleftvar = setTimeout("moveleft()", htimeout);
}

function moveright()
{
	if (iens6 && parseInt(hobj.style.left) >= (contentwidth*(-1) + 320) )
	{
		//document.getElementById('testdiv').innerHTML += (parseInt(hobj.style.left)-hspeed);
		hobj.style.left=parseInt(hobj.style.left)-hspeed+"px";
	}
	else if (ns4&&hobj.left>=(contentwidth*(-1)+100))
	{
		hobj.left-=hspeed;
	}
	
	moverightvar=setTimeout("moveright()", htimeout)
}

function hscroll(coord)
{
	if( iens6 && (parseInt(hobj.style.left)) >= (contentwidth*(-1) + 320) )
	{
		hobj.style.left = (parseInt(hobj.style.left) - coord) + "px";
	}
	else if ( ns4 && hobj.left >= (contentwidth*(-1) + 100) )
	{
		hobj.left=coord;
	}
}

function resetgallery()
{
	if( iens6 && (parseInt(hobj.style.left)) >= (contentwidth*(-1) + 320) )
	{
		hobj.style.left = "0px";
	}
	else if ( ns4 && hobj.left >= (contentwidth*(-1) + 100) )
	{
		hobj.left=0;
	}
}

function getgallery_width()
{
	if (iens6)
	{
		hobj = document.getElementById ? document.getElementById("gallerycontent") : document.all.gallerycontent;
		contentwidth = document.getElementById('tblGallery').offsetWidth;
		//contentwidth=hobj.offsetWidth;
		//alert(document.getElementById('tblGallery').offsetWidth);
	}
	else if (ns4)
	{
		hobj=document.nscontainer.document.nscontent;
		contentwidth=hobj.clip.width;
	}
}