 
jQuery(document).ready(function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
});

jQuery(document).ready(function($) {
	$('#search_input').focus(function(){if (this.value=='Search...') this.value='';})
	$('#search_input').blur(function(){if (this.value=='') this.value='Search...';})
});

/* for articles only right now but good for browser caching */
jQuery(document).ready(function($){
	var form = $("#rating-form");
	if(!form)
		return;
	form.hide();
	$("#rating-replacement").show();
	$("#thumbs-up").click(function(){
		$("#id_rating_0").attr("checked", "");
		$("#id_rating_1").attr("checked", "checked");
		$.post(form.attr("action"),
			form.serialize(),
			function(data, status, xhr) {
				$("#rating-replacement").html(data);
		});
		return false;
	});
	$("#thumbs-down").click(function(){
		$("#id_rating_1").attr("checked", "");
		$("#id_rating_0").attr("checked", "checked");
		$.post(form.attr("action"),
			form.serialize(),
			function(data, status, xhr) {
				$("#rating-replacement").html(data);
		});
		return false;
	});
});		



