if (window.Event){ // 修正Event的DOM Event.prototype.__defineSetter__( " returnValue " , function (b){ // if ( ! b) this .preventDefault(); return b; }); } if (window.Node){ Node.prototype.replaceNode = function (Node){ // 替换指定节点 this .parentNode.replaceChild(Node, this ); } Node.prototype.removeNode = function (removeChildren){ // 删除指定节点 if (removeChildren) return this .parentNode.removeChild( this ); else { var range = document.createRange(); range.selectNodeContents( this ); return this .parentNode.replaceChild(range.extractContents(), this ); } } } var getNameList = function(strName){return document.getElementsByName(strName);} function checkvotetype(opobj,opmax) { var s = opobj.options[opobj.selectedIndex]; var str="您确定您的投票类型是:"+s.text+"吗?确定以后将不可更改!点击取消重新选择。"; var stext=s.text; var svalue=s.value; if(confirm(str)) { document.getElementById("votetype").value=svalue; opobj.disabled="disabled";  votetypeset(opobj,opmax,stext,svalue); } else return; } function ResetVoteType() { if(confirm("重新设置将清空当前表单!确认重置吗?")) { var str="
    "; document.getElementById("voteset_add").innerHTML=""; document.getElementById("voteset_function").innerHTML=str; document.getElementById("votetype_select").disabled=""; if (window.clipboardData) { window.clipboardData.setData("Text", "
      "); } return; } else { return ; } } //投票设置事件 //opmax 限制数 var voten = 0; function votetypeset(opobj,opmax,stext,svalue){ //vote_set //hidden Textea ID:vote //var s = opobj.options[opobj.selectedIndex]; var div_voteset = document.getElementById("voteset_div"); if (!div_voteset){return ;} document.getElementById("voteset_legend").innerHTML =stext; //voteset_function var voteset_add = document.getElementById("voteset_add"); //添加投票项表单 voteset_add.innerHTML = voteset_input(svalue,opmax); voteset_todata("vote","set_vote",svalue); } function voteset_input(s,opmax){ var _inputHmtl = ''; _inputHmtl +=' '; //_inputHmtl +='
        '; return ("添加项目:" + _inputHmtl); } function voteadd_input(s,objid,opmax) { var titleobj = document.getElementById(objid); var voteset_function = document.getElementById("votetitles"); if (!titleobj){return ;} if(titleobj.value=='请输入该项标题'){alert("请填写相应的内容!");return;} if (titleobj.value==''){alert("请填写相应的内容 !");return ;} if (document.getElementsByName("set_vote")){ if (document.getElementsByName("set_vote").length>=parseInt(opmax)){ alert("投票数目超出限制!"); return ; } } voten = voten + 1; var child_Html = ""; child_Html = '
      1. '; child_Html += '投票项目: '; //问卷调查增加填写表单 if (s=='2') { child_Html += '
        子项数:'; child_Html += ' 类型:'; child_Html += ' '; child_Html += '
          ' } else //非问卷调查表单 { child_Html += '
          子项数:'; child_Html += ' '; child_Html += '
            '; } child_Html += '
          1. '; voteset_function.innerHTML += child_Html; voteset_todata("vote","set_vote",s); } function votechild_input(objid,s) { var child_ol = document.getElementById("vchild_ol_"+objid); var child_Html = ""; var AddChilds = document.getElementById("vote_childs_"+objid); //var ChildsType = document.getElementById("vote_childtype_"+objid); if (isNaN(AddChilds.value)) { AddChilds.value = 4; } //if (ChildsType.options[ChildsType.selectedIndex].value=='2'){AddChilds.value=1;} AddChilds.value = parseInt(AddChilds.value); var AddLength = parseInt(AddChilds.value); if (child_ol) { if(s=='2') //问卷调查时 { var ChildsType = document.getElementById("vote_childtype_"+objid); if (ChildsType.options[ChildsType.selectedIndex].value=='2'){AddChilds.value=1;} //文本时没有选项 AddChilds.value = parseInt(AddChilds.value); var AddLength = parseInt(AddChilds.value); for(var i=1; i<=AddLength; i++) { child_Html +='
          2. '; if (ChildsType.options[ChildsType.selectedIndex].value=='2') { child_Html +='答案:'; child_Html +=''; } else { switch (ChildsType.options[ChildsType.selectedIndex].value) { case '0': child_Html +=''; break; case '1': child_Html +=''; break; } child_Html +=' 得分:'; } child_Html +='
          3. '; } } else if(s=='0') //单选投票时 { for(var i=1;i<=AddLength;i++) { child_Html +='
          4. '; child_Html +=''; child_Html +='' child_Html+=' ' child_Html+='
          5. '; } } else //多选 投票时 { for(var i=1;i<=AddLength;i++) { child_Html+='
          6. '; child_Html+=''; child_Html +=' '; child_Html+=''; child_Html+='
          7. '; } } child_ol.innerHTML=child_Html; } voteset_todata("vote","set_vote",s); } function voteset_todata(objid,valobjid,s) { var votedb_Obj = document.getElementById(objid); //隐藏表单vote,用来存储表单项 var voteval_Obj = getNameList(valobjid); //获取每项项目的标题?,即获取多个set_vote投票项目 var voten = getNameList("voten"); votedb_Obj.value = ""; //每次都清空重新填写? for(var i=0; i'); votedb_Obj.value += "$$"; } else if(ChildsValue[j].value==''|| ChildsValue[j].value=='请录入该项内容,否则将由默认值替代') { votedb_Obj.value += "发帖主人没有设置这一项!"; votedb_Obj.value += "$$"; } } votedb_Obj.value += "@@"; if (ChildsEP.length>0) { for(var j=0; j'); votedb_Obj.value += "$$"; } else if(ChildsValue[j].value==''|| ChildsValue[j].value=='请录入该项内容,否则将由默认值替代') { votedb_Obj.value += "发帖主人没有设置这一项!"; votedb_Obj.value += "$$"; } } votedb_Obj.value += "@@"; if (ChildsEP.length>0) { for(var j=0; j