		function setTwit(json) {
			$.each(json, function(k, t) {
				if (k >= 3) {
					return false;	
				}
				
				var username = t.user.screen_name;
				var status = t.text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
					return '<a href="'+url+'" target="_blank">'+url+'</a>';
				}).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
					return  reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>';
				});
				
				var time = relative_time(t.created_at);
				
				$("#twitter-feed ul").append(
					$("<li>")
					.css('width', '93%')
					.append(
						$("<span>", {
							html: status
						}).addClass('update')
					)
					.append(
						$("<span>")
						.addClass('time')
						.append(
							$("<a>", {
								href: 'http://twitter.com/'+username+'/status/' + t.id_str,
								target: '_blank',
								title: 'View original tweet',
								text: time
							})
						)
					)
				);
			});
		}

		$(function() {
			/**
			 * Twitter Feed
			 */	 

			$.getScript("http://twitter.com/javascripts/blogger.js", function() {
				$.getScript("http://twitter.com/statuses/user_timeline/christmas_hill.json?callback=setTwit", function() {
					$("#twitter-feed").show();
					$('#twitter-feed ul').cycle({
						fx: 'fade',
						timeout: 6000
					});
				});			
			});

			/**
	         * Form validation
	         */	    	

			$("form").submit(function(e) {
				$(this).find("input[type=submit]").val("Please Wait...").attr("disabled", "disabled");
				$(this).parent().find("input, textarea").not("input[type=hidden]").each(function(){
					if (!$(this).val()) {
						$(this).addClass("error");	
					} else {
						$(this).removeClass("error");	
					}
				});
				
				if ($(this).find("input.error").length) {
					$(this).find("input[type=submit]").val("Submit").removeAttr("disabled");
					e.preventDefault();
				}
			});
			
			$(".error").live("keyup", function() {
				if ($(this).val()) {
					$(this).removeClass("error");
				}
			});			
		});
		
