jQuery(document).ready(function($){

	var urlRe = /.*(comment-\d+)$/;
	var match = urlRe.exec(location.href);
	if (match) {
	    $("#meta-tabs").data("tabs").click("comments-page");
	    var commentDiv = $('#' + match[1]);
	    if (commentDiv.size() > 0) {
	        var commentDivOffset = commentDiv.offset();
	        window.scrollTo(commentDivOffset.left, commentDivOffset.top);
	        commentDiv.animate({backgroundColor: '#F8F8F8'}).animate({backgroundColor: '#FFF'});
	    }
	}

	// tabs
	$("#meta-tabs").tabs("div.pane", { history: true });

	//fading links
	$('#content a, #sidebar a, #footer a, .bio-teaser a').dwFadingLinks({
		color: '#2A160B',
		duration: 300
	});
	
	$('#navbar a').dwFadingLinks({
		color: '#83a010',
		duration: 300
	});
	
	$('#bottom a').dwFadingLinks({
		color: '#b2d625',
		duration: 300
	});

	$(".comment-field input, .comment-field textarea").focus(function() {
		$(this).parent().addClass("curFocus")
	});
	$(".comment-field input, .comment-field textarea").blur(function() {
		$(this).parent().removeClass("curFocus")
	});

	//konami code
	$(window).konami(function(){
		$('html, body').animate({scrollTop:0}, 'slow');	
		$("#easter").slideToggle("slow");
	});
	
	$('.easter-close').click(function(){
		$("#easter").slideToggle("slow");
	});
	
	// thumb sliders
	$('.thumb-container.thumb-caption-full').hover(function(){
		$(".thumb-caption", this).stop().fadeTo("fast", 0.9);
	}, function() {
		$(".thumb-caption", this).stop().fadeTo("fast", 0.0);
	});

	// animated scroll to top
	$('#top-link').click(function(){
		$('html, body').animate({scrollTop:0}, 'slow');
	});

			 
});	

	
