$(function () {
	
	// Solve a nasty little display bug in IE6
	$("#footer").toggle().toggle();
				
	// Navigation on home page
	var tallest_menu = 0;
	$(".home #menu ul li ul").each(function () {
		tallest_menu = Math.max($(this).height(), tallest_menu);
	}).height(tallest_menu);
	$("#menu div.swirl").height(tallest_menu + 65);
	
	// Side Navigation
	$("body:not(.home) #menu a").click(function() {
		if ($(this).next("ul").length > 0) {
			$(this).next("ul").slideToggle(500, function() { 
				// The next line is to solve a nasty little display bug in IE
				$("#menu li ul, #footer").toggle().toggle();
				
			});
			return false;
		} else {
			return true;
		}
	});
	
	// FAQ
	$("dl.faq dt").wrapInner('<a href="#"></a>');
	$("dl.faq dd").hide();
	$("dl.faq dt a").click(function () {
		$(this).parent("dt").next("dd").slideToggle();
		return false;
	});
	
	// Clickable Image Map
	$('map.interactive area').attr('href', '#').click(function () {
		alert($(this).attr('alt'));
		return false;
	});
	
});


/* sIFR Configuration */

var myriad_web = { src: '/scripts/myriad-web.swf' };
sIFR.activate(myriad_web);

var sIFRcss_em = 'em { font-style:italic; }';
var sIFRcss_strong = 'strong { font-weight:bold; }';
var sIFRcss_a = 'a { color: #FF6600; text-decoration: none; }';
var sIFRcss_a_hover = 'a:hover { color: #1A0B72; text-decoration: none; }';

sIFR.replace(myriad_web, {
	selector: 'h1',
	css: [
		'.sIFR-root { font-weight:normal; color: #1A0B72; }',
		sIFRcss_em,
		sIFRcss_strong,
		sIFRcss_a,
		sIFRcss_a_hover
    ],
	wmode: 'transparent'
});

sIFR.replace(myriad_web, {
	selector: 'h2',
	css: [
		'.sIFR-root { font-weight:normal; color: #1A0B72; }',
		sIFRcss_em,
		sIFRcss_strong,
		sIFRcss_a,
		sIFRcss_a_hover
    ],
	wmode: 'transparent'
});

