myAddEvent(window, "load", function() {
if(document.getElementById("quick_nav")){

var oQuickNav = document.getElementById("quick_nav");
var oQuickNavDiv = oQuickNav.getElementsByTagName("div");
var oBtn = true;
oQuickNavDiv[0].onclick = function() {
if (oBtn == true) {
this.className = "quick_btn current";
oQuickNavDiv[1].className = "quick_con show";
} else {
this.className = "quick_btn";
oQuickNavDiv[1].className = "quick_con hide";
}
oBtn = !oBtn;
}
}

});
function tervalTop(){
var news = document.getElementById("news_li");
var newsTop = 0;
var newsLi = news.getElementsByTagName("li");
var iCount = newsLi * 19;
var oBtn = true;
myAddEvent(window, "load", function() {

setInterval(function(){

if(oBtn){
newsTop -= 19;
}else{
newsTop += 19;
}
iCount++;
news.style.top = newsTop + "px";
if(((news.offsetHeight-19) + newsTop) ==0 || newsTop == 0){
oBtn = !oBtn;
}
}, 2000)
});
}
function readUbb(jo) {
var jm = {
mode: "click",
modeTime: "5000",
thisEvent: "thisEvent",
readCount: 5,
ubbBox: "ubbBox",
ubb: "{bbs=0_2_1_12_4}",
ubbTag: "a",
siteid: "1000",
loadHref: "",
loadFn: function() {
},
failureFn: function() {
},
returnUbbFn: function(sHtml) {
}
}
extend(jm, jo);
jm.ubbBox = document.getElementById(jm.ubbBox);
var iMListBtn = jm.ubb.match(/_/g).length;
if (jm.mode == "setInterval") {
jm.readCount = -1;
setInterval(getReadUbb, jm.modeTime);
} else {
jm.thisEvent = document.getElementById(jm.thisEvent);
myAddEvent(jm.thisEvent, "click", function() {
getReadUbb();
});
}
function getReadUbb() {
if (jm.readCount > 0 || jm.readCount == -1) {
if (iMListBtn == 4) {
var iTag = 0;
if (jm.readCount > 0) {
iTag = jm.ubbBox.getElementsByTagName(jm.ubbTag).length;
}
iTag = parseInt(getIndexOf(jm.ubb, "_", "_")) + iTag;
var url = "/ajax_ubb.aspx?siteid=" + jm.siteid + "&ubb=" + jm.ubb.replace(/\_(.*?)\_/, "_" + iTag + "_");
}
ajax("post", url, function(sHtml) {
jm.returnUbbFn(sHtml);
jm.ubbBox.innerHTML = sHtml;
if (jm.readCount > 0) {
jm.readCount--;
if (jm.readCount == 0) {
jm.loadFn();
}
}
}, function() {
jm.failureFn()
});
} else {
if (jm.loadHref != "") {
window.location.href = jm.loadHref;
}
}
}
function getIndexOf(str, sLeft, sRight) {
var sm = str.indexOf(sLeft);
var xm = str.indexOf(sRight, sm + 1);
str = str.substring(sm + sLeft.length, xm);
return str;
}
function myAddEvent(obj, sEv, fn) {
if (obj.attachEvent) {
obj.attchEvent("on", sEv, fn);
} else {
obj.addEventListener(sEv, fn, false);
}
}
function ajax(sty, url, fnTrue, fnFalse) {
var oAjax = null;

if (window.XMLHttpRequest) {
oAjax = new XMLHttpRequest();
} else {
oAjax = new ActiveXObject("Microsoft.XMLHTTP");
}
switch (sty) {
case "post":
var arr = url.split("?");
oAjax.open(sty, arr[0], true);
oAjax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
if (arr.length < 2) {
oAjax.send(arr[1]);
} else {
var arrUrl = "";
for (var i = 1; i < arr.length; i++) {
arrUrl += "?" + arr[i];
}
oAjax.send(arrUrl.substring(1));
}
break;
case "get":
url += "&" + new Date().getTime();
oAjax.open(sty, url, true);
oAjax.send();
break;
}
oAjax.onreadystatechange = function() {
if (oAjax.readyState == 4) {
if (oAjax.status == 200) {
fnTrue(oAjax.responseText);
} else {
if (fnFalse) {
fnFalse();
}
}
}
}
}
function extend(obj1, obj2) {
for (var attr in obj2) {
obj1[attr] = obj2[attr];
}
}

}
function myAddEvent(obj, sEv, fn) {
if (obj.attachEvent) {
obj.attchEvent("on", sEv, fn);
} else {
obj.addEventListener(sEv, fn, false);
}
}
function createBox(id, sHtml) {
var obj = document.createElement('div');
obj.className = id;
obj.id = id;
obj.innerHTML = sHtml;
document.body.appendChild(obj);
}
myAddEvent(window, "load", function (){
try{loadFn();}catch(e){}

});
function loadFn() {
var oMenu = document.getElementById("menu-js");
var oSearch = document.getElementById("search-js");
var oUser = document.getElementById("user-js");
var oSearch = document.getElementById("search-box");
createBox("search-show", "");
var oSearchShow = document.getElementById("search-show");
var oAside = document.getElementById("aside");
var oAsideLeft = document.getElementsByClassName("aside-left");
var oHeader = document.getElementById("header");
myAddEvent(oMenu, "click", function() {
oAside.className += " on";
oSearchShow.className += " on";
for (var i = 0; i < oAsideLeft.length; i++) {
oAsideLeft[i].className += " on";
}
});
myAddEvent(oSearch, "click", function(e) {
var thisSource = e.target || window.event.srcElement;
if (oSearch.className == "search-box") {
oSearch.className += " on";
oSearchShow.className += " on";
oHeader.

Next
Pg.: 1 2 3 4


Back to home | File page

Subscribe | Register | Login | N