$(document).ready(function(){
	// Clear field value when clicked
	$('.has_default_value').focus(function(){
		if ( $(this).val() == $(this).attr('title') ) { 
			$(this).val('');
		}
	});
	$('.has_default_value').blur(function(){
		if ( $(this).val() == '' ) {
			$(this).val($(this).attr('title'));
		}
	});
	// Drop-down menus
	$('div.header ul.navigation li ul').css({
		'left': '1px',
		'top': '24px'
	});
	$('div.header ul.navigation li ul').hide();
	$('div.header ul.navigation li').hover(function(){
		$(this).children('ul').fadeIn(150);
	},
	function(){
		$(this).children('ul').fadeOut(150);
	});
	// Remove focus outline on click
	$("a, input").mousedown(function(){
		this.blur();
		this.hideFocus = true;
		this.style.outline = 'none';
	});
	// Rollovers
	$(".rollover").hover(function(){
		$(this).attr("src", $(this).attr("src").split(".").join("_on."));
	},
	function(){
		$(this).attr("src", $(this).attr("src").split("_on.").join("."));
	});
	$(".rollover").each(function(){
		source_image = $(this).attr("src");
		rollover_image = source_image.replace(/\./gi, "_on.");
		$("<img>").attr("src", rollover_image);
	});
});