//Pop-it menu- By Dynamic Drive - Modified by Wbird //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com //This credit MUST stay intact for use var menuOffX=0 //菜单距连接文字最左端距离 var menuOffY=18 //菜单距连接文字顶端距离 var vBobjects = new Array(); var fo_shadows=new Array(); var linkset=new Array(); var boardid=0; ////No need to edit beyond here var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1 var ns6=document.getElementById&&!document.all var ns4=document.layers var xslDoc; function ReWidth(){ if(window.name!=''){ document.body.style.width='98%'; } } function GetBoardXml(sXMLSrc,path) { xslDoc = CreateXmlDocument(); if (!xslDoc){ throw new Error('Not support!\nplease install a XML parser');return; } xslDoc.async = false; if (navigator.userAgent.indexOf("MSIE")==-1){ if (path){ xslDoc.load(path+"index.aspx@action=xml"); }else{ xslDoc.load("index.aspx@action=xml"); } }else{ xslDoc.loadXML(sXMLSrc); } function CreateXmlDocument() { if (document.implementation && document.implementation.createDocument) { var doc = document.implementation.createDocument("", "", null); if (doc.readyState == null) { doc.readyState = 1; doc.addEventListener("load", function () { doc.readyState = 4; if (typeof doc.onreadystatechange == "function") doc.onreadystatechange(); }, false); } return doc; } else if (window.ActiveXObject) { var prefix = ["MSXML3","MSXML2","MSXML","Microsoft"]; for (var i=0;i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i'+which+'') menuobj.document.close() } menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height eventX=ie4? event.clientX : ns6? e.clientX : e.x eventY=ie4? event.clientY : ns6? e.clientY : e.y var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY var getlength if (rightedge0; i--) { var rect = document.createElement('div'); var rs = rect.style rs.position = 'absolute'; rs.left = (el.style.posLeft + i) + 'px'; rs.top = (el.style.posTop + i) + 'px'; rs.width = el.offsetWidth + 'px'; rs.height = el.offsetHeight + 'px'; rs.zIndex = el.style.zIndex - i; rs.backgroundColor = color; var opacity = 1 - i / (i + 1); rs.filter = 'alpha(opacity=' + (100 * opacity) + ')'; //el.insertAdjacentElement('afterEnd', rect); fo_shadows[fo_shadows.length] = rect; } } function ie_clearshadow() { for(var i=0;i/g, ">") ; text = text.replace(/'/g, "’") ; return text ; } function ReHTML(text) { text = text.replace(/&/g, "&") ; text = text.replace(/"/g, '"') ; text = text.replace(/</g, "<") ; text = text.replace(/>/g, ">") ; text = text.replace(/’/g, "'") ; return text ; } function LoadHTML(o){ //var sData = document.createElement("div"); //sData.innerHTML=ReHTML(o.innerHTML); //alert(sData.getAttribute("language")) o.innerHTML=ReHTML(o.innerHTML); } function bbimg(o){ var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%'; return false; } function imgzoom(img,maxsize){ var a=new Image(); a.src=img.src if(a.width > maxsize * 4) { img.style.width=maxsize; } else if(a.width >= maxsize) { img.style.width=Math.round(a.width * Math.floor(4 * maxsize / a.width) / 4); } return false; } function Dvbbs_ViewCode(replyid) { var bodyTag=""; bodyTag+=document.getElementById('scode'+replyid).CodeText.value bodyTag+="" preWin=window.open('preview','','left=0,top=0,width=550,height=400,resizable=1,scrollbars=1, status=1, toolbar=1, menubar=0'); preWin.document.open(); preWin.document.write(bodyTag); preWin.document.close(); preWin.document.title="查看贴子内容"; preWin.document.charset="UTF-8"; } function getskins(skinid,boardid){ var styleurl = "cookies.aspx@action=stylemod&skinid="+skinid+"&boardid="+boardid; var Sframe = fetch_object('stylecss'); if (Sframe) { stylecss.location.href = styleurl; } } function BoardData(userName,userConfig){ var config = new InnerConfig(); if (userConfig) { for (var thisName in userConfig) { if (userConfig[thisName]) { config[thisName] = userConfig[thisName]; } } } var InnerValue; if (userName){ for (var thisName in userName) { if (userName[thisName]){ InnerValue = userName[thisName]+"_Value"; if (config[userName[thisName]]){ InnerData(config[userName[thisName]],config[InnerValue]) } } } } } function InnerData(name,value) { for (var objid in name) { var obj = document.getElementById(name[objid]); if (obj){ obj.innerHTML = value[objid]; } } } //论坛跳转下拉菜单部分,by Lao_Mi function BoardJumpList(boardid,act){ if (!xslDoc){GetBoardXml(boardxml); } if (xslDoc.parseError){ if (xslDoc.parseError.errorCode!=0){ return "
"+xslDoc.parseError.reason +"
"; } } var MenuStr=""; var LoadBoard,depth; if(boardid!=0) { var nodelist1=xslDoc.documentElement.getElementsByTagName("board"); for(var i=0;i"; //alert(nodelist.length) if (nodelist!=null){ for(var i=0;i0) { outtext+=" |" } outtext+="  " } outtext+="├" } MenuStr+=""+ outtext + boardtype +"
"; } MenuStr+="" return MenuStr; }else{ return "
错误
"; } } //selected下拉列表选取表单() function BoardJumpListSelect(boardid,selectname,fristoption,fristvalue,checknopost){ if (!xslDoc){GetBoardXml(boardxml); } var sel = 0; var sObj = document.getElementById(selectname); if (sObj) { sObj.options[0] = new Option(fristoption, fristvalue); if (xslDoc.parseError){ if (xslDoc.parseError.errorCode!=0){ return; } } var nodes = xslDoc.documentElement.getElementsByTagName("board") if (nodes) { for (var i = 0,k = 1;i0){outtext+=" |"} outtext+=" " } outtext+="├" } t = outtext + t t = t.replace(/<[^>]*>/g, "") t = t.replace(/&[^&]*;/g, "") if(checknopost==1 && nodes[i].getAttribute("nopost")=='1') { t+="(不许转移)" } sObj.options[k++] = new Option(t, v); } sObj.options[sel].selected = true; } } } //SELECT表单选取 Obj 表单名,VAL所选的值 function ChkSelected(Obj,Val) { if (Obj) { for (i=0;i 500 ){ o.style.width='500px'; } if(o.height > 800){ o.style.height='800px'; } }else{ var parentNode=o.parentNode.parentNode if (parentNode){ if (o.offsetWidth>=parentNode.offsetWidth) o.style.width='98%'; }else{ var parentNode=o.parentNode if (parentNode){ if (o.offsetWidth>=parentNode.offsetWidth) o.style.width='98%'; } } } } //自动调用户图像,mode = 1为按比例调整 ,2 按大小调整 function repairface(o,mode) {alert(''); if (mode == 2 || o.onmousewheel) { if(o.width > 128 ) { o.style.width='128'; } if(o.height > 128){ o.style.height='128px'; } } else { var parentNode=o.parentNode.parentNode if (parentNode) { if (o.offsetWidth>=parentNode.offsetWidth) o.style.width='98%'; } else { var parentNode=o.parentNode if (parentNode) { if (o.offsetWidth>=parentNode.offsetWidth) o.style.width='98%'; } } } } function bbimg(o){ var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%'; return false; } /* by netty 2007-10-25 window.onload= new function() { setTimeout('activeOnline()',2000); } var xmlhttp; try{ xmlhttp= new ActiveXObject('Msxml2.XMLHTTP'); }catch(e){ try{ xmlhttp= new ActiveXObject('Microsoft.XMLHTTP'); }catch(e){ try{ xmlhttp= new XMLHttpRequest(); }catch(e){} } } xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4){ if(xmlhttp.status==200){ setTimeout('activeOnline()',300000); updateonline(xmlhttp.responseText); }else{ setTimeout('activeOnline()',20000); } } } */ //Colour pallete top offset function getOffsetTop(elm) { var mOffsetTop = elm.offsetTop; var mOffsetParent = elm.offsetParent; while(mOffsetParent){ mOffsetTop += mOffsetParent.offsetTop; mOffsetParent = mOffsetParent.offsetParent; } return mOffsetTop; } //Colour pallete left offset function getOffsetLeft(elm) { var mOffsetLeft = elm.offsetLeft; var mOffsetParent = elm.offsetParent; while(mOffsetParent) { mOffsetLeft += mOffsetParent.offsetLeft; mOffsetParent = mOffsetParent.offsetParent; } return mOffsetLeft; } function postUrl(poststyle,act,bid,stype){ var thisUrl ="post.aspx@poststyle="+poststyle+"&action="+act+"&boardid="+bid+"&stype="+stype; return thisUrl; } function close_postform(){ var obj=document.getElementById("post_div"); if (obj.style.display!="none"){ obj.style.display="none"; document.getElementById("post_iframe").src=""; } } function post_topic(buttonElement,pstyle,act,bid,stype){ var obj=document.getElementById("post_div"); var buttonElement = document.getElementById("postbutton"); if (pstyle!="1"){ return this.location = postUrl(pstyle,act,bid,stype); } if (obj.style.display=="none") { //obj.style.top = (getOffsetTop(buttonElement)+buttonElement.offsetHeight)+"px"; //obj.style.left = (getOffsetLeft(buttonElement)+buttonElement.offsetWidth)+"px"; //obj.style.left = "20px"; obj.style.display="block"; document.getElementById("post_iframe").style.height="760px"; document.getElementById("post_iframe").src=postUrl(pstyle,act,bid,stype); }else { obj.style.display="none"; document.getElementById("post_iframe").src=""; } }; function activeOnline() { xmlhttp.open("get","activeonline.aspx@state="+escape(document.title.toString())+"&boardid="+boardid); xmlhttp.send(null); } function updateonline(XMLstr) { eval(XMLstr); var AllOnlie=document.getElementById("allonline"); if(AllOnlie) AllOnlie.innerHTML=allonline.toString(); var UserOnlie=document.getElementById("useronline"); if(UserOnlie) UserOnlie.innerHTML=useronline.toString(); var GuestOnlie=document.getElementById("guestonline"); if(GuestOnlie) GuestOnlie.innerHTML=guestonline.toString(); if(boardid!=0) { var Board_UserOnline=document.getElementById("boarduser"); if(Board_UserOnline) Board_UserOnline.innerHTML=boarduser.toString(); var Board_GuestOnline=document.getElementById("boardguest"); if(Board_GuestOnline) Board_GuestOnline.innerHTML=boardguest.toString(); } } /** * New BoardJumpList by lfow */ function New_BoardJumpList(destBoardId, boardList) { if (destBoardId < 0 || !boardList) { return ''; } var dest_list = {}; if (0 == destBoardId) { dest_list = boardList; } else { for (var boardid in boardList) { if (!boardList[boardid]) { continue; } if (destBoardId == boardList[boardid].ParentId) { dest_list['' + boardid] = boardList[boardid]; } } } if (!dest_list) { return ''; } var retvl = ''; for (var boardid in dest_list) { if (0 == boardid || !dest_list[boardid]) { continue; } if (0 == dest_list[boardid].Depth) { retvl += '╋' + dest_list[boardid].BoardType + '
'; } else { var repeat_str = RepeatString(' ', 2); retvl += repeat_str + '├' + dest_list[boardid].BoardType + '' + repeat_str + '
'; } } if ('' !== retvl) { retvl = ''; } return retvl; } /** * by lfow */ function RepeatString(str, repeatCount) { if (typeof(str) != 'string') { return ''; } if (typeof(repeatCount) != 'number' || repeatCount <= 0) { return ''; } var retvl = str; for (var i = 0; i < repeatCount; i++) { retvl += retvl; } return retvl; } /* 主页底部在线名单的显隐控制过程 by xu */ function disiframe() { if(document.getElementById('online3u').style.display=='') { document.getElementById('checkdis').innerText='显示详细列表' document.getElementById('online3u').style.display='none'; var id = document.getElementById('hiddenframe'); if (id && !id.src) { id.src = 'onlineuserlist.aspx'; } } else { document.getElementById('checkdis').innerText='关闭详细列表' document.getElementById('online3u').style.display=''; } } //浮动窗口效果 var ShadeDiv = { objid : null, Shade : document.createElement('div'), ShadeID : 'Shade', width : 400, height : 300, Position : function(){ if (!ShadeDiv.objid){ ShadeDiv.objid = null; return; } var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var ch = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; if (self.pageYOffset) { var st = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict var st = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers var st = document.body.scrollTop; } if (window.innerHeight && window.scrollMaxY) { var sh = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac var sh = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari var sh = document.body.offsetHeight; } ShadeDiv.Shade.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=60,finishOpacity=100,style=0)'; ShadeDiv.Shade.style.height = (sh > ch ? sh : ch) + 'px'; ShadeDiv.Shade.style.width = w + 'px'; var pos = [], pw; pw = ShadeDiv.width; pos[0] = (w-pw)/2; pos[1] = (ch-(ShadeDiv.height || 300))/2 -100+st; //window.status="ch:"+ch+"st:"+st+"post[1]:"+pos[1]+"ShadeDiv.clientHeight"+ShadeDiv.objid.clientHeight; if (navigator.product && navigator.product == 'Gecko'){ pw -= 40; } ShadeDiv.objid.style.width = ShadeDiv.width + 'px'; ShadeDiv.objid.style.height = ShadeDiv.height + 'px'; ShadeDiv.objid.style.left = pos[0] + 'px'; ShadeDiv.objid.style.top = pos[1] + 'px'; ShadeDiv.Shade.style.display = 'block'; ShadeDiv.objid.style.display = 'block'; }, Show : function(id,w,h){ ShadeDiv.height = parseInt(h); ShadeDiv.width = parseInt(w); ShadeDiv.Shade.id = ShadeDiv.ShadeID; ShadeDiv.objid = document.getElementById(id); document.body.insertBefore(ShadeDiv.Shade,null); ShadeDiv.Position(); }, Close : function(){ if (ShadeDiv.objid==null){ return; } ShadeDiv.Confirmed(); }, Confirmed : function() { ShadeDiv.objid.style.display = 'none'; ShadeDiv.Shade.style.display = 'none'; document.body.removeChild(ShadeDiv.Shade); } } function fixImagesWidth(_id,_maxwidth) { var elem=document.getElementById(_id); var images=elem.getElementsByTagName("img"); for(var i=0;i _maxwidth) { images[i].style.width=_maxwidth+"px"; } } } // 无刷新换肤用到 function SetActiveStyle(_index,title) { var i, a, head = document.getElementsByTagName("head")[0], s=document.createElement("link"); s.rel="stylesheet"; s.type="text/css"; s.title=title; s.href="templates/default/skins/"+_index+"/style.css"; //csslist[_index][1]; s.disabled = true; /*for(i=0; i