//!\: jQuery Master Executor
$(document).ready(function()
{
	/* Run everything that's a non-function first... */
	if($.browser.msie && $.browser.version<="6.0")
	{
		$("#nav .topNavItem:first-child").addClass("firstChild");
		$("#nav .topNavItem:last-child").addClass("lastChild");

		$(".topNavItem").hover(function()
		{
			if($(this).hasClass("firstChild"))
			{
				$(this).addClass("topNavItemHoverFirst");
			}

			else if($(this).hasClass("lastChild"))
			{
				$(this).addClass("topNavItemHoverLast");
			}

			else
			{
				$(this).addClass("topNavItemHover");
			}

			$(".subContainer", this).show();
		}, function()
		{
			$(this).removeClass("topNavItemHoverFirst").removeClass("topNavItemHover").removeClass("topNavItemHoverLast");
			$(".subContainer", this).hide();
		});

		$(".pfiAlert").center();
	}

	$(".toggleBox .toggleContent").css({"display" : "none"})

	/* Run any plugin-based functions... */
	$("a[rel=external]").external();
	$("a.fontsize").fontsize();
	$(".toggleBox").toggleBox();

	if($.jqURL.get("fontsize"))
	{
		var href = "";
		var fontsize = $.jqURL.get("fontsize");

		$("body").css({"font-size" : fontsize});

		$("a").each(function()
		{
			if($(this).attr("href"))
			{
				href = $(this).attr("href");

				if(!href.match("http") && href.match(".aspx"))
				{
					$(this).attr("href", href + "?fontsize=" + fontsize);
				}

				href = null;
			}
		});
	}
});
