// ########### jQuery.functions


var tagboard;
tagboard=$(document);
tagboard.ready(function(){
	var tagboard;
	tagboard=$("#sendtag");
	tagboard.live("click",function() {
		var v=$("#message").attr("value");
		$.ajax({
			async:true,
			type: "POST",
			url:"ajax.tagboard.php",
			data:"message="+v,
			beforeSend:function(loading) {
				$("#loading").remove();
				$("#errormsg").remove();
				$("#messages").prepend('<div class="center" id="loading"><img src="images/loading.gif" alt="" /></div>');
				$("#sendtag").focus();
			},
			success:function(data) {
				$("#messages").prepend(data);
				$("#loading").remove();
				$("#message").val('');
				$("#sendtag").focus();
			},
			error:function(data) {
				$("#messages").prepend('<strong class="red" id="errormsg">No se puede guardar el mensaje en este momento, prueba nuevamente más tarde...<br /><br /></strong>');
				$("#loading").remove();
				$("#message").val('');
			}
		}); 

	});

});


