
function lib_bwcheck(){ 
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()

timSpeed = 50
contHeight = 100

function makeScrollObj(obj,nest){
	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.height=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.top=b_gettop										
	return this
}

var px = bw.ns4||window.opera?"":"px";

function b_gettop(){
	var gleft=(bw.ns4 || bw.ns6)?parseInt(this.css.top):eval(this.css.pixelTop);
	return gleft;
}

var scrollTim3 = 1;
var scrollTim4 = 1;
/* var scrollTim5 = 1; */
var active = 0;

function scroll3(speed){
	clearTimeout(scrollTim3)
	way = speed>0?1:0
	if ((!way && clScroll3[active].top()>-clScroll3[active].height+contHeight) || (clScroll3[active].top()<0 && way)){
		clScroll3[active].css.top = (clScroll3[active].top()+speed)+px
		scrollTim3 = setTimeout("scroll3("+speed+")",timSpeed)
	}
}

function scroll4(speed){
	clearTimeout(scrollTim4)
	way = speed>0?1:0
	if ((!way && clScroll4[active].top()>-clScroll4[active].height+contHeight) || (clScroll4[active].top()<0 && way)){
		clScroll4[active].css.top = (clScroll4[active].top()+speed)+px
		scrollTim4 = setTimeout("scroll4("+speed+")",timSpeed)
	}
}

/* function scroll5(speed){
	clearTimeout(scrollTim5)
	way = speed>0?1:0
	if ((!way && clScroll5[active].top()>-clScroll5[active].height+contHeight) || (clScroll5[active].top()<0 && way)){
		clScroll5[active].css.top = (clScroll5[active].top()+speed)+px
		scrollTim5 = setTimeout("scroll5("+speed+")",timSpeed)
	}
}

*/

function noScroll3(){
	clearTimeout(scrollTim3)
}

function noScroll4(){
	clearTimeout(scrollTim4)
}

/* function noScroll5(){
	clearTimeout(scrollTim5)
}
*/

function scrollInit(){
	
	clScroll3 = new Array()
	clScroll3[0] = new makeScrollObj('divScroll3','divCont3')
	clScroll3[0].css.left = 0+px
	clScroll3[0].css.top = 0+px
	clScroll3[0].css.visibility = "visible"
	oControl = new makeScrollObj('divControl3')
	oControl.css.visibility = "visible"


	clScroll4 = new Array()
	clScroll4[0] = new makeScrollObj('divScroll4','divCont4')
	clScroll4[0].css.left = 0+px
	clScroll4[0].css.top = 0+px
	clScroll4[0].css.visibility = "visible"
	oControl = new makeScrollObj('divControl4')
	oControl.css.visibility = "visible"


/*	clScroll5 = new Array()
	clScroll5[0] = new makeScrollObj('divScroll5','divCont5')
	clScroll5[0].css.left = 0+px
	clScroll5[0].css.top = 0+px
	clScroll5[0].css.visibility = "visible"
	oControl = new makeScrollObj('divControl5')
	oControl.css.visibility = "visible"
*/
	
}

onload = scrollInit;
 
