function getY( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetTop;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function getX( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetLeft
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}


$(document).ready(function() {
	$('ol#nav a').each(function() {
	
		$(this).hover(function() {
			$('div.hiddenPopup-on').each(function() { 
				$(this).removeClass("hiddenPopup-on");
				$(this).addClass("hiddenPopup-off");
			});
			
			$('div#' + this.id + '_h').removeClass("hiddenPopup-off");
			
			$('div#' + this.id + '_h').addClass("hiddenPopup-on");

			var el_x =	getX(document.getElementById(this.id));
			var el_y =	getY(document.getElementById(this.id))+28; 
			
			$('div#' + this.id + '_h').css({ left: el_x, top: el_y });
		},
			function() {
				$('div#' + this.id + '_h').removeClass("hiddenPopup-on");
				$('div#' + this.id + '_h').addClass("hiddenPopup-off");
			}
		);
		
	});
	
	
	$('div[@id^=jmenu]').each(function() {
		$(this).mouseover(function() {
			$(this).removeClass("hiddenPopup-off");
  			$(this).addClass("hiddenPopup-on");
		});
		$(this).mouseout(function() {
			$(this).removeClass();
 			$(this).addClass("hiddenPopup-off");
		});
	});

	
});

