// on dom ready
$(function() {
	// ie 6 support for drop down menus
	$("ul.sf-menu li").each(function() {
		var thisHover = $(this);
		thisHover.hover(function() {
			thisHover.toggleClass("sfHover");
		}, function() {
			thisHover.toggleClass("sfHover");
		});
	});
	
	// add bottom border to drop down menus in ie
	$(".sf-menu li li:last-child").css("border-bottom", "1px solid #fff");
	
	// home page tabs
	var tabContentBoxes = $(".tabcontent");
	// equalize tab content heights
	var tallestBox = 0;
	tabContentBoxes.each(function() {
		thisHeight = $(this).height();
		if (thisHeight > tallestBox) {
			tallestBox = thisHeight;
		}
	});
	tabContentBoxes.height(tallestBox);
	// initialize tab behavior
	tabContentBoxes.hide().filter(":first").show();
	var tabs = $("#picktabs a");
	tabs.each(function() {
		var thisTab = $(this);
		thisTab.click(function() {
			var tabContentBoxToShow = thisTab.attr("rel");
			tabContentBoxes.hide().filter("#" + tabContentBoxToShow).show();
			tabs.removeClass("selected");
			thisTab.addClass("selected");
			return false;
		});
	});
	
	// embed Flash
	var params = {
		'quality': 'high',
		'menu': 'false',
		'wmode': 'transparent',
		'location': window.location,
		'scale': 'noscale'
	};
	swfobject.embedSWF("/media/launcher.swf", "flash-video", "422", "230", "9", false, false, params, false, function() {
		$("#flash-video").mousedown(function() {
			window.location = $("#vms-link").attr("href");
		});
	});
	swfobject.embedSWF("/media/launcher-side.swf", "flash-video-side", "218", "166", "9", false, false, params, false, function() {
		$("#flash-video-side").mousedown(function() {
			window.location = $("#vms-side-link").attr("href");
		});
	});
	swfobject.embedSWF("/newsparser/news-ticker.swf", "news-ticker", "990", "30", "9", false, false, params);
});