//check for browser

br4x=(((navigator.appName=="Netscape") || (navigator.appName == "Microsoft Internet Explorer")) && (parseInt(navigator.appVersion) >= 4 ));
IE4x=(br4x && (navigator.appName == "Microsoft Internet Explorer"));
NC4x=(br4x && (navigator.appName == "Netscape"));

//scrolling

contHeight = 350;

timSpeed =  20;
speed = 20;
stime=0;
coord=0;
sstop=0;
start=0;

var scrollTO;

function showScroller() {
	if (IE4x && (oScroll.scrollHeight > contHeight)) 
		{
		scrolltable.style.visibility="visible";
		scroller.style.visibility="visible";
		}
	else
		scrolltable.style.visibility="hidden";
}

function moveScroller() {
	scroller.style.posTop=-Math.ceil(295*(oScroll.top())/(oScroll.scrollHeight-contHeight));
	coord=scroller.style.posTop;
	stime=setTimeout(moveScroller,40); 
}

function startScroller() { 
	noscrollText();
	start=window.event.y;
	coord=scroller.style.posTop;
}

function  doScroller() {
	noscrollText();
	sstop= window.event.y;
	coord+=sstop-start;
	if (coord>295) coord=295;
	if (coord<0) coord=0;
	scroller.style.posTop=(coord);
}

function stopScroller() {
	sstop= window.event.y;
	coord+=sstop-start;
	if (coord>295) coord=295;
	if (coord<0) coord=0;
	scroller.style.posTop=(coord);
	oScroll.css.top=-scroller.style.posTop*(oScroll.scrollHeight-contHeight)/295;
	noscrollText();
}	
	
function b_gettop()
{
    var gleft=(NC4x) ? eval(this.css.top):eval(this.css.pixelTop);
    return gleft;
}

function makeScrollObj(obj,nest)
{
	nest=(!nest)? '':'document.rel.document.'+nest+'.';
	this.css=(NC4x)? eval(nest+'document.'+obj) : eval('document.all.'+obj+'.style');
	this.scrollHeight=(NC4x)? this.css.document.height : eval('document.all.'+obj+'.offsetHeight');
	this.top=b_gettop;
    return this;
}


function scrollText(obj,direction) 
{
	clearTimeout(scrollTO);
	if (oScroll.scrollHeight >= contHeight) {
	if	((direction<0 && oScroll.top() > -oScroll.scrollHeight + contHeight) || (oScroll.top()<0 && direction>0))
	{
		oScroll.css.top=oScroll.top()+(speed*direction);
		if (IE4x) moveScroller();
		scrollTO=setTimeout("scrollText('"+ obj + "', " +direction+")",  timSpeed);
    } 
	}
}

function noscrollText() 
{
    clearTimeout(stime);
	clearTimeout(scrollTO);
}

function init() 
{
	dc = (IE4x) ? eval('document.all.textCont.style') : eval('document.rel.document.textCont');
    
	dc.top = 0;
    dc.left = 0;
    dc.visibility='visible';

    oScroll = new makeScrollObj('text', 'textCont');   
	oScroll.css.top=0;         
	
	showScroller();
}


function MakeImageArray(n)	{
	this.length=n;
	for (var i=0; i<=n; i++) this[i] = new Image()
	return this;	}
