﻿$(function(){
	$("#archives ul:not(:first)").hide();
	$("#archives strong").click(function(){
		$(this).next("ul").toggle();
	})
})
var replies = {};
function reply_comment(obj){
	var id=$(obj).parents("li").attr("id");
	if(id in replies && $("#comment").val().indexOf(id)>=0){
		alert("请勿重复添加评论回复"+id+"！");
	}
	else{
		$("#comment").val($("#comment").val()+writeN()+'@<a href="#'+id+'">'+$(obj).parents("li").find("cite").eq(0).text()+'</a>: ');
		replies[id] = id;
	}
	$("#comment").focus();
	return false;
}
function writeN(){
	if($("#comment").val().length) return '\n';
	else return '';
}
function ctlent(event){
        if((event.ctrlKey && event.keyCode == 13) || (event.altKey && event.keyCode == 83)) $("#submit").click().attr("disable",false);
}
