current	 = 0;
numitems = 0;
function startScroller() {
	child = $("bannerscroller").getElementsByTagName('div');
	var cdim = Element.getDimensions(child[current-1]);
	new Effect.Move("bannerscroller", { x: 0, y: -(cdim.height+5), duration: 1.5, afterFinish: swapItem });
	function swapItem() {
		child = $("bannerscroller").getElementsByTagName('div');
		clone = document.createElement("div");
		clone.id = child[current-1].id;
		clone.style.marginBottom = "5px";
		clone.innerHTML = child[current-1].innerHTML;
		$("bannerscroller").appendChild(clone);
		current++;
	}
	$("bannerscroller").style.height = h;
}
var timer = Array();
var current = 1;
function popSub(el, show) {
	if (el) {
		if (current != el) {
			hidePop(current);
		}
		current = el;
		clearTimeout(timer[el]);
		main = document.getElementById("main"+el);
		popmenu = document.getElementById("sub"+el);
		if (show) {
			posx = findPosX(main);
			posy = findPosY(main);
			popmenu.style.left = (posx);
			popmenu.style.top = (posy+12);
			popmenu.style.display = 'block';
			main.style.backgroundColor = "FE0000";
		}
		else {
			timer[el] = setTimeout("hidePop("+el+")", 350);
		}
	}
}
function hidePop(el) {
	popmenu = document.getElementById("sub"+el);
	popmenu.style.display = 'none';
	main = document.getElementById("ss"+el);
	main.style.backgroundColor = "";
}
function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x) curleft += obj.x;
	return curleft;
}
function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y) curtop += obj.y;
	return curtop;
}
var h;
function startBannerScroll() {
	$("scrollBlockInnerTable").setStyle({   height: intBlokHoogte+'px' }); 
	$("container").setStyle({ height: intBlokHoogte+'px' }); 
	h = intBlokHoogte;
	child = $("bannerscroller").getElementsByTagName('div');
	$("bannerscroller").setStyle({   height: intBlokHoogte+'px' }); 
	numitems = child.length;
	if (numitems >= intMinimumScrollItems) {
		setInterval("startScroller()", 8000);
	}
}
