function addoks(){
	var form = document.quitform;
	alert("因为你的资料还没有整理完成,所以你现在不能发表留言！！！\n\n请进入管理中心,开始完善你的资料");
return false;
}

function inull(){
	var form = document.quitform;
	alert("你还没有登录，暂时不可以回复");
return false;
}

function inullsss(){
	var form = document.quitform;
	alert("你还没有登录，暂时不可以添加新的话题");
return false;
}

function addnewsss(){
			var form = document.quitform;
			
			if (form.re_leixin.value.replace(/ /g,"") == ""){
				alert("你的话题类型是什么？？？？");
				form.re_leixin.focus();
				return false;
				}
			if (form.re_leibei.value.replace(/ /g,"") == ""){
				alert("你的话题类别不能为空");
				form.re_leibei.focus();
				return false;
				}	
				
			if (form.re_title.value.replace(/ /g,"") == ""){
				alert("你的话题标题是什么？？？");
				form.re_title.focus();
				return false;
				}
			if (form.re_title.value.replace(/ /g,"").length > 30){
				alert("你的话题标题太长了，最长不可以超过30个字符");
				form.re_title.focus();
				return false;
				}
			if (form.re_title.value.replace(/ /g,"").length < 6){
				alert("你的话题标题太短了吧，最短不能少于6个字符");
				form.re_title.focus();
				return false;
				}
				
			if (form.re_game.value.replace(/ /g,"") == ""){
				alert("话题内容不能为空");
				form.re_game.focus();
				return false;
				}
			if (form.re_game.value.replace(/ /g,"").length > 1000){
				alert("话题内容太长了，最长不可以超过1000个字符");
				form.re_game.focus();
				return false;
				}
			if (form.re_game.value.replace(/ /g,"").length < 10){
				alert("话题内容太短了吧，这个是发表话题吗？？？？？？？");
				form.re_game.focus();
				return false;
				}
			
			if (form.re_code.value.replace(/ /g,"") == ""){
				alert("验证码不能为空");
				form.re_code.focus()
				return false;
				}
			if (form.re_code.value.replace(/ /g,"").length != 4){
				alert("验证码不正确，验证码是 4 位数");
				form.re_code.focus();
				return false;
				}
			
		return true;
		}

function addnew(){
	var form = document.quitform;

	if (form.re_game.value.replace(/ /g,"") == ""){
		alert("话题内容不能为空");
		form.re_game.focus();
		return false;
		}
	if (form.re_game.value.replace(/ /g,"").length > 1000){
		alert("话题内容太长了，最长不可以超过1000个字符");
		form.re_game.focus();
		return false;
		}
	if (form.re_game.value.replace(/ /g,"").length < 10){
		alert("话题内容太短了吧，这个是发表话题吗？？？？？？？");
		form.re_game.focus();
		return false;
		}
	
	if (form.re_code.value.replace(/ /g,"") == ""){
		alert("验证码不能为空");
		form.re_code.focus()
		return false;
		}
	if (form.re_code.value.replace(/ /g,"").length != 4){
		alert("验证码不正确，验证码是 4 位数");
		form.re_code.focus();
		return false;
		}
	
return true;
}

function grin(tagname,tag) {
        var myField;
        if (document.getElementById(tagname) && document.getElementById(tagname).type == 'textarea') {
                myField = document.getElementById(tagname);
        }
        else {
                return false;
        }
        if (document.selection) {
                myField.focus();
                sel = document.selection.createRange();
                sel.text = tag;
                myField.focus();
        }
        else if (myField.selectionStart || myField.selectionStart == '0') {
                var startPos = myField.selectionStart;
                var endPos = myField.selectionEnd;
                var cursorPos = endPos;
                myField.value = myField.value.substring(0, startPos)
                                          + tag
                                          + myField.value.substring(endPos, myField.value.length);
                cursorPos += tag.length;
                myField.focus();
                myField.selectionStart = cursorPos;
                myField.selectionEnd = cursorPos;
        }
        else {
                myField.value += tag;
                myField.focus();
        }
}
