function cleanLists() {
	$("ul").each(function() {
		for (var i = 0; i < this.childNodes.length; i++) {
			var node = this.childNodes[i];
			if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
				this.removeChild(node);
		}
		return this;
	});
}

function swapDefault() {
	$("input.blankout").each(function() {
		$(this).focus(function() {
			if(this.defaultValue && this.value == this.defaultValue) this.value = "";
			$(this).addClass("focus");
		}).blur(function() {
			if(this.defaultValue && !this.value.length) this.value = this.defaultValue;
			$(this).removeClass("focus");
		});
	});
}

function targetLinks() {
	$("a").click(function() {
		if (this.getAttribute("href") && this.getAttribute("rel") == "external") this.target = "_blank";
	});
}

/*function prettySubmit() {
	$("form input[@type=submit]").each(function() {
		$(this).before("<a href='' class='submit'>" + $(this).val() + "</a>");
	});

	$("form a.submit").click(function() { $(this).parents("form").submit(); return false });
}
*/

function smartHover() {	
	$("a").focus(function() { $(this).addClass("hover") }).blur(function() { $(this).removeClass("hover") });
}

function zebraRows() {
	$("div#list-body div:even").addClass("even");
}

function outboundLinks() {
	$("a.outbound").click( function(event) {
		var link		= $(this).attr("href");
		var entry_id	= $(this).attr("alt");
		
		if ( entry_id != "" )
		{
			$.post( "/main/log_click", {link:link, entry_id:entry_id}, function() {
				return true;
			});
		}
		
		// return false;
	});
}

jQuery(function($) {
});
