$.fn.extend({
	reset:function(){
		return this.each(function(){
			$(this).is('form') && this.reset();
		})
	}
});

$(document).ready(function(){
	$('input.lbl').focus(function(){
		if($(this).val() == $(this).attr('title')) $(this).val('');
	}).blur(function(){
		if($(this).val() == '') $(this).val($(this).attr('title'));
	});
	
	$("div.scrollable").scrollable({size:3,keyboard:false});

	$('#newsletter-msg').click(function(){
		$(this).hide();
	});
	
	$('#fnewsletter').submit(function(){
		$('#newsletter-msg').hide();
		$.ajax({
			type: 	'POST',
			url: 	'/newsletters/add',
			data: 	$(this).serialize(),
			success: function(msg){
				$('#newsletter-msg').html(msg).addClass("ohmy").show("slow", function(){
					setTimeout(function(){
						$('#newsletter-msg').hide('slow');
					}, 3000);
				});
			}
		});
		
		return false;
	});
	
});