var compListOver = false;
var listTop = 0;
var listHeight = 350;
var screenHeight;
var speed = 66;// lower numbers are faster

function CompListWidget (rootDiv) {
	this.rootDiv = rootDiv;
}

CompListWidget.prototype.show = function() {
	document.getElementById(this.root).innerHTML = "Friend List";
}

function updateCompListScreen () {
    screenHeight = document.getElementById('compListScreen').style.height;
    screenHeight = screenHeight.split('px');
    screenHeight = screenHeight[0];

    if(screenHeight >= 300) {
	document.getElementById('compListScroll').style.display = "block";
	document.getElementById('compListScreen').style.width = "129px";
    }
}

function scrollUp () {
	if(listTop <= (listHeight-screenHeight) || compListOver == false) {
		return false;
	}
	listTop -= 10;
	var topPos = "" + listTop + "px";
	document.getElementById('compListScreen').style.top = topPos;
	setTimeout('scrollUp()', speed);
}

function scrollDown () {
	if(listTop >= 0 || compListOver == false) {
		return false;
	}
	listTop += 10;
	var topPos = "" + listTop + "px";
	document.getElementById('compListScreen').style.top = topPos;
	setTimeout('scrollDown()', speed);
}