$(function() {

	$('#primary_nav ul li:has(ul)').prepend('<a class="toggle">&nbsp;</a>');
	$('#primary_nav ul li ul').hide();

	$('#primary_nav .toggle').click(function() {
		if ($(this).parent().hasClass('active')) {
			$(this).parent().removeClass('active');
			$(this).next().next().hide();
		} else {
			$(this).parent().addClass('active');
			$(this).next().next().show();
		}
	});

    // png fix
    correctPNG();

	/* positioning of H1 based on its height */
	var top_margin = ($("#content h1").height() + 6) * -1;
    $("#content h1").css("margin-top", top_margin);
    $("#content #article_h1 h1").css("margin-top", 0);
    $(".watercooler_view #content h1").css("margin-top", 0);

	$(".new_window").each(
		function(){
			$(this).attr('target', '_blank');
		}
	);
    $('#search_input').click(function(){
       if ($(this).attr('value') == 'Search SixSeeds…') {
           $(this).attr('value', '');
       }
    });
});