//////////////////////////////////////////////////////
//
//	The purpose of this file is to
//	apply a hover class on mouseover
//	on the <li> elements in the nav.
//	This is because IE doesn't put
//	the pseudo class :hover on <li> elements
//
//	This is code that uses the
//	jquery javascript library (http://jquery.com/)
//
//////////////////////////////////////////////////////
$(window).load(function() {
	if (document.all&&document.getElementById) {
		// this is needed for the IE 6 pseudo hover class bug
		$(".navsub li").hover(function () {
			$(this).addClass("hover");
		},function () {
			$(this).removeClass("hover");
		});
	} else {
		// this is need for safari when nav covers flash
		$(".navsub li ul").hover(function () {
			$(this).addClass("redraw");
		},function () {
			$(this).removeClass("redraw");
		});
	}
	
	// add bg arrow class to subnav drop down items with children
	$(".navsub li ul li ul").each(function () {
		$(this).parent().addClass("has_submenu");
		$(this).parent().hover(function () {
			$(this).addClass("hover_has_submenu");
		},function () {
			$(this).removeClass("hover_has_submenu");
		});
	});
	
	// change height on nav bars to fix safari bug
	if($.browser.safari) {
		$(function() {
			$("#headernav .navtop").addClass("safari_nav");
			$("#subnav").height("33px");
		});
	}
});

$(document).ready(function() {
	$("p.answer").hide();

	$("#expandable_list .question").toggle(function () {
		//$(this).next(".answer").height("1px");
		$(this).next(".answer").slideDown();
		$(this).addClass("question_open");
		//$(this).next(".answer").addClass("answer_open");
		$(this).parent(".question_group").addClass("open");
		return false;
	}, function() {
		$(this).next(".answer").slideUp();
		$(this).removeClass("question_open");
		//$(this).next(".answer").removeClass("answer_open");
		$(this).parent(".question_group").removeClass("open");
		return false;
	});
});
