
function BrowserInfo(){
    this.ver=navigator.appVersion
    this.dom=document.getElementById?1:0;
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
}
bw=new BrowserInfo()

function ConstructObject(clipWidth, clipHeight, obj, nest){
	this.container=nest?eval(nest+"Object"):this
    nest=(!nest) ? '':'document.'+nest+'.' 
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
	this.clipHeight=bw.ns4?this.css.clip.height:clipHeight 
	this.scrollWidth=bw.ns4?this.css.document.width:this.el.offsetWidth 
	this.clipWidth=bw.ns4?this.css.clip.width:clipWidth 
	this.obj = obj + "Object"
	eval(this.obj + "=this")
	return this
} 

function ScrollWindow(width, height, content, container, up, down) {
    this.container=new ConstructObject(width, height, container)
    this.content=new ConstructObject(width, height, content, container)
	this.up=MoveAreaUp;
	this.down=MoveAreaDown;
	this.left=MoveAreaLeft;
	this.right=MoveAreaRight;
	this.MoveArea=MoveArea;
	this.x;
	this.y;
    this.MoveArea(10,0);
    this.container.css.visibility=bw.ns4?'show':'visible'
	if (this.container.clipHeight<this.content.scrollHeight) {
		if (up) {
			showLayer(findLayer(up));
			blurLinks(findLayer(up));
		}
		if (down) {
			showLayer(findLayer(down));
			blurLinks(findLayer(down));
		}
	}
	return this
}

function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.content.css.left=this.x 
    this.content.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.content.scrollHeight+this.container.clipHeight){ 
    this.MoveArea(this.x, this.y-move) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(this.x, this.y-move)
	}
} 
function MoveAreaRight(move){ 
	if(this.x>-this.content.scrollWidth+this.container.clipWidth){ 
    this.MoveArea(this.x-move, this.y) 
	} 
} 
function MoveAreaLeft(move){ 
	if(this.x<0){ 
    this.MoveArea(this.x-move, this.y)
	}
}
var scrollTimeout = null;
var ScrollDelay = 20;
var ScrollMultiplier = 1;
if (navigator.appName.indexOf("Netscape") >= 0 && navigator.appVersion.indexOf("Mac") >= 0) {
	ScrollMultiplier = 2;
} else if (navigator.appVersion.indexOf("MSIE 5.0") >= 0 && navigator.appVersion.indexOf("Macintosh") >= 0) {
	ScrollMultiplier = 6;
}
function ScrollDown(o, move) {
	eval(o).down(ScrollMultiplier*move);
	scrollTimeout = setTimeout("ScrollDown('"+o+"',"+move+")", ScrollDelay);
}
function ScrollUp(o, move) {
	eval(o).up(ScrollMultiplier*move);
	scrollTimeout = setTimeout("ScrollUp('"+o+"',"+move+")", ScrollDelay);
}
function ScrollLeft(o, move) {
	eval(o).left(ScrollMultiplier*move);
	scrollTimeout = setTimeout("ScrollLeft('"+o+"',"+move+")", ScrollDelay);
}
function ScrollRight(o, move) {
	eval(o).right(ScrollMultiplier*move);
	scrollTimeout = setTimeout("ScrollRight('"+o+"',"+move+")", ScrollDelay);
}
function StopScroll() {
	clearTimeout(scrollTimeout);
}


