function showComment() {
	if ($('com_form').style.display == "none") {
		$('content').setStyle({
			'height' : 'auto'
		})
		document.getElementById('captcha_img').src='blog/captcha/'+new Date().getTime();
		Effect.BlindDown('com_form');
		
	} 
	return false;
}

function doComment()
{
	$('msg').innerHTML = "";
	new Ajax.Request(baseURL + 'blog/ajax/comment',
	{
			method: 'post',
			postBody: Form.serialize($('com_form')),
			onComplete: function(tl) {
				result = tl.responseText.evalJSON();
				
				if (result.error == 1) {
					$('msg').innerHTML = result.msg;
				} else if (result.error == 0) {

					if ($$(".comment").length <= 0) {
						$('comments').innerHTML = "";
					}

					Effect.BlindUp('com_form');

					var html = '<div class="comment">';
					html += '<h4>';
					html += '<span>' + ($$('#comments div.comment').length + 1).toString() + '.</span> ';
					html += (($F('url') == "") ? $F('name') : '<a href="'+$F('url')+'">'+$F('name')+'</a>')+'</h4>';
					html += '<p class="commentDate">' + result.time + '</p>';
					html += '<p>' + $F('comment')+'</p></div>';
					Element.insert($('comments'),{'bottom': html });

					$('com_form').reset();
				}
			}
		}
	);
	
	return false;
				
}



function jumpTo(date)
{
	new Ajax.Request(baseURL + 'blog/calendar/'+date,
	{
			method: 'post',
			postBody: '1=1',
			onComplete: function(tl) {
				$('calendar').innerHTML = tl.responseText;
			}
		}
	);
	
	return false;
				
}

