function scrl() {
	this.oContent = document.all["content"];
	this.oContent.style.top = 40;
	this.iScroll = 1;
	this.iScrollBy = 0;

	this.iContentPaneHeight = 153;
	this.iScrollHeight = 105;
	this.iContentHeight = document.all["contentbottom"].offsetTop;
	this.iScrollMax = (this.iContentHeight - this.iContentPaneHeight);

	this.setScrollBar = scrl_setScrollBar;
	this.scrollup = scrl_scrollup;
	this.scrolldown = scrl_scrolldown;
	this.scrollTo = scrl_scrollTo;

	this.arrowup_mdown = scrl_aup_mdown;
	this.arrowup_mup = scrl_aup_mup;
	this.arrowdown_mdown = scrl_adown_mdown;
	this.arrowdown_mup = scrl_adown_mup;
	this.spacingtop_mdown = scrl_sptop_mdown;
	this.spacingtop_mup = scrl_sptop_mup;
	this.spacingbottom_mdown = scrl_spbottom_mdown;
	this.spacingbottom_mup = scrl_spbottom_mup;
	this.scrollbar_mdown = scrl_scrl_mdown;
	this.scrollbar_mmove = scrl_scrl_mmove;
	this.scrollbar_mup = scrl_scrl_mup;
	this.dragging = false;
	this.lasty = 0;

	this.oScrollSpacingTop = document.all["scrollspacingtop"];
	this.oScrollBar = document.all["scrollbar"];
	this.oScrollSpacingBottom = document.all["scrollspacingbottom"];

	this.bDown = false;
}

function scrl_setScrollBar() {
	if (this.iScrollMax > 0 && (this.iScroll > this.iScrollMax || this.iScroll < 1)) return;
	var iScrollBarMult = ((this.iContentPaneHeight / this.iContentHeight < 1) ? this.iContentPaneHeight / this.iContentHeight : 1);
	var iScrollSpacingMult = ((this.iScroll / this.iScrollMax < 1) ?  this.iScroll / this.iScrollMax : 1);

	try	{
		this.oScrollSpacingTop.style.height = Math.round(this.iScrollHeight * ((1 - iScrollBarMult) * (iScrollSpacingMult))) + "px";
		this.oScrollBar.style.height = Math.round(this.iScrollHeight * iScrollBarMult) + "px";
		this.oScrollSpacingBottom.style.height = Math.round(this.iScrollHeight * ((1 - iScrollBarMult) * (1 - iScrollSpacingMult))) + "px";
		this.oContent.style.height = this.iContentPaneHeight + this.iScroll + "px";
	} catch (e) {
	}

}

function scrl_aup_mdown() {
	this.iScrollBy = 25;
	this.bDown = true;
	this.scrollup();
}

function scrl_aup_mup() {
	this.bDown = false;
}


function scrl_adown_mdown() {
	this.iScrollBy = 25;
	this.bDown = true;
	this.scrolldown();
}

function scrl_adown_mup() {
	this.bDown = false;
}

function scrl_sptop_mdown() {
	this.iScrollBy = 45;
	this.bDown = true;
	this.scrollup();
}

function scrl_sptop_mup() {
	this.bDown = false;
}


function scrl_spbottom_mdown() {
	this.iScrollBy = 45;
	this.bDown = true;
	this.scrolldown();
}

function scrl_spbottom_mup() {
	this.bDown = false;
}

function scrl_scrl_mdown() {
	if (netscape) return;
	this.iScrollBy = 1;
	this.dragging = true;
	this.lasty = window.event.screenY;
}

function scrl_scrl_mmove(){
	if (!this.dragging) return;
	if (netscape) return;
	this.iScrollBy = (window.event.screenY - this.lasty) * 6;
	if (this.iScrollBy < 0) this.iScrollBy *= -1;
	if (window.event.screenY < this.lasty) this.scrollup();
	else this.scrolldown();
	this.lasty = window.event.screenY;
	FinishEvent();
}

function scrl_scrl_mup() {
	if (netscape) return;
	this.dragging = false;
}

function scrl_scrollup() {
	if (this.iScroll - this.iScrollBy >= 0) {
		this.oContent.style.top = parseInt(this.oContent.style.top) + this.iScrollBy;
		this.iScroll -= this.iScrollBy;
		if (this.bDown == true) oScrollTimer = window.setTimeout("oScrl.scrollup();", 51);
		this.setScrollBar();
	} else this.scrollTo(1);
}

function scrl_scrolldown() {
	if (this.iScroll + this.iScrollBy < this.iScrollMax) {
		this.oContent.style.top = parseInt(this.oContent.style.top) - this.iScrollBy;
		this.iScroll += this.iScrollBy;
		if (this.bDown == true) oScrollTimer = window.setTimeout("oScrl.scrolldown();", 51);
		this.setScrollBar();
	} else this.scrollTo(this.iScrollMax-1);
}

function scrl_scrollTo(iScrollTo) {
	this.bDown = false;
	if (this.iScroll < iScrollTo) {
		this.iScrollBy = iScrollTo - this.iScroll;
		this.scrolldown();
	} else {
		this.iScrollBy = this.iScroll - iScrollTo;
		this.scrollup();
	}
}


function FinishEvent() {
	window.event.cancelBubble = true;
	window.event.returnValue = false;
	return false;
}

function ac() {
	netscape = (!document.all && document.getElementsByTagName && typeof(document.getElementsByTagName) == "function");
	if (netscape) document.all = document.getElementsByTagName("*");
}
ac();

