var intScrollTimeOut=0;
var intScrollAllowed=false;
var intScrollContentWidth=0;

var __ARR_SCROLLS__=[];
var __ARR_SCROLLS_PROPS__=[];

function set_scroll(strScrollName){
	__ARR_SCROLLS__[__ARR_SCROLLS__.length]=strScrollName;
	__ARR_SCROLLS_PROPS__[strScrollName]=[];
	__ARR_SCROLLS_PROPS__[strScrollName].width=0;
	__ARR_SCROLLS_PROPS__[strScrollName].allow=false;
	__ARR_SCROLLS_PROPS__[strScrollName].timeout=0;
}

function scrollMeLeft(strScrollName){
	if(__ARR_SCROLLS_PROPS__[strScrollName].allow){
		if(__ARR_SCROLLS_PROPS__[strScrollName].timeout) clearTimeout(__ARR_SCROLLS_PROPS__[strScrollName].timeout);
		if(dlib_layers(strScrollName+"_ctt", LEFT)+__ARR_SCROLLS_PROPS__[strScrollName].width>dlib_layers(strScrollName+"_ctn", WIDTH)+3){
			dlib_layers(strScrollName+"_ctt", LEFT, add(-8));
			__ARR_SCROLLS_PROPS__[strScrollName].timeout=setTimeout('scrollMeLeft("'+strScrollName+'")', 50);
			return true;
		}
	}
	return false;
}

function scrollMeRight(strScrollName){
	if(__ARR_SCROLLS_PROPS__[strScrollName].allow){
		if(__ARR_SCROLLS_PROPS__[strScrollName].timeout) clearTimeout(__ARR_SCROLLS_PROPS__[strScrollName].timeout);
		if(dlib_layers(strScrollName+"_ctt", LEFT)<-3){
			dlib_layers(strScrollName+"_ctt", LEFT, add(8));
			__ARR_SCROLLS_PROPS__[strScrollName].timeout=setTimeout('scrollMeRight("'+strScrollName+'")', 50);
			return true;
		}
	}
	return false;
}

function scrollMeUp(strScrollName){
	if(__ARR_SCROLLS_PROPS__[strScrollName].allow){
		if(__ARR_SCROLLS_PROPS__[strScrollName].timeout) clearTimeout(__ARR_SCROLLS_PROPS__[strScrollName].timeout);
		if(dlib_layers(strScrollName+"_ctt", TOP)+__ARR_SCROLLS_PROPS__[strScrollName].width>dlib_layers(strScrollName+"_ctn", HEIGHT)+3){
			dlib_layers(strScrollName+"_ctt", TOP, add(-3));
			__ARR_SCROLLS_PROPS__[strScrollName].timeout=setTimeout('scrollMeUp("'+strScrollName+'")', 5);
			return true;
		}
	}
	return false;
}

function scrollMeDown(strScrollName){
	if(__ARR_SCROLLS_PROPS__[strScrollName].allow){
		if(__ARR_SCROLLS_PROPS__[strScrollName].timeout) clearTimeout(__ARR_SCROLLS_PROPS__[strScrollName].timeout);
		if(dlib_layers(strScrollName+"_ctt", TOP)<-3){
			dlib_layers(strScrollName+"_ctt", TOP, add(3));
			__ARR_SCROLLS_PROPS__[strScrollName].timeout=setTimeout('scrollMeDown("'+strScrollName+'")', 5);
			return true;
		}
	}
	return false;
}

function doNotScrollMeAnyMore(strScrollName){
	if(__ARR_SCROLLS_PROPS__[strScrollName].timeout) clearTimeout(__ARR_SCROLLS_PROPS__[strScrollName].timeout);
}

function launchScrollScripts(){
	for(intScroll=0; intScroll<__ARR_SCROLLS__.length; intScroll++){
		__ARR_SCROLLS_PROPS__[__ARR_SCROLLS__[intScroll]].width=dlib_anchors(__ARR_SCROLLS__[intScroll]+"_a", LEFT);
		__ARR_SCROLLS_PROPS__[__ARR_SCROLLS__[intScroll]].allow=true;
	}
}

function scrollinit(){
	for(intScroll=0; intScroll<__ARR_SCROLLS__.length; intScroll++){
		dlib_anchors(__ARR_SCROLLS__[intScroll]+"_a");
		dlib_layers(__ARR_SCROLLS__[intScroll]+"_ctn", WIDTH, document.getElementById(__ARR_SCROLLS__[intScroll]+"_ctn").offsetWidth);
	}
	setTimeout("launchScrollScripts()", 100);
}