/**
 * Adds hover events to a group of elements that add/remove a class.
 *
 */
function addHoverClass(selector, classname) {	
	$(selector).hover(function(){ 
		$(this).addClass(classname);
	}, function() {
		$(this).removeClass(classname);
	});
}

$(document).ready(function() {
	// Add hovers to all clickable things
	addHoverClass('.clickable', 'ui-state-hover');
	addHoverClass('div.feats', 'feats-hover');
	
	addHoverClass('div.entry', 'entry-hover');
	
	$('.linkable').click(function() {
		window.location = $(this).attr('href');
	});
	
	// Attach a keydown event to forms
	form = $('form[name="loginform"]').keypress(function(e) {
		if (e.which == 13) document.loginform.submit();
	});
	
	// Make hintable textboxes
	$('input.hintable').focus(function() {
		$(this).val('');
		$(this).css('color', '#000000');
	});
	
});
