    checkSigninStatus();

    function sp_is_owner(){
        return ( host_id == g_guest_uid );
    }
	function drawControlPanel(id,type){

		if( sp_is_owner() ){

				document.write('<a class="del"  href="#" onclick="confirmDel('+ id +',\''+ type + '\');return false;" title="删除">删除</a>');
		}

	}
	function confirmDel(id,type){

		switch(type){

			case "notice":

				msg = "你确定要删除这条即时贴吗？";
				url = "notice.php?action=noticeDel&id="+ id;
			break;

			case "comment":

				msg = "你确定要删除这条评论吗？";
				url = 'notice.php?action=commentDel&id='+ id +'&archiveID='+notice_id;
			break;

			default:
				return;

		}
		if(confirm(msg)){

			location.href = url;
		}
	}
	function checkComment(obj){
		if(g_is_signin != true){
			alert("请登录后发表.");
			return false;
		}
		var comment = obj.message.value.replace(/(^ +)|( +$)/g,'');

		if(comment.length == 0)
		{
			alert("随便说点什么吧！");
			obj.message.focus();
			return (false);
		}
		if( comment.length > 70 ){

			alert("最多允许70个字符");
			obj.message.value = obj.message.value.substring(0,70);
			return (false);

		}
                /**
		var captcha = obj.captcha.value.replace(/(^ +)|( +$)/g,'');

		if(captcha.length == 0)
		{
			alert("请填写正确的验证码！");
			obj.captcha.focus();
			return (false);
		}
		var re = /^[0-9]{4}$/;

		if( !re.test(captcha) ){

			alert("验证码必须是数字");
			obj.captcha.focus();
			return (false);

		}
                */
		obj.btn_ok.disabled = true;
		obj.btn_ok.value = "正在发表";
		return true;
	}
	function checkComment1(obj){
		if(g_is_signin != true){
			alert("请登录后发表.");
			return false;
		}
		var comment = obj.message.value.replace(/(^ +)|( +$)/g,'');

		if(comment.length == 0)
		{
			alert("随便说点什么吧！");
			obj.message.focus();
			return (false);
		}
		if( comment.length > 70 ){

			alert("最多允许70个字符");
			obj.message.value = obj.message.value.substring(0,70);
			return (false);

		}

		obj.btn_ok.disabled = true;
		obj.btn_ok.value = "正在发表";
		return true;
	}
	function gp_write_comment_option(){
		if(g_is_signin == true){

		} else {
			document.write(' 您尚未登录, 请 <a href="http://passport.360quan.com/passport.php?action=signin">登录</a> | <a href="http://passport.360quan.com/passport.php?action=signup">注册</a>');
		}
	}
	function insertFace(obj,code){
		obj.value = obj.value + code;
	}
