function firehose_toggle_prefs() {
	if ($("#fh_advprefs").is(":hidden")) {
		$("#fh_advprefs").fadeIn('fast');
	} else {
		$("#fh_advprefs").fadeOut('fast');
	}
	return false;
}

$(document).ready(function(){

/*
	$('div.tag-widget.opera span.tag-display').css('display','inline !important');
*/

	if($.browser.mozilla) {
		$('div#firehose-color-picker').css('top','-1px');
		$('div#doc3.yui-t6.index2 div#hd form').css('top','2.54em');
	}

	if($.browser.opera) {
		$('body').addClass('opera');
	}

	if($.browser.safari) {
		$('body').addClass('webkit');
		$('div.article-foot div.body-widget').css('display','block');
	}

	$("#slashboxes .block:last-child").prependTo(".head .yui-b").addClass("stats");
	$("#slashboxes .block:first-child").prependTo(".head .yui-b");
	$("#afterwidget span:first-child").css("border","none");

	$(".head .block .content").after("<div class='foot'>&nbsp;</div>");


	$('input[name="nothumbs"]').each( function() {
		if ($(this).attr('checked','checked')) {
			$('#firehose').addClass('vote_enabled');
		} else {
			$('#firehose').removeClass('vote_enabled');
		}
	});

	$('input[name="nocolors"]').each( function() {
		if ($(this).attr('checked','checked')) {
			$('#firehose').addClass('color_enabled');
		} else {
			$('#firehose').removeClass('color_enabled');
		}
	});

	$('.head .tags').appendTo('.head .article .body');

	/* Commenting */
	$('li.comment').parent('ul').parent('li').css('background','none');

	/* This is the nav visual treatment */
	$('#hd div.nav ul li:gt(0)').css('border-left','solid 1px #044');
	$('#ft div.nav ul li:gt(0)').css('border-left','solid 1px #ccc');
	$('#hd div.nav ul li.selected').next('li').css('border-left','none');
	$('#hd div.nav ul li.selected').css('border-left','none');

});

function firehose_marquee(op) {
	if (op == "hide") {
		firehose_set_options('nomarquee', 1);
		$("#marquee a").addClass('collapsed');
		$(".head").hide();
	} else if (op == "show") {
		firehose_set_options('nomarquee', 0);
		$("#marquee a").removeClass('collapsed');
		if($(".head").size()) {
			$(".head").show();
		} else {
			setTimeout("window.location.reload()", "2000");
		}
	}
}
