//切换论坛和主站的头部样式 function gettoppic() { var id = document.getelementbyid("showwrap_in"); var url = location.href.substring(location.href.lastindexof('/')); if (url.tostring() == "/bbs.aspx") { //id.classname = "wrap-inbbs"; id.classname = "wrap-in"; } else { id.classname = "wrap-in"; } } //用户信息 function userdiv(type) { var divid = document.getelementbyid("userdiv"); var liid = document.getelementbyid("userli"); if (type.tostring() == "0") { divid.classname = "drop-box"; liid.classname = "drop"; } else { divid.classname = "drop-box hidden"; liid.classname = ""; } } //引用到评论 function usepic(picname) { // var texts = "#http://" + window.location.host + "/uploads/images/thumb/large/" + picname + "#\r\n"; // var textid = document.getelementbyid("textpl"); // textid.innertext = texts.tostring(); // textid.focus(); var tx = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_hifsave"); tx.value = picname; document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_btnpl").click(); } //关闭遮罩层 function getclose() { document.getelementbyid("closediv").style.display= "none"; document.getelementbyid("showpic").style.display = "none"; } //打开遮罩层 function getopen() { document.getelementbyid("closediv").style.display = ""; document.getelementbyid("showpic").style.display = ""; } //替换url function geturl(url, memo) { //图片 document.getelementbyid("replacementpic").src = "../uploads/images/" + url; document.getelementbyid("hidden1").value = url; //备注 document.getelementbyid("showside").innerhtml = memo; } //翻页替换url function getpn(type) { var str = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_hifuripic").value; var strmemo = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_hifmemo").value; var urls = document.getelementbyid("hidden1").value; var picurl = document.getelementbyid("replacementpic").src; var picmemo = document.getelementbyid("showside").value; var i = picurl.lastindexof("/"); var selectvalues = picurl.substring((i + 1), picurl.length); var imgitem = str.split(","); //图片地址 var imgmemo = strmemo.split("|");//备注信息 var lasti = imgitem[imgitem.length - 2]; for (var i = 0; i < imgitem.length; i++) { if (imgitem[i] == urls) { if (type == "prev") { if (selectvalues != imgitem[0]) { picurl = imgitem[i - 1]; picmemo = imgmemo[i - 1]; } else { picurl = imgitem[0]; picmemo = imgmemo[0]; } } else if (type == "next") { if (selectvalues != lasti) { picurl = imgitem[i + 1]; picmemo = imgmemo[i + 1]; } else { picurl = lasti; picmemo = imgmemo[imgmemo.length - 2]; } } } } geturl(picurl, picmemo); } //分页方法 function getprevnext(count) { var pages = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_hdfcurrentpageindex"); pages.value = count; document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_button1").click(); } //选项卡切换 function tabmenu(i) { document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_hiftabmenu").value = i; document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_button2").click(); } //qq表情浮层控制 function qqfaceopen() { document.getelementbyid("qqfacediv").classname = "win-pop win-pop-s1"; document.getelementbyid("qqfacediv").style.left = (document.getelementbyid("face").offsetleft - 30) + "px"; document.getelementbyid("qqfacediv").style.top = (document.getelementbyid("faceidiv").offsettop + 195) + "px"; } //qq表情获取 function getface(title) { var texttitle = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_textpl"); texttitle.value = texttitle.value + "{" + title + "}"; qqfaceclose(); } //关闭qq表情层 function qqfaceclose() { document.getelementbyid("qqfacediv").classname = "win-pop win-pop-s1 hidden"; } //分享到新浪微博 function posttosina(title) { var _t = ''; //转播内容 var _url = location.href; /**本网站地址*/ var _type = '6'; var _count = ''; /**是否显示分享数,1显示(可选)*/ var _appkey = ''; /**您申请的应用appkey,显示分享来源(可选)*/ var _title = _t; /**分享的文字内容(可选,默认为所在页面的title)*/ var _pic = 'http://'+location.host + title; /**分享图片的路径(可选)*/ var _ralateuid = ''; /**关联用户的uid,分享微博会@该用户(可选)*/ var _language = 'zh_cn'; /**设置语言,zh_cn|zh_tw(可选)*/ var _rnd = new date().valueof(); var _u = 'http://service.weibo.com/share/share.php?url=' + _url + '&appkey=' + _appkey + '&title=' + _title + '&pic=' + _pic + '&ralateuid=' + _ralateuid; window.open(_u, '', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no'); } //div锁定 function locking(i, errs, show,tops) { var value = ""; switch (i) { case 1: value = "icon icon-warn"; //警告提示 break; case 2: value = "icon icon-error"; //错误提示 break; case 3: value = "icon icon-succe"; //成功提示 break; case 4: value = "icon icon-normal"; //询问提示 break; } document.write("
"); document.getelementbyid("showerrdiv").innerhtml = loadshow(value, errs); //0不显示遮罩层,1显示 if (show == 0) { document.getelementbyid("ly").style.display = "none"; } else { document.getelementbyid("ly").style.display = "block"; } document.getelementbyid("ly").style.width = document.body.clientwidth; document.getelementbyid("ly").style.height = document.body.clientheight; document.getelementbyid("layer2").style.display = 'block'; if (tops.tostring()!="0") { document.getelementbyid("layer2").style.top = tops + 200; } //pagescroll(); } //跳转回顶部 // function pagescroll() { // var d = document.documentelement; // this.timer = setinterval(function () { // d.scrolltop -= math.ceil(d.scrolltop * 0.1); // }, 10); //// window.scrollby(0, -100); //// if (document.documentelement.scrolltop == 0) { //// cleartimeout(scrolldelay); //// } //// else { //// scrolldelay = settimeout('pagescroll()', 1); //// } // } //跳转到指定位置 function pagescroll() { var tops = (document.getelementbyid("faceidiv").offsettop); window.scrollto(0, tops); } function lock_checkform(theform) { document.getelementbyid("ly").style.display = 'none'; document.getelementbyid("layer2").style.display = 'none'; //clearinterval(timer); return false; } function lock_checkforms() { document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_errdiv").style.display = 'none'; } function loadshow(classname, message) { var showerr = "

提示信息

"; var showerr2 = "

" + message + "

"; var showerr3 = "
关闭
"; // document.getelementbyid("showerrdiv").innerhtml = showerr + showerr2 + showerr3; return showerr + showerr2 + showerr3; } //显示隐藏div function showdiv(type, id) { if (type.tostring() == "0") { document.getelementbyid(id.tostring()).style.display = 'block'; } else { document.getelementbyid(id.tostring()).style.display = 'none'; } } //密码验证 function getpwdcheck(type) { var pwd1 = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_password1"); var pwd2 = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_password2"); var pwdlab1 = document.getelementbyid("laberrpwd1"); var pwdlab2 = document.getelementbyid("laberrpwd2"); var hif = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_hifpwd"); if (type == 1) { if (pwd1.value != pwd2.value) { pwdlab2.innerhtml = "输出密码不一致"; pwdlab2.classname = "tips-wrong"; hif.value = "false"; } else { pwdlab2.innerhtml = ""; pwdlab2.classname = "tips-ok"; hif.value = "true"; } } else { if (pwd1.value == "") { pwdlab1.innerhtml = "请输入密码"; pwdlab1.classname = "tips-wrong"; } else { pwdlab1.innerhtml = ""; pwdlab1.classname = "tips-ok"; } } } //鼠标滑过效果 function getmousecoloeropen(id) { if (document.getelementbyid(id).classname == "mod") { document.getelementbyid(id).classname = "mod hover"; } else { document.getelementbyid(id).classname = "mod mod-m hover"; } } function getmousecoloerclose(id) { if (document.getelementbyid(id).classname == "mod hover") { document.getelementbyid(id).classname = "mod"; } else { document.getelementbyid(id).classname = "mod mod-m"; } } //清空匿名用户文字 function clearusername() { var name = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_user_name"); if (name.value=="匿名用户") { name.value = ""; } } //智能判断是否输入姓名 function znusername() { var name = document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_user_name"); if (name.value == "") { name.value = "匿名用户"; } } //获取url传递的参数,name--参数名称 function geturlparam(name) { var reg = new regexp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } //验证信息 function validate() { if (document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_verify").value == "" || document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_verify").value.tolower() != document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_serialnumberhiddenfield").value) { document.getelementbyid("ctl00_ctl00_contentplaceholder1_contentplaceholder1_errdiv").style.display = "block"; document.getelementbyid("p1").innerhtml = "验证码错误"; return false; } return true; }