﻿function rollover(id) {
	var control = $("#" + id);
	if (control.attr("src").indexOf("_over") != -1) {
		control.attr("src", control.attr("src").replace("_over", "_off"));
	}
	else {
		control.attr("src", control.attr("src").replace("_off", "_over"));
	}
}

function bottomroll(state) {
	var navbottom = $("#navround");
	var navlastlink = $("#lastnavitem");

	if (state == "over") {
		navbottom.attr("class", "navItem_bottom_over");
		navlastlink.attr("class", "navItem_over");
	}
	else {
		navbottom.attr("class", "navItem_bottom");
		navlastlink.attr("class", "navItem");
	}
}

function rollIndexCallouts(callout, state) {
	var rollerTd = $("#" + callout + "callout");

	if (state == "over")
		rollerTd.attr("class", callout + "_over");
	else
		rollerTd.attr("class", callout);
}

function setFontSize(point) {
    $("#pageContent *").not("h1.indexBanner,h2.indexBanner,h2.indexBanner > sup,h2.indexBanner > strong").css("font-size", point + "px");

	var version = $.browser.version.substr(0, 1)*1;
	if ($.browser.msie && version < 8) {

		var bodyHeight = $("#searchBar").height();
		bodyHeight = bodyHeight + $("#pageContent").height();
		bodyHeight = bodyHeight + $("#footerinfo").height();
		bodyHeight = bodyHeight + $("#pageEnd").height();
		bodyHeight = bodyHeight + 41; // minor adjustment for PageHeader height.  ID set dynamically, so can't pull element.

		$("#outerBody").css({ "clip": "rect(0px,1500px," + bodyHeight + "px,0px)" });
	}
}

$(document).ready(function() {
	var version = $.browser.version.substr(0, 1)*1;
	if ($.browser.msie && version < 8) {

		var bodyHeight = $("#searchBar").height();
		bodyHeight = bodyHeight + $("#pageContent").height();
		bodyHeight = bodyHeight + $("#footerinfo").height();
		bodyHeight = bodyHeight + $("#pageEnd").height();
		bodyHeight = bodyHeight + 41; // minor adjustment for PageHeader height.  ID set dynamically, so can't pull element.

		$("#outerBody").css({ "clip": "rect(0px,1500px," + bodyHeight + "px,0px)" });
	}
});

jQuery().ready(function() {
	// second simple accordion with special markup
	jQuery('#navigation').accordion({
		active: false,
		header: '.head',
		navigation: true,
		event: 'onclick',
		fillSpace: false,
		animated: 'easeslide',
		autoheight: false
	});
    
	var version = $.browser.version.substr(0,1)*1;

	if($.browser.msie && version < 7) {
		var offset = $("#leftNav").height();
		$("#pageContent").css("top", -220-(offset*1));
		
		var footerOffset = 130-(offset*1);
		//alert("footerOffset: " + footerOffset.toString());
		$("#footerinfo").css("top", footerOffset);
	}
});
//    pathname = document.location.pathname;
//    $("#navigation a").filter(function(index) { return $(this).attr("href") == pathname && $(this).attr('class').match(/head/); })
//		  .css({ "background": "#0e4d85 url('../../Content/Images/Nav/main_nav_on_gradient.jpg') no-repeat", 'color': 'white', 'border-bottom': '0px' });
//    $("#navigation a").filter(function(index) { return $(this).attr("href") == pathname && !$(this).attr('class').match(/head/); })
//                      .css('background', '#AFBAE0')
//                      .parent().parent().prev()
//                      .css({ "background": "#0e4d85 url('../../Content/Images/Nav/main_nav_on_gradient.jpg') no-repeat", 'color': 'white', 'border-bottom': '0px' });


