function $i(a) { return $("#" + a).get(0) } var boxys = new Object(); String.prototype.sInclude = function(s) { var a = new RegExp("(^|,)" + s + "(,|$)", "ig"); return a.test(this, s) }; String.prototype.sRemove = function(s) { if (this.sInclude(s)) { var a = RegExp.leftContext; var b = RegExp.rightContext; if (a.length > 0 && b.length > 0) { return a + "," + b } else if (a.length > 0) { return a } else if (b.length > 0) { return b } else { return "" } } else { return this } }; String.prototype.isRelate = function() { var r = /^\w+\:\/\//g; return !r.test(this) }; String.prototype.gbLen = function() { var a = this.length; for (var i = 0; i < this.length; i++) { if (this.charCodeAt(i) > 255) { a++ } } return a }; String.prototype.gbIndexOf = function(a) { var b = this.indexOf(a); return this.substr(0, b).gbLen() + 1 }; String.prototype.gbLeft = function(a, s) { var b = ''; var c = s || ''; var d = 0; var e = false; var f = 0; if (a < 1) { return b } if (this.length * 2 <= a || c.length > this.length) { return this.toString() } for (var i = 0; i < this.length; i++) { var l = (this.charCodeAt(i) > 255) ? 2 : 1; if (d + l > a) { e = true; break } else { d += l; f++ } } if (e && c.length > 0) { d += s.gbLen(); while (d > a) { f--; d -= (this.charCodeAt(f) > 255) ? 2 : 1 } b = this.substr(0, f) + s } else { b = this.substr(0, f) } return b }; String.prototype.trimEnd = function() { var a, n; n = this.length; while (n >= 0) { var c = this.charCodeAt(n - 1); if (c != 32 && c != 12288) { break } else { n-- } } if (n == 0) { return "" } else { return this.substr(0, n) } }; String.prototype.trim = function() { var s = 0, e = this.length - 1; while (s < this.length) { var c = this.charCodeAt(s); if (c != 32 && c != 12288) { break } else { s++ } } while (e > s) { var c = this.charCodeAt(e); if (c != 32 && c != 12288) { break } else { e-- } } if (s > e) { return "" } else { return this.substring(s, e + 1) } }; String.prototype.isSpace = function() { var a = /^(\s| )*$/g; return a.test(this) }; Array.prototype.include = function(v) { for (var i = 0; i < this.length; i++) { if (this[i] == v) { return true } } return false }; Number.prototype.twoDigit = function(n) { return this < 10 ? "0" + this : this.toString() }; Date.prototype.toFriendString = function() { var n = new Date(); var a = new Date(n.getFullYear(), n.getMonth(), n.getDate()); var b = (new Date(a)).setDate(a.getDate() - 1); var c = (new Date(a)).setDate(a.getDate() - 2); var d = this.getHours().twoDigit() + ":" + this.getMinutes().twoDigit(); var e = (this.getMonth() + 1).twoDigit() + "-" + this.getDate().twoDigit() + " " + d; var s; n = Math.floor((n - this) / 1000); if (n < 3600) { s = Math.ceil(n / 60) + "分钟前" } else if (n < 36000) { s = Math.floor(n / 3600) + "小时" + Math.floor(n % 3600 / 60) + "分前" } else if (this > a) { s = "今天 " + d } else if (this > b) { s = "昨天 " + d } else if (this > c) { s = "前天 " + d } else { s = e } return s }; var iwms = new Object(); iwms.urlPrefix = ""; iwms.payEnable = 0; iwms.setTimeDiff = function(a) { iwms.timeDiff = new Date() - new Date(a) }; iwms.getClientDate = function(a) { return new Date(Date.parse(new Date(a)) + iwms.timeDiff) }; iwms.msgPos = function(a, b) { var c = { x: 0, y: 0 }; var d = [b.style.display.toString(), b.style.visibility.toString()]; with(document.documentElement) { var e = clientWidth; var f = scrollLeft; var g = scrollTop } b.style.display = "block"; b.style.visibility = "hidden"; if (a) { var p = iwms.elePos(a); c.x = p.x; c.y = p.y + p.h; if (c.x + b.offsetWidth > e + f) { c.x = e + f - b.offsetWidth; if (c.x < 0) { c.x = 0 } } var h = $(".twidth:eq(0)"); if (h.length == 1) { var i = h.offset(); if (c.x + b.offsetWidth > h.width() + i.left) { c.x = h.width() + i.left - b.offsetWidth } } } else { c.x = Math.floor((e - b.offsetWidth) / 2); c.y = g } b.style.display = d[0]; b.style.visibility = d[1]; return c }; iwms.elePos = function(a) { var p = { 'x': 0, 'y': 0, 'w': 0, 'h': 0 }; p.h = a.offsetHeight; p.w = a.offsetWidth; do { p.x += a.offsetLeft || 0; p.y += a.offsetTop || 0; a = a.offsetParent } while (a); return p }; iwms.popDivs = new Array(); iwms.popMsg = function(a, b, c, d) { var e; iwms.clearPopTimer(a); for (var i = 0; i < iwms.popDivs.length; i++) { if (iwms.popDivs[i].id == "pop_" + a) { e = iwms.popDivs[i] } } if (e == null) { e = document.createElement("DIV"); e.id = "pop_" + a; iwms.popDivs.push(e); e.onmouseout = function() { iwms.hideMsg(a, 800) }; e.onmouseover = function() { iwms.clearPopTimer(a) }; document.body.appendChild(e) } else { e.removeChild(e.childNodes[0]) } e.className = d ? d : (b ? "aj_msg" : "aj_msg aj_msgTop"); if (typeof(c) == "string") { e.innerHTML = c } else { e.appendChild(c) } var f = iwms.msgPos(b, e); with(e.style) { top = f.y + "px"; left = f.x + "px"; display = "block"; zIndex = 100 } if (b) { iwms.dropShadow(a, e); b.onmouseout = function() { iwms.hideMsg(a, 800) } } }; iwms.popTimers = new Array(); iwms.hideMsg = function(a, b) { iwms.clearPopTimer(a); if (b && b > 0) { iwms.popTimers.push([a, window.setTimeout("iwms.hideMsg('" + a + "')", b)]) } else { var c; for (var i = 0; i < iwms.popDivs.length; i++) { if (iwms.popDivs[i].id == "pop_" + a) { c = iwms.popDivs[i]; break } } if (c) { c.style.display = "none"; iwms.clearShadow(a) } } }; iwms.clearPopTimer = function(a) { var n = -1; for (var i = 0; i < iwms.popTimers.length; i++) { if (iwms.popTimers[i][0] == a) { n = i; break } } if (n >= 0) { var b = iwms.popTimers.splice(n, 1)[0][1]; if (b) { window.clearTimeout(b) } } }; iwms.shadows = new Array(); iwms.dropShadow = function(a, b) { if (self != top && $.browser.msie && self.frameElement.tagName == "IFRAME") { return } var c = 1; var d = null; for (var i = 0; i < iwms.shadows.length; i++) { if (iwms.shadows[i][0] == a) { d = iwms.shadows[i][1]; break } } if (d == null) { d = [a, new Array()]; for (var i = 0; i < c; i++) { var o = document.createElement("DIV"); o.className = "shadow"; with(o.style) { position = "absolute"; zIndex = b.style.zIndex - 1; var e = Math.floor(100 * (c - i) / c); if (typeof(opacity) == "string") { opacity = (e / 100).toString() } else { filter = "alpha(opacity=" + e + ")" } } d[1].push(o); document.body.appendChild(o) } iwms.shadows.push(d); d = d[1] } var p = iwms.elePos(b); for (var i = 0; i < d.length; i++) { with(d[i].style) { top = p.y + (i + 1) * 1 + "px"; left = p.x + (i + 1) * 1 + "px"; width = p.w + "px"; height = p.h + "px" } } }; iwms.clearShadow = function(a) { var o, n = -1, arr; for (var i = 0; i < iwms.shadows.length; i++) { if (iwms.shadows[i][0] == a) { n = i; break } } if (n == -1) { return } arr = iwms.shadows.splice(n, 1); arr = arr[0][1]; while (o = arr.pop()) { document.body.removeChild(o) } }; iwms.cookie = function(a, b, d) { if (b == undefined) { var e = a + "="; var c = document.cookie; if (c.length > 0) { offset = c.indexOf(e); if (offset != -1) { offset += e.length; end = c.indexOf(";", offset); if (end == -1) { end = c.length } return decodeURI(c.substring(offset, end)) } } return "" } if (d != undefined && d != null) { var f = new Date(); f.setTime(f.getTime() + (d * 1000 * 3600 * 24)) } document.cookie = a + "=" + encodeURI(b) + "; path=/;" + ((d == undefined || d == null) ? "" : (" expires=" + f.toGMTString())) }; iwms.imgResize = function() { if (iwms.imgCont) { iwms.imgCont.style.overflowX = "hidden"; iwms.imgCont.style.wordBreak = "break-all"; var c = iwms.imgCont.getElementsByTagName("img") } else { return } for (var i = 0; i < c.length; i++) { var o = c[i]; if (o.complete) { iwms.imgLoaded(o) } else { o.onload = function() { iwms.imgLoaded(this) } } if (iwms.imgPage && typeof(pager) == "object" && c.length == 1 && o.width > 200) { o.style.cursor = "pointer"; if (o.resized == "1") { o.setAttribute("title", "ctrl+鼠标左键原大小"); o.onclick = function(a) { var b = a || window.event; b.ctrlKey ? iwms.imgFullsize(this) : pager.Next() } } else { o.onclick = function() { pager.Next() } } } } }; iwms.imgLoaded = function(o) { var a = parseInt(iwms.imgCont.clientWidth) - 50; if (o.width > a) { if (o.style.width) { o.style.width = "" } o.width = a; o.removeAttribute("height"); o.style.cursor = "pointer"; o.style.display = "block"; o.vspace = 5; o.resized = 1; if (typeof(o.onclick) != "function") { o.onclick = function() { iwms.imgFullsize(this) } } } }; iwms.imgFullsize = function(c) { if (c.parentElement) { if (c.parentElement.tagName == "A") { return } } var b = new Boxy("

", { title: "查看图片", fixed: false, modal: true, unloadOnHide: true, afterShow: function() { var a = this.getPosition(); if (a[1] < 0) this.moveTo(a[0], 0) }, behaviours: function(r) { $(r).click(function() { b.hide() }) } }) }; iwms.obj2json = function(o) { var s = "{"; for (var p in o) { if (s.length > 1) s += ","; var v = o[p]; s += p + ":"; if (typeof(v) == 'string') { s += "'" + v.replace(/'/g, "\\'") + "'" } else { s += v } } return s + "}" }; iwms.logSave = function(u) { var d = new Date(); var m = new Date(2000, 0, 1); u.lastSet = Math.floor((d - m) / 60000); var s = iwms.obj2json(u); if (u.keep) { iwms.cookie("iwmsUser", s, 30) } else { iwms.cookie("iwmsUser", s) } }; iwms.logOut = function() { iwms.cookie("iwmsUser", "", -30); iwms.logReload() }; iwms.logReload = function() { var a = top.location.href; if (a.charAt(a.length - 1) == '#') { a = a.substr(0, a.length - 1) } if (a.substr(a.lastIndexOf("/") + 1).indexOf("member") == 0) { a = a.substr(0, a.lastIndexOf("/")) } top.location = a }; iwms.logedUser = function() { var s = iwms.cookie("iwmsUser").trim(); if (s.length == 0 || s.charAt(0) != '{' || s.charAt(s.length - 1) != '}') { s = { ver: 1, id: 0, name: '', pass: '', admin: 0, admPs: 0, signin: 0, msg: 0, keep: 0, lastSet: 0 } } else { eval("s=" + s) } return s }; iwms.user = iwms.logedUser(); iwms.logDisp = function() { $u = $("#topUser"); if ($u.length == 0 || iwms.user.id < 1) { return } var a = 5; var d = new Date(); var m = new Date(2000, 0, 1); var b = Math.floor((d - m) / 60000); if (b - iwms.user.lastSet > a) { iwms.logReset(); return } var c = ["你好,", iwms.user.name, "我的", (iwms.user.msg ? "新消息" : "消息"), (iwms.user.signin > 0 ? "待签收" : ""), "发布", (iwms.payEnable ? "充值" : ""), (iwms.user.admin ? "管理" : ""), "会员", "搜索", "退出"].join(""); $u.html(c) }; iwms.logReset = function() { iwms.ajSrc = null; $.post(iwms.urlPrefix + 'ajax.aspx', { cmd: 'userJson' }, function(r) { iwms.logSave(r); iwms.user = r; iwms.logDisp() }, 'json') }; $(function() { iwms.logDisp() }); iwms.logPop = function() { var b = boxys.login; if (b) { b.toggle() } else { b = new Boxy("", { title: "会员登录" }); b.resize(380, 180); boxys.login = b } }; iwms.popMine = function(a) { var b = $("
").appendTo(document.body).append("会员信息").append("发布内容").append("控制中心"); iwms.popMsg("my", a, b.get(0)) }; iwms.popPub = function(a) { var b = $("
").appendTo(document.body).append("发布新闻").append("发布软件"); iwms.popMsg("pub", a, b.get(0)) }; iwms.addFriend = function(b, c) { if (iwms.user.id <= 0) { iwms.popMsg("addFriend", b, "登陆会员才可以添加好友"); iwms.hideMsg("addFriend", 2000); return } var o = {}; o.cmd = "friendAdd"; o.friendId = c; $.post(iwms.urlPrefix + "ajax.aspx", o, function(r) { var a; if (r.success) { a = "添加好友成功" } else { a = "添加好友失败,已添加或达到好友数上限" } iwms.popMsg("addFriend", b, a); iwms.hideMsg("addFriend", 3000) }, 'json') }; iwms.removeFriend = function(b, c) { if (iwms.user.id <= 0) { return } var o = {}; o.cmd = "friendRemove"; o.friendId = c; $.post(iwms.urlPrefix + "ajax.aspx", o, function(r) { var a; if (r.success) { $(b).parent().remove() } else { a = "删除好友失败"; iwms.popMsg("removeFriend", b, a); iwms.hideMsg("removeFriend", 3000) } }, 'json') }; var msg = new Object(); msg.friendLoaded = false; msg.gotUnread = false; msg.dispContact = function(a) { $src = $(a); if ($src.next().css("display") != "none") { return } $("#msFriend,#msRecent").hide(); if ($src.next().attr("id") == "msFriend" && !msg.friendLoaded) { msg.getFriends() } else { $src.next().show() } }; msg.appendMsg = function(o) { var a = $("
"); a.addClass("msMsg"); $("
").addClass(o.sender == iwms.user.name ? "msMe" : "msSender").text(o.sender + " " + iwms.getClientDate(o.time).toFriendString()).appendTo(a); $("
").addClass(o.unread ? "msBody msUnread" : "msBody").html(o.body.replace(/\n/g, '
')).appendTo(a); $("#msList").append(a).scrollTop(10000) }; msg.init = function(u) { $("#msCon").find("div.msHead").click(function() { msg.dispContact(this) }); $(document).on("click", "#msRecent a,#msFriend a", function(a) { $this = $(this); $("#msRecent a,#msFriend a").removeClass("msCur"); $this.addClass("msCur").removeClass("msUnread"); iwms.ajSrc = null; $.post(iwms.urlPrefix + "ajax.aspx", { cmd: "msgGet", receiverId: $this.data("id") }, function(r) { $list = $("#msList").empty(); for (var i = 0; i < r.length; i++) { var o = r[i]; msg.appendMsg(o) } $("#msForm form input[name='id']").val($this.data("id")); if (msg.gotUnread && $("#msRecent a.msUnread").length == 0) { msg.gotUnread = false; iwms.logReset() } }, 'json'); msg.enable(); a.preventDefault() }); msg.getRecent(u); $("#msForm form").submit(function() { var o = new Object(); var a = $("#msForm form textarea"); o.receiverId = $("#msForm form input[name='id']").val(); o.body = a.val(); if (!/^\d+$/.test(o.receiverId)) { alert("请选择联系人"); return false } if (o.body.trim().length < 2) { alert("请填写消息内容"); return false } o.cmd = "msgPost"; o.body = iwms.ajEncode(o.body); $.post(iwms.urlPrefix + "ajax.aspx", o, function(r) { if (r.success) { msg.appendMsg({ sender: iwms.user.name, time: new Date(Date.parse(new Date()) - iwms.timeDiff), body: r.body }); a.val("") } }, 'json'); return false }); msg.handle = function(a) { if (a.ctrlKey && a.keyCode == 13) { $("#msForm form").submit(); return false } else { return true } }; msg.disable() }; msg.disable = function() { $("#msForm button").attr("disabled", "disabled"); $("#msForm textarea").val("").attr("disabled", "disabled") }; msg.enable = function() { $("#msForm button, #msForm textarea").removeAttr("disabled") }; msg.getRecent = function(u) { iwms.ajSrc = null; $.post(iwms.urlPrefix + "ajax.aspx", { cmd: "msgRecent" }, function(r) { iwms.setTimeDiff(r.serverTime); $recent = $("#msRecent"); for (var i = 0; i < r.contact.length; i++) { var o = r.contact[i]; var a = $("").text(o.name).attr("href", "#").data("id", o.id).appendTo($recent); if (o.unread) { a.addClass("msUnread"); msg.gotUnread = true } } if (u) { msg.addRecent(u) } }, 'json') }; msg.addRecent = function(u) { var a = null; $("#msRecent a").each(function() { if ($(this).data("id") == u.id) { a = $(this) } }); if (a == null) { a = $("").text(u.name).attr("href", "#").data("id", u.id).prependTo($recent) } a.click() }; msg.getFriends = function() { iwms.ajSrc = null; $.post(iwms.urlPrefix + "ajax.aspx", { cmd: "msgFriends" }, function(r) { $friend = $("#msFriend"); for (var i = 0; i < r.contact.length; i++) { var o = r.contact[i]; $("").text(o.name).attr("href", "#").data("id", o.id).appendTo($friend) } msg.friendLoaded = true; $friend.show() }, 'json') }; msg.disp = function(u) { var b = boxys.msg; if (b) { b.toggle(); if (u) { msg.addRecent(u) } } else { iwms.ajSrc = null; $.get(iwms.urlPrefix + "msg.xml", function(r) { var a = $(r).find("html:eq(0)").text(); boxys.msg = new Boxy(a, { title: "查看消息" }); msg.init(u) }, 'xml') } }; iwms.diggIt = function(b, c) { var d = iwms.cookie("iwmsDigged"); d = d.length == 0 ? [] : d.split(','); if (d.include(c)) { b.innerHTML = "已投票!"; b.onclick = function() { return false }; b.style.color = "#999"; return } iwms.ajSrc = b; $.post(iwms.urlPrefix + 'ajax.aspx', { cmd: 'digg', aid: c }, function(a) { if (a.success) { var o = b.parentNode.parentNode.getElementsByTagName("LI")[0]; o.innerHTML = parseInt(o.innerHTML) + 1; b.innerHTML = "已投票!"; b.onclick = function() { location.href = iwms.urlPrefix + 'hot.aspx' }; b.style.color = "#999"; if (d.length > 9) { d = d.slice(d.length - 9) } d.push(c); iwms.cookie("iwmsDigged", d.toString(), 30) } else { iwms.popMsg('digg', b, 'digg操作失败'); iwms.hideMsg('digg', 2000) } }, "json") }; iwms.addLink = function() { var b = boxys.addLink; if (b) { b.toggle() } else { b = new Boxy("", { title: "申请友情链接" }); b.resize(500, 340); boxys.addLink = b } }; var menu = new Object(); menu.container = null; menu.ele = null; menu.items = null; menu.done = false; menu.bind = function() { $("#navbar a[title]").each(function() { $this = $(this); $this.mouseover(function() { menu.show(this, $(this).data("id"), 1, 0) }).data("id", $this.attr("title")).removeAttr("title") }) }; $(function() { menu.bind() }); menu.show = function(e, a, p, b) { if (menu.items == null) { iwms.ajSrc = null; menu.items = nav_data; menu.show(e, a, p, b); return } if (menu.items[a] == null) { return } if (!document.all && !document.getElementById && !document.layers) { return false } menu.ele = e; var c = menu.items[a]; var d = 10; var f = Math.floor((c.length - 1) / d) + 1; if (c.length == 0) { return } if (menu.container == null) { var o = document.createElement("DIV"); menu.container = o } if (f == 1) { menu.addItem(c) } else { c = c.slice((p - 1) * d, p * d); menu.addItem(c); menu.container.appendChild(menu.pageDiv(a, p, f)) } iwms.popMsg("menu", e, menu.container, "menuskin"); return false }; menu.pageDiv = function(a, p, b) { var c = $("
").addClass("menuitems").css({ 'text-align': 'right', 'padding-right': '10px', 'white-space': 'nowrap' }); var d = $("").attr('face', 'arial').html('◄'); if (p == 1) { d.attr('color', '#cccccc') } else { d.css('cursor', 'pointer').data('idx', a).data('page', p - 1).click(menu.pageClick) } c.append(d); var e = $("").attr('face', 'arial').html('►'); if (p == b) { e.attr('color', '#cccccc') } else { e.css('cursor', 'pointer').data('idx', a).data('page', p + 1).click(menu.pageClick) } c.append(e); return c.get(0) }; menu.pageClick = function() { menu.show(menu.ele, $(this).data('idx'), $(this).data('page'), true); iwms.hideMsg('menu', 1500) }; menu.addItem = function(b) { for (var i = menu.container.childNodes.length; i--; i >= 0) { menu.container.removeChild(menu.container.childNodes[i]) } for (var i = 0; i < b.length; i++) { var a = b[i]; var c = document.createElement("DIV"); c.className = "menuitems"; c.onmouseover = new Function("menu.highlight(this,'on');"); c.onmouseout = new Function("menu.highlight(this,'off');"); var d = document.createElement("A"); if (iwms.urlPrefix.length > 0 && a[1].isRelate()) { d.href = iwms.urlPrefix + a[1] } else { d.href = a[1] } if (a[2]) { d.target = "_blank" } d.innerHTML = a[0]; c.appendChild(d); menu.container.appendChild(c) } }; menu.highlight = function(a, b) { a.id = (b == "on") ? "mouseoverstyle" : "" }; function Flash(a, w, h) { document.write(['
'].join('')) } function pollCheck(o, a) { var b = 0; var f = o.form; for (var i = 0; i < f.elements.length; i++) { var c = f.elements[i]; if (c.name == o.name && c.checked) { b++ } } if (b > a) { alert("最多选择" + a + "项!"); o.checked = false } } function ViewPoll(a) { window.open(iwms.urlPrefix + "pollView.aspx?act=result&id=" + a, "iwmsPoll", "width=500,height=400,left=0,top=0,scrollbars=1,status=1,resizable=1") } function StartRollV() { var a = 3000; var b = $("#oRollV"); if (b.length == 0) { return } if (b.children().length == 0) { b.hide(); return } $lastChild = b.children().last(); if (($lastChild.offset().top - b.offset().top + $lastChild.height()) < b.height()) { b.css("height", "auto"); return } myInter = setInterval(MarqueeV, a); b.mouseover(function() { clearInterval(myInter) }); b.mouseout(function() { myInter = setInterval("MarqueeV()", a) }) } function MarqueeV() { var a = $("#oRollV"); var b = $("a:eq(0)", a); b.slideUp('slow', function() { a.append(this); $(this).show() }) } function linkSize() { var a, o2; a = $("#siteNav"); $roll = $("#oRollV"); if (a.length > 0 && $roll.length > 0 && a.parents("table:last").find("#oRollV").length == 1) { if ($roll.parent().last().height() < a.offsetParent().height()) { $roll.height($roll.height() + a.parent().outerHeight() - $roll.parent().outerHeight()); if (/msie|MSIE 7/.test(navigator.userAgent)) { $roll.parents("table:last").css("table-layout", "fixed") } } } } var bRoll = new Object(); bRoll.delay = 3000; bRoll.timer = 0; bRoll.height = 0; bRoll.count = 0; bRoll.roll = function() { var b = $i("bulletinBody"); if (bRoll.count == bRoll.height) { if (b.scrollHeight - bRoll.height <= b.scrollTop) { b.scrollTop = b.scrollHeight / 2 - bRoll.height } bRoll.count = 0; bRoll.timer = setTimeout('bRoll.roll()', bRoll.delay) } else { b.scrollTop++; bRoll.count++; bRoll.timer = setTimeout('bRoll.roll()', 10) } }; bRoll.clear = function() { if (bRoll.count == 0) { clearTimeout(bRoll.timer); bRoll.timer = 0 } }; bRoll.init = function(b) { document.write('
'); var o, oD, oU, oL; o = $i("bulletin"); bRoll.height = o.scrollHeight; oD = document.createElement("DIV"); oU = document.createElement("UL"); o.onmouseover = bRoll.clear; o.onmouseout = function() { if (!bRoll.timer) { bRoll.timer = setTimeout('bRoll.roll()', bRoll.delay) } }; for (var i = 0; i < b.length; i++) { var a = b[i]; if (iwms.urlPrefix.length > 0 && a[1].isRelate()) { a[1] = iwms.urlPrefix + a[1] } oL = document.createElement("LI"); oL.innerHTML = '
' + a[0] + '(' + a[2] + ')'; oU.appendChild(oL) }; oD.appendChild(oU); oD.id = "bulletinBody"; oD.innerHTML += '
' + oD.innerHTML; o.appendChild(oD); bRoll.timer = setTimeout('bRoll.roll()', bRoll.delay) }; var imgSlide = new Object(); imgSlide.idx = 0; imgSlide.timer; imgSlide.imgs; imgSlide.show = function(a) { imgSlide.idx = a; imgSlide.setNum(a); imgSlide.setImg(a); imgSlide.setTitle(a) }; imgSlide.setNum = function(v) { for (var i = 0; i < imgSlide.imgs.length; i++) { $("#slNum a").eq(i).attr("class", v == i ? "slOn" : "slOff") } }; imgSlide.setImg = function(v) { var o = $i("slImg"); $(o).find("a:eq(0)").attr("href", imgSlide.imgs[v][1]).end().find("img:eq(0)").attr("src", imgSlide.imgs[v][2]) }; imgSlide.setTitle = function(v) { $("#slLink a:eq(0)").attr({ href: imgSlide.imgs[v][1] }).get(0).innerHTML = imgSlide.imgs[v][0] }; imgSlide.clear = function() { clearInterval(imgSlide.timer) }; imgSlide.start = function() { imgSlide.timer = setInterval("imgSlide.next()", 3000) }; imgSlide.next = function() { imgSlide.idx++; if (imgSlide.idx > imgSlide.imgs.length - 1) { imgSlide.idx = 0 } imgSlide.show(imgSlide.idx) }; imgSlide.init = function(w, h, b, c) { var l, a, v1; var d = document; d.write('
'); if (b.length == 0) { v1 = ["请先添加头条图片新闻", "###", "style/iwms/no_picture.gif"] } else { v1 = b[0] } for (var i = 0; i < b.length; i++) { b[i][0] = b[i][0].gbLeft(c, "..."); if (iwms.urlPrefix.length > 0) { if (b[i][1].isRelate()) { b[i][1] = iwms.urlPrefix + b[i][1] } if (b[i][2].isRelate()) { b[i][2] = iwms.urlPrefix + b[i][2] } } } imgSlide.imgs = b; $imgs = $("