/*
Site-wide JS
*/

var flash_duration = 6000;

$(function(){
	setTimeout('hideMessages()', flash_duration);
	$("#top_search_field").focus(function(){
		if ($(this).val() == 'Search') {
			$(this).val('');
		}
	}).blur(function(){
		if ($(this).val() == '') {
			$(this).val('Search');
		}
	});
});

function hideMessages() {
	$("div.message").filter(function(){
		return $(this).css("display") != "none"; // don't do the fade action if it's already hidden!
	})
	.animate({
		top: '-=200px'
	}, 'normal', 'swing', function(){
		$(this).remove();
	});
}
