// JavaScript Document

//ask delete article
function isDel(id) {
	if (confirm("确定要删除该帖？")) {
		location.href="/blog_del.do?id="+id;
	}
}

//ask delete category
function isDelCate(c_id) {
	if (confirm("确定要删除此分类？")) {
		location.href="/blog_cateDel.do?cid="+c_id;
	}
}

//ask delete manager
function isDelAdmin(a_id) {
	if (confirm("确定要删除此管理员？")) {
		location.href="/memo/admin/adminDel.e?a_id="+a_id;
	}
}

//ask delete manager
function isDelLink(l_id) {
	if (confirm("确定要删除此链接？")) {
		location.href="/memo/admin/linkDel.e?l_id="+l_id;
	}
}

//chk add article form
function chkAdd() {
	if (blog_addForm.title.value==null || blog_addForm.title.value=="") {
		alert("请输入标题");
		return false;
	}
	if (blog_addForm.title.value.length > 50) {
		alert('输入的标题长度超过50');
		return false;
	}
	//else if (blog_addForm.categoryId.value==null || blog_addForm.categoryId.value=="") {
	//	alert("请选择分类");
	//	return false;
	//}else
	 return true;
}

//chk reply form
function chkReply() {
	if (document.blog_commForm.content.value==null || document.blog_commForm.content.value=="") {
		alert("请输入评论内容！");
		return false;
	}else return true;
}

//only number from keyboard
function onlyNum()
{
 if(!(event.keyCode==46)&&!(event.keyCode==8)&&!(event.keyCode==37)&&!(event.keyCode==39))
  if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
    event.returnValue=false;
}

function refWindow(name,entryId,ownerId) {
	var iHeight=150;
	var iWidth=400;
	var  iTop=(window.screen.height-iHeight)/2;
	var  iLeft=(window.screen.width-iWidth)/2;
　　window.open ("/include/blog/refWindow.jsp?name="+name+"&entryId="+entryId, "newwindow", "height="+iHeight+", width="+iWidth+", top="+iTop+", left="+iLeft+", toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no");
}


