/**
 * Coda site functions
 * @author Julio Vedovatto <julio@juliovedovatto.com>
 */
;(function($){
	window['Coda'] = {
		init: function() {
			this.Comment.init();
		},
		Comment: {
			init: function() {
				$('form#postCommentForm input#comment-name')
					.focus(function(){
						if (this.value === 'name (required)')
							this.value = '';
					})
					.blur(function(){
						if ($.trim(this.value).length === 0)
							this.value = 'name (required)';
					});
				$('form#postCommentForm input#comment-email')
				.focus(function(){
					if (this.value === 'email (required)')
						this.value = '';
				})
				.blur(function(){
					if ($.trim(this.value).length === 0)
						this.value = 'email (required)';
				});
				$('form#postCommentForm input#comment-website')
				.focus(function(){
					if (this.value === 'website (optional)')
						this.value = '';
				})
				.blur(function(){
					if ($.trim(this.value).length === 0)
						this.value = 'website (optional)';
				});
				$('form#postCommentForm textarea#comment-text')
				.focus(function(){
					if (this.value === 'your comment (required)')
						this.value = '';
				})
				.blur(function(){
					if ($.trim(this.value).length === 0)
						this.value = 'your comment (required)';
				});
				
			}
		}
	};
	$(function(){ Coda.init(); });
})(jQuery);