// MiniScroll Object
// gives controls to a set of 2 layers for scrolling
// 19990410

// Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License
// Available at http://www.dansteinman.com/dynapi/

function MiniScroll(window,content) {
	this.window = window
	this.content = content
	this.inc = 8
	this.speed = 20
	this.contentHeight = (is.ns4)? this.content.doc.height : this.content.elm.offsetHeight
	this.windowHeight = (is.ns4)? this.window.doc.height : this.window.elm.offsetHeight
	this.up = MiniScrollUp
	this.down = MiniScrollDown
	this.stop = MiniScrollStop
	this.activate = MiniScrollActivate
	this.activate()
}
function MiniScrollActivate() {
	this.offsetHeight = this.contentHeight - this.windowHeight
	this.enableVScroll = (this.offsetHeight>0)
}
function MiniScrollUp() {
	if (this.enableVScroll) this.content.slideTo(0,this.inc,this.speed)
}
function MiniScrollDown() {
	if (this.enableVScroll) this.content.slideTo(-this.offsetHeight,this.inc,this.speed)
}
function MiniScrollStop() {
	this.content.slideActive = false
}