jQuery(function(){

	jQuery('button.link').click(function(){
		window.location.href = $(this).find('span.href').text();
	});

	jQuery('form.destroy_link_to').submit(function(){
		if( !confirm('Seriously?') ){
			return false;
		}
	});

	jQuery('p.flash').click(function(){$(this).remove();});

});

jQuery(function(){

	jQuery('button.link').click(function(){
		window.location.href = $(this).find('span.href').text();
	});

	jQuery('form.destroy_link_to').submit(function(){
		var message = "Destroy?  Seriously?"
		if( this.confirm && this.confirm.value ) {
			message = this.confirm.value
		}
		if( !confirm(message) ){
			return false;
		}
	});

	jQuery('p.flash').click(function(){$(this).remove();});

});

Check form for confirm field and use it if it exists.
Check form for confirm field and use it if it exists.
