function onPageLoad(tabIndex,pageIndex)
{
// BEGIN: Top Nav
	// find the proper section and give it an ID (to make the tab)
	$("#nav > li:eq(" + tabIndex + ")").attr({id:"current-section"});
	// find the current page within the proper section and give it an ID
	$("#current-section ul a:eq(" + pageIndex + ")").attr({id:"current-page"});
	$("#current-section ul li:first-child a, .panel-top ul li:first-child").css({background:"none", paddingLeft:"0"});
	$("#current-section > a:first-child").addClass("current-link");
// END: Top Nav
	
// BEGIN: Popups
	function hidePopups(){
		$(".popup").hide();
	}
	
	// This just saves us from having to enter the inner <div> on every popup
	$(".popup").wrapInner('<div class="inner-popup"></\div>');
	
	// When the page loads, hide all the popups
	hidePopups();

	$(".trigger").click(function(event){
		// Every time a popup trigger is clicked on, hide any popups that may be visible
		hidePopups();
		// Clone the current popup and add it to the end of the wrapper <div>
		var cloned = $(this).next().clone(true);
		$("#wrapper").after(cloned);
		// Position the cloned popup and make it slide down
		cloned.css({"top":event.pageY + 6, "left":event.pageX - cloned.width()});
		cloned.slideDown(300);
		// Prevent the default action from taking place (usually a URL)
		event.preventDefault();
	});

	$("body").click(function(){
		hidePopups();
	});
	
	$(".popup").click(function(event){
		event.stopPropagation();
	});

	$(window).resize(function(){hidePopups();});
// END: Popups


// BEGIN: Right Click
	/*$(".filetree span").rightClick(function(event, evt){
		// Every time a popup trigger is clicked on, hide any popups that may be visible
		hidePopups();
		// Clone the current popup and add it to the end of the wrapper <div>
		var cloned = $("#folders .popup").clone(true);
		$("#wrapper").after(cloned);
		// Position the cloned popup and make it slide down
		cloned.css({"top":evt.pageY + 6, "left":evt.pageX - cloned.width()});
		cloned.slideDown(300);
		// Prevent the default action from taking place (usually a URL)
	});*/
// END: Right Click


// BEGIN: Directory Tree View
	/*$(".filetree").treeview({
		animated: 200
	})
	
	$(".filetree span").click( function() {
		$(".filetree span").removeClass("selected-directory");
		$(this).addClass("selected-directory");
	});*/
// END: Directory Tree View


// BEGIN: Calendars
	/*$(".calendar, .date-picker").datepicker({
		changeFirstDay: false
	});
// END: Calendars


// BEGIN: Filtered Tables
	$("#active-candidates .table1").columnFilters({alternateRowClassNames:['even',''], excludeColumns:[0,6,7,8,9]});
// END: Filtered Tables


// BEGIN: Target Bar
	$(".fraction").each(function(){
		var num = $(this).text().split("/");
		var calcu = (num[0] / num[1]) * 80;
		$(this).prepend('<span style="width:' + Math.round(calcu) + 'px"></span>');
	});

	$(".percent").each(function(){
		var num = $(this).text().split("%");
		var calcu = (num[0] * .01) * 80;
		$(this).prepend('<span style="width:' + Math.round(calcu) + 'px"></span>');
	});
// END: Target Bar


// BEGIN: General Tables
	$("input:hidden").addClass("hide");
	$(".table1 > tbody > tr:odd").addClass("odd");
	$(".table1 > tbody > tr:even").addClass("even");
	//$("th:contains('Action')").width(200);
// END: General Tables


// BEGIN: Sortable Tables
	$.tablesorter.defaults.widgets = ['zebra'];

	$("#active-requirements .table1").tablesorter({
		headers: {
			7: {
				sorter: false
			}
		}
	});
	
	$("#active-candidates .table1").tablesorter({
		headers: {
			9: {
				sorter: false
			}
		}
	});
	
	$("#document-explorer .table1").tablesorter({
		headers: {
			4: {
				sorter: false
			}
		}
	});
	
	$("#document-explorer .table1 tr td:first-child").addClass("file-name");
// END: Sortable Tables


// BEGIN: Scrollable Tables
	if (jQuery.browser.msie && parseInt(jQuery.browser.version) == "6")
	{
		var tableWidth = 750;
	}
	else
	{
		var tableWidth = 750;
	}	
	$("#document-explorer .table1").Scrollable(411, 750);
// END: Scrollable Tables

*/
// IE6 BUG: Elements Disappear when Expanding
/*
	$(".panel-top h2").hover
	(
		function()
		{
			$(this).css({cursor:"pointer", color:"#000"});
		},
		function()
		{
			$(this).css({color:"#eb201c"});
		}
	);
	
	$(".panel-top h2").click
	(
		function()
		{
			$(this).parent().parent().find(".panel").slideToggle("slow");
		}
	);
*/
}

