	$(function(){
	
		/* === SPAM PROTECTION === */
		var comment_method = $("li#commentform form").attr('action')
		if(comment_method)
			$("li#commentform form").attr('action',comment_method.replace("-no-spam",""))
	
		/* === LOGO BORDER === */
		var logo_width = parseInt($("h1 a").css('width'))
		var diff = w_width - logo_width
		if(title == "Home") {
			var target = diff/2 + 1
			$("h1 a").css('border-left',target+'px solid yellow').css('border-right',target+'px solid yellow')
		}
		else {
			var target = diff - 15
			$("h1 a").css('border-right',target+'px solid yellow').css('border-left','15px solid yellow')
		}
	
		/* === PLACE HIGHTLIGHTING === */
		$("div.navigation ul li a").each(function(){
			if($(this).text().toLowerCase() == title.toLowerCase())
				$(this).addClass("current")
		})
		
		/* === COMMENT === */
		$("input[name='name']").focus(function(){
			if($(this).attr('value') == "Name") $(this).attr('value','')
			$(this).addClass('typing')
		})
		$("input[name='name']").blur(function(){
			if($(this).attr('value') == "") $(this).attr('value','Name')
			$(this).removeClass('typing')
		})
		$("textarea[name='comment']").focus(function(){
			if($(this).attr('value') == "Comment") $(this).attr('value','')
			$(this).addClass('typing')
		})
		$("textarea[name='comment']").blur(function(){
			if($(this).attr('value') == "") $(this).attr('value','Comment')
			$(this).removeClass('typing')
		})
		
		$("li#commentform form").submit(function(){
			var name = $(this).find('input[name="name"]').attr('value')
			var body = $(this).find('textarea').attr('value')
			var comment = "<p class='commenter'>"+name+"</p>"
				+ "<p class='commentbody'>"+body+"</p>"
			$(this).ajaxSubmit()
			$("li#comments ul li:first").after("<li class='comment even'>"+comment+"</li>")
			$(this).slideUp("slow",function(){
				$(this).empty()
				$(this).append("<h5>Thanks dude.</h5>")
				$(this).slideDown()
			})
			return false
		})
	
	})