var timSpeed = 1
var active = 0;
var contHeight = 40
var scrollTim;
var iScrolllayerLeft = 0;
var iScrolllayerTop = 0;

function makeScrollObj(obj,nest){
	nest = (!nest) ? '':'document.'+nest+'.'										

	if (isNetscape4()) {
		this.css = eval(nest+'document.'+obj);
	} else if (isExplorer4()) {
		this.css = eval('document.all.'+obj+'.style');
	} else {
		this.css = getStyle(obj);
	}

	if (isNetscape4()) {
		this.scrollHeight = this.css.document.height;
	} else if (isExplorer4()) {
		this.scrollHeight = eval('document.all.'+obj+'.offsetHeight');
	} else {
		this.scrollHeight = getElementByIdNew(obj).offsetHeight;
	}

	this.top = b_gettop;

	return this;
}

function b_gettop(){
	var gleft;

	if (isNetscape4()) {
		gleft = eval(this.css.top);
	} else if (isNetscape() && getBrowserVersion() >= 5) {
		gleft = new Number(this.css.top.replace("px", ""));
	} else {
		gleft = eval(this.css.pixelTop);
	}

	return gleft;
}

function scroll(speed){
	clearTimeout(scrollTim)
	way = (speed>0) ? 1 : 0;
	if ((!way && oScroll[active].top()>-oScroll[active].scrollHeight+contHeight) || (oScroll[active].top()<0 && way)) {
		oScroll[active].css.top = oScroll[active].top() + speed;
		scrollTim = setTimeout("scroll(" + speed + ");",timSpeed);
	}
}

function noScroll(){
	clearTimeout(scrollTim)
}

function _layerscrollInit(){
	oScroll = new Array();
	oScroll[0] = new makeScrollObj('divScroll1','divCont');
	oScroll[0].css.visibility = 'visible'

	_positionScrollLayer();
}

function _positionScrollLayer() {
	var oStyle = getStyle("divCont");
	var iLayerX, iLayerY;

	iLayerX = Math.abs((getDocumentWidth() - 770) / 2) + iScrolllayerLeft;
	iLayerY = Math.abs(((getDocumentHeight() * 85 / 100 ) - 422) / 2) + iScrolllayerTop;

	oStyle.left = iLayerX;
	oStyle.top = iLayerY;
}

function setScrolllayerLeft(iLeft) {
	iScrolllayerLeft = iLeft;
}

function setScrolllayerTop(iTop) {
	iScrolllayerTop = iTop;
}

