function ShowYear(year) {
	$('ol#blogmonths li').hide(0);
	$('ol#blogyears li.selected').removeClass('selected');
	$('ol#blogyears li#year' + year).addClass('selected');
	$('ol#blogmonths li.month' + year).show(0);
	return false;
}

function ShowMonth(month, year, monthTitle) {
	$('ol#blogmonths li.selected').removeClass('selected');
	$('ol#blogmonths li#month' + year + month).addClass('selected');
	if (month != 'All') {
	 	$('#monthplaceholder').html(' ' + monthTitle).show();
	} else {
		$('#monthplaceholder').hide();
	}
	$('#yearplaceholder').html(year);
	//load the archives for that month
	$('#listing').load('/blog/listing/' + year + '/' + (month != 'All' ? month + '/' : ''), function() {
		SyntaxHighlighter.highlight();
	});
	return false;
}

function PreviewComment() {
	var form = $('#comment_form');
	var serializedData = form.serialize() + '&preview=preview';

	var postUrl = form.attr("action");

	$.post(postUrl, serializedData, function(result) {
		$('div#commentsection').html(result);
		window.location.href = "#comment_preview";
	});
	return false;
}