// JavaScript Document
var jsReady = false;
var bridge;
function isReady() { return jsReady; }
function pageInit() { jsReady = true; bridge = document.getElementById("loader"); }
function sendToActionScript(value) { bridge.sendToActionScript(value); }
function BridgeFlash(value) { sendToActionScript(value); }
window.onload = pageInit;

function SetScrolling(root)
{
	var step = 10;
	var loc = root;
	
	var up = loc + 'actus_img/icons/scrollup.gif';
	var down = loc + 'actus_img/icons/scrolldown.gif';
	
	var up_o = loc + 'actus_img/icons/scrollup_over.gif';
	var down_o = loc + 'actus_img/icons/scrolldown_over.gif';
	
	$('.contentcontainer').addClass("contentcontainerscriptadded");
	
	if ($('.contentcontainer')[0].scrollHeight > 310)
	{
		$("ul.columns li.left").append('<img id="scrollup" class="over" src="' + up + '" width="17" height="17" alt="scroll up" />');
		$("ul.columns li.left").append('<img id="scrolldown" class="over" src="' + down + '" width="17" height="17" alt="scroll down" />');
	}
	
	$("#scrollup").mouseover(function(event)
	{	
		$(this).attr("src", up_o);
	}).mouseout(function() {
		$(this).attr("src", up);
	});
	
	$("#scrolldown").mouseover(function(event)
	{	
		$(this).attr("src", down_o);
	}).mouseout(function() {
		$(this).attr("src", down);
	});
	
	var timer;
	var utimer;
	
	$("#scrollup").mousedown(function(event)
	{
		$('.contentcontainer').scrollTop($('.contentcontainer').scrollTop()-step);
		
		utimer = setInterval(function() 
		{
			$('.contentcontainer').scrollTop($('.contentcontainer').scrollTop()-(step/2));
			
		}, 10);
		
	});
	
	$("#scrollup").mouseup(function(event){ clearInterval(utimer); });
	$("#scrollup").mouseleave(function(event){ clearInterval(utimer); });
	
	$("#scrolldown").mousedown(function(event)
	{
		$('.contentcontainer').scrollTop($('.contentcontainer').scrollTop()+step);
		
		timer = setInterval(function() 
		{
			$('.contentcontainer').scrollTop($('.contentcontainer').scrollTop()+(step/2));
			
		}, 10);
	
	});
	
	$("#scrolldown").mouseup(function(event){ clearInterval(timer); });
	$("#scrolldown").mouseleave(function(event){ clearInterval(timer); });

};
 
 