var is = false;
$(function() {
	$("#te").on('click',function(){
		$("#title").focus();
	})
		$("#st").on('click',function(){
		$("#content").focus();
	})
		$("#de").on('click',function(){
		$("#createTime").focus();
	})
		$("#ul").on('click',function(){
		$("#url").focus();
	})
	$("#compere_btn_save").on('click', function() {
		validate();
		if (is) {
			document.form1.action = "/auth/announcement/saveAnnouncementInfo";
			document.form1.submit();
		}
	});
	$("#compere_btn_edit")
			.on(
					'click',
					function() {
						validate();
						if (is) {
							document.form1.action = "/auth/announcement/editAnnouncementInfo?id="
									+ id;
							document.form1.submit();
						}
					});
});
function validate() {
	if ($("#title").val() == "") {
		alert('标题不能为空！');
		return;
	} else if ($("#content").val() == "") {
		alert('内容不能为空！');
		return;
	} else
		is = true;
}