$(document).ready(function()
{
	$("#top_menu>ul>li:has(ul)>a").append("<img src=\"/image/ui/top_menu/menu_down_arrow.gif\" alt=\"expandable\" />");
	$("#top_menu ul li ul li:has(ul)>a").append("<img src=\"/image/ui/top_menu/menu_right_arrow.gif\" alt=\"expandable\" />");
	$("#top_menu>ul>li>a:has(img)").css("padding-right","20px");
	$("#top_menu li:has(ul)").hover(
		function()
		{
			$(this).children("ul").show();
		},
		function()
		{
			$(this).children("ul").hide();
		});
});

$(document).ready(function()
{
	$("#pMenu>a").mouseover(function()
	{
		var sID = "s" + $(this).attr("id").substring(1);
		$(this).siblings("a").removeClass("active");
		$(this).addClass("active");
		$("#practiceServiceGuide .serviceLevel").hide();
		associatedService = $("#practiceServiceGuide #"+sID);
		practiceLeft = $(this).position().left;
		practiceTop = $(this).position().top;
		
		serviceTop = practiceTop - 25;
		if(practiceTop > 90) serviceTop = practiceTop + 25;
		associatedService.css("top", serviceTop + "px");
		
		viewportWidth = $("html").innerWidth();
		serviceLeft = practiceLeft;
		if(practiceLeft > viewportWidth / 2)
			associatedService.css("left", serviceLeft-associatedService.width() + $(this).width() + 30 + "px");
		else
			associatedService.css("left", serviceLeft + 10 + "px");
		
		associatedService.show();
	});
	$("div.serviceLevel").mouseleave(function()
	{
		$(this).hide();
	});
	
	$("#practiceServiceMenu li").hover(
		function()
		{
			$(this).children("ul").show();
		},
		function()
		{
			$(this).children("ul").hide();
		});
});
