// code for navigation

$(document).ready(function() {
	$(".nav").ready(function() { // scan the page for any navigations
		$(".sub").toggle(); // hide the sub menus
		
		$(".sub").parent().mouseover(function(){
			$(this).children(".sub").toggle(); // show the sub menu
		});
		
		$(".sub").parent().mouseout(function(){
			$(this).children(".sub").toggle(); // hide the sub menu
		});
	});
});

function scrAction(dir)
{
	scrPanelHeight = $("#pubList").height();
	scrAreaHeight = $("#euroSectList").height();
	scrPanelOffset = parseInt($("#pubList").css("margin-top").substr(0,$("#pubList").css("margin-top").length-2));

	if(dir == 'up' && scrPanelOffset < 0) { scrPanelOffset +=2; }
	if(dir == 'down' && (scrPanelHeight + scrPanelOffset > scrAreaHeight)) { scrPanelOffset -=2; }

	$("#pubList").css({marginTop:scrPanelOffset+"px"});
	scrActionTimeout = setTimeout("scrAction(\""+dir+"\")", 10);
}

function scrActionStop() {clearTimeout(scrActionTimeout);}

$(document).ready(function()
{
	$(".upArrow").hover(function() {scrAction('up');}, function() {scrActionStop();});
	$(".downArrow").hover(function() {scrAction('down');}, function() {scrActionStop();});
});