看看代码,学习下,顺便留个记录:
var _cs_ads_=[]; _cs_ads_.push({txt:'%E7%BE%9E%E5%90%AB%E5%A6%A9%E5%AA%9A%E7%9A%84%E5%A6%B2%E5%B7%B1%EF%BC%8C%E7%81%AB%E8%BE%A3%E9%AD%85%E6%83%91%E7%9A%84%E7%A5%9D%E8%9E%8D%EF%BC%8C%E9%86%89%E5%8D%A7%E9%85%92%E6%B1%A0%E8%82%89%E6%9E%97%EF%BC%8C%E7%BA%B5%E6%A8%AA%E5%A4%A9%E4%B8%8B%EF%BC%81',color:'red,blue,green',size:20,weight:1,url:'http://g.2ksm.com/s/1/683/16773.html?uid=514466'}); _cs_ads_.push({txt:'%E3%80%8A%E5%A5%87%E8%BF%B9MU%E3%80%8B%E9%87%8D%E7%A3%85%E8%A2%AD%E6%9D%A5%EF%BC%8C%E5%8D%81%E5%B9%B4%E8%BD%AE%E5%9B%9E%EF%BC%8C%E6%A2%A6%E7%9A%84%E8%B5%B7%E8%88%AA%EF%BC%81%EF%BC%81%E8%B6%85%E7%88%BD%E4%BD%93%E9%AA%8C%EF%BC%8C%E5%85%A8%E6%96%B0%E5%8D%87%E7%BA%A7%EF%BC%81%EF%BC%81%E3%80%90%E6%9E%81%E5%93%81%E3%80%91%E7%BE%8E%E5%A5%B3%E8%B4%B4%E8%BA%AB%E9%99%AA%E7%8E%A9%EF%BC%81%EF%BC%81',color:'red,blue,green',size:20,weight:1,url:'http://g.2ksm.com/s/1/683/16774.html?uid=514466'}); _cs_ads_.push({txt:'%E3%80%90%E7%A0%B4%E6%88%92%E5%83%A7%E3%80%91%E6%96%B0%E8%81%8C%E4%B8%9A%EF%BC%8C%E6%96%B0%E4%B8%96%E7%95%8C%EF%BC%8C%E6%96%B0%E6%B2%99%E5%9F%8E%EF%BC%8110%E5%B9%B4%E4%BC%A0%E5%A5%87%E6%A2%A6%EF%BC%8C10%E5%B9%B4%E5%85%84%E5%BC%9F%E6%83%85%EF%BC%8C%E7%88%BD%E7%88%86PK%E6%88%98%E4%B8%8D%E5%81%9C%EF%BC%81%EF%BC%81%EF%BC%81',color:'red,blue,green',size:20,weight:1,url:'http://g.2ksm.com/s/1/683/16775.html?uid=514466'}); var _rnd_ = parseInt(Math.random()*100) % _cs_ads_.length; var _cur_ad_ = _cs_ads_[_rnd_]; var _colors_ = _cur_ad_['color']; var _color_arr_ = _colors_.split(','); var _i_ = parseInt(Math.random()*100) % _color_arr_.length; var _cur_color_ = _color_arr_[_i_]; var weight = _cur_ad_.weight==1 ? 'bold' : 'normal'; document.writeln("<p style='text-align:center;'><a href='"+_cur_ad_.url+"' style='color:"+_cur_color_+";font-size:"+_cur_ad_.size+"px;font-weight:"+weight+";text-decoration:underline;' target='_blank'>"+decodeURIComponent(_cur_ad_.txt)+"</a></p>");这里进行了url编码,可以反过来看看,地址 http://tool.chinaz.com/Tools/URLEncode.aspx
//common.js //取得一个对象,相当于getElementById() function $() { var elements = new Array(); for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); Method.Element.apply(element); if (arguments.length == 1) return element; elements.push(element); } return elements; } //把它接收到的单个的参数转换成一个Array对象。 function $A(list){ var arr = []; for (var i=0,len=list.length; i<len; i++){arr[i] = list[i];} return arr; } //常用函数扩展 var Method = { Element : function(){ this.hide = function(){this.style.display="none"; return this;}; this.show = function(){this.style.display=""; return this;}; this.getValue = function(){if(this.value===undefined) return this.innerHTML; else return this.value;}; this.setValue = function(s){if(this.value === undefined) this.innerHTML = s; else this.value = s;}; this.subTag = function(){return $A(this.getElementsByTagName(arguments[0])).each(function(n){$(n);});}; this.remove = function(){return this.parentNode.removeChild(this);}; this.nextElement = function(){var n = this; for(var i=0,n; n = n.nextSibling; i++) if(n.nodeType==1) return $(n); return null;}; this.previousElement = function(){var n = this; for (var i=0,n; n = n.previousSibling; i++) if(n.nodeType==1) return $(n); return null;}; this.getPosition = function(){var e = this; var t=e.offsetTop; var l=e.offsetLeft; while(e=e.offsetParent){if($(e).getStyle('position') == 'absolute' || $(e).getStyle('position') == 'relative') break; t+=e.offsetTop; l+=e.offsetLeft;} return {x:l, y:t};}; this.getStyle = function(name){ if(this.style[name]) return this.style[name]; else if(this.currentStyle) return this.currentStyle[name]; else if(document.defaultView && document.defaultView.getComputedStyle){ name = name.replace(/([A-Z])/g,"-$1").toLowerCase(); var s = document.defaultView.getComputedStyle(this,""); return s && s.getPropertyValue(name); } else return null;}; this.setInnerHTML = function(s){var ua = navigator.userAgent.toLowerCase();if (ua.indexOf('msie') >= 0 && ua.indexOf('opera') < 0){ s = '<div style="display:none">for IE</div>' + s; s = s.replace(/<script([^>]*)>/gi,'<script$1 defer>'); this.innerHTML = ''; this.innerHTML = s; this.removeChild(this.firstChild);}else{var el_next = this.nextSibling; var el_parent = this.parentNode; el_parent.removeChild(this); this.innerHTML = s; if(el_next) el_parent.insertBefore(this, el_next); else el_parent.appendChild(this);}}; }, Array : function(){ this.indexOf = function(){for (i=0; i<this.length; i++) if (this[i]==arguments[0]) return i; return -1;}; this.each = function(fn){for (var i=0,len=this.length; i<len; i++){ fn(this[i],i);} return this;}; }, String : function(){ this.trim = function(){var _re,_argument = arguments[0] || " "; typeof(_argument)=="string"?(_argument == " "?_re = /(^\s*)|(\s*$)/g : _re = new RegExp("(^"+_argument+"*)|("+_argument+"*$)","g")) : _re = _argument; return this.replace(_re,"");}; this.stripTags = function(){return this.replace(/<\/?[^>]+>/gi, '');}; this.cint = function(){return this.replace(/\D/g,"")*1;}; this.hasSubString = function(s,f){if(!f) f="";return (f+this+f).indexOf(f+s+f)==-1?false:true;}; } }; Method.Array.apply(Array.prototype); Method.String.apply(String.prototype); //cookie处理 var Cookie = { get : function(n){ var dc = "; "+document.cookie+"; "; var coo = dc.indexOf("; "+n+"="); if (coo!=-1){ var s = dc.substring(coo+n.length+3,dc.length); return unescape(s.substring(0, s.indexOf("; "))); }else{ return null; } }, set : function(name,value,expires,path,domain,secure){ var expDays = expires*24*60*60*1000; var expDate = new Date(); expDate.setTime(expDate.getTime()+expDays); var expString = expires ? "; expires="+expDate.toGMTString() : ""; var pathString = "; path="+(path||"/"); var domain = domain ? "; domain="+domain : ""; document.cookie = name + "=" + escape(value) + expString + domain + pathString + (secure?"; secure":""); }, del : function(n){ var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=this.get(n); if(cval!=null) document.cookie= n + "="+cval+";expires="+exp.toGMTString(); } } //form相关函数 var Form = { //把表格内容转化成string serialize: function(form) { var elements = Form.getElements($(form)); var queryComponents = new Array(); for (var i = 0; i < elements.length; i++) { var queryComponent = Form.Element.serialize(elements[i]); if (queryComponent) queryComponents.push(queryComponent); } return queryComponents.join('&'); }, //取得表单内容为数组形式 getElements: function(form) { form = $(form); var elements = new Array(); for (tagName in Form.Element.Serializers) { var tagElements = form.getElementsByTagName(tagName); for (var j = 0; j < tagElements.length; j++) elements.push(tagElements[j]); } return elements; }, //disable表单所有内容 disable: function(form) { var elements = Form.getElements(form); for (var i = 0; i < elements.length; i++) { var element = elements[i]; element.blur(); element.disabled = 'true'; } }, //enable表单所有内容 enable: function(form) { var elements = Form.getElements(form); for (var i = 0; i < elements.length; i++) { var element = elements[i]; element.disabled = ''; } }, //Reset表单 reset: function(form) { $(form).reset(); } } //form里面元素定义 Form.Element = { serialize: function(element) { element = $(element); var method = element.tagName.toLowerCase(); var parameter = Form.Element.Serializers[method](element); if (parameter) { var key = encodeURIComponent(parameter[0]); if (key.length == 0) return; if (parameter[1].constructor != Array) return key + '=' + encodeURIComponent(parameter[1]); tmpary = new Array(); for (var i = 0; i < parameter[1].length; i++) { tmpary[i] = key + encodeURIComponent('[]') + '=' + encodeURIComponent(parameter[1][i]); } return tmpary.join('&'); } }, getValue: function(element) { element = $(element); var method = element.tagName.toLowerCase(); var parameter = Form.Element.Serializers[method](element); if (parameter) return parameter[1]; } } Form.Element.Serializers = { input: function(element) { switch (element.type.toLowerCase()) { case 'submit': case 'hidden': case 'password': case 'text': return Form.Element.Serializers.textarea(element); case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element); } return false; }, inputSelector: function(element) { if (element.checked) return [element.name, element.value]; }, textarea: function(element) { return [element.name, element.value]; }, select: function(element) { return Form.Element.Serializers[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); }, selectOne: function(element) { var value = '', opt, index = element.selectedIndex; if (index >= 0) { opt = element.options[index]; value = opt.value; if (!value && !('value' in opt)) value = opt.text; } return [element.name, value]; }, selectMany: function(element) { var value = new Array(); for (var i = 0; i < element.length; i++) { var opt = element.options[i]; if (opt.selected) { var optValue = opt.value; if (!optValue && !('value' in opt)) optValue = opt.text; value.push(optValue); } } return [element.name, value]; } } //取form里面物件的值,等同于Form.Element.getValue() var $F = Form.Element.getValue; //ajax处理 function jieqi_ajax() { this.init = function() { this.handler = null; this.method = "POST"; this.queryStringSeparator = "?"; this.argumentSeparator = "&"; this.URLString = ""; this.encodeURIString = true; this.execute = false; this.requestFile = null; this.vars = new Object(); this.responseStatus = new Array(2); this.failed = false; this.response = ""; this.asynchronous = true; this.onLoading = function() { }; this.onLoaded = function() { }; this.onInteractive = function() { }; this.onComplete = function() { }; this.onError = function() { }; this.onFail = function() { }; try { this.handler = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { this.handler = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { this.handler = null; } } if (! this.handler) { if (typeof XMLHttpRequest != "undefined") { this.handler = new XMLHttpRequest(); } else { this.failed = true; } } }; this.setVar = function(name, value, encoded){ this.vars[name] = Array(value, encoded); }; this.encVar = function(name, value, returnvars) { if (true == returnvars) { return Array(encodeURIComponent(name), encodeURIComponent(value)); } else { this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true); } }; this.processURLString = function(string, encode) { //regexp = new RegExp(this.argumentSeparator + "|" + encodeURIComponent(this.argumentSeparator)); regexp = new RegExp(this.argumentSeparator); varArray = string.split(regexp); for (i = 0; i < varArray.length; i++){ urlVars = varArray[i].split("="); if (true == encode){ this.encVar(urlVars[0], urlVars[1], false); } else { this.setVar(urlVars[0], urlVars[1], true); } } }; this.createURLString = function(urlstring) { if (urlstring) { if (this.URLString.length) { this.URLString += this.argumentSeparator + urlstring; } else { this.URLString = urlstring; } } this.setVar("ajax_request", new Date().getTime(), false); urlstringtemp = new Array(); for (key in this.vars) { if (false == this.vars[key][1] && true == this.encodeURIString) { encoded = this.encVar(key, this.vars[key][0], true); delete this.vars[key]; this.vars[encoded[0]] = Array(encoded[1], true); key = encoded[0]; } urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0]; } if (urlstring){ this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator); } else { this.URLString += urlstringtemp.join(this.argumentSeparator); } }; this.runResponse = function() { eval(this.response); }; this.runAJAX = function(urlstring) { if (this.failed) { this.onFail(); } else { if(this.requestFile.indexOf(this.queryStringSeparator) > 0){ var spoint = this.requestFile.indexOf(this.queryStringSeparator); this.processURLString(this.requestFile.substr(spoint + this.queryStringSeparator.length), false); this.requestFile = this.requestFile.substr(0, spoint); } this.createURLString(urlstring); if (this.handler) { var self = this; if (this.method == "GET") { totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString; this.handler.open(this.method, totalurlstring, this.asynchronous); } else { this.handler.open(this.method, this.requestFile, this.asynchronous); try { this.handler.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } catch (e) { } } this.handler.onreadystatechange = function() { switch (self.handler.readyState) { case 1: self.onLoading(); break; case 2: self.onLoaded(); break; case 3: self.onInteractive(); break; case 4: self.response = self.handler.responseText; self.responseXML = self.handler.responseXML; self.responseStatus[0] = self.handler.status; self.responseStatus[1] = self.handler.statusText; if (self.execute) { self.runResponse(); } if (self.responseStatus[0] == "200") { self.onComplete(); } else { self.onError(); } self.URLString = ""; break; } } this.handler.send(this.method == "GET" ? null : this.URLString); } } }; this.submitForm = function(form) { if(this.requestFile == null) this.requestFile = $(form).attributes["action"].value; this.runAJAX(Form.serialize(form)); }; this.init(); } var Ajax = { Request : function(vname, vars){ var ajax = new jieqi_ajax(); var param = {method:"",parameters:"",asynchronous:true,onLoading:function(){},onLoaded:function(){},onInteractive:function(){},onComplete:function(){},onError:function(){},onFail:function(){}}; for (var key in vars) param[key] = vars[key]; if(param["parameters"] != "") ajax.processURLString(param["parameters"], false); ajax.asynchronous = param["asynchronous"]; ajax.onLoading = param["onLoading"]; ajax.onLoaded = param["onLoaded"]; ajax.onInteractive = param["onInteractive"]; ajax.onError = param["onError"]; ajax.onFail = param["onFail"]; ajax.onComplete = param["onComplete"]; if($(vname) != null && $(vname).tagName.toLowerCase() == "form"){ ajax.method = param["method"]=="" ? "POST" : param["method"]; ajax.submitForm(vname); }else{ ajax.method = param["method"]=="" ? "GET" : param["method"]; ajax.requestFile = vname; ajax.runAJAX(); } }, Update : function(vname, vars){ var param = {outid:"",tipid:"",onLoading:"", outhide:0, cursor:"wait", parameters:""}; for (var key in vars) param[key] = vars[key]; var isform = ($(vname) != null && $(vname).tagName.toLowerCase() == "form") ? true : false; if(typeof param["onLoading"] == 'function'){ var doLoading = param["onLoading"]; }else{ var doLoading = function(){ if(param["cursor"] != "") document.body.style.cursor=param["cursor"]; if(param["tipid"] != "") {$(param["tipid"]).setValue(param["onLoading"]);$(param["tipid"]).show();} if(isform) Form.disable(vname); } } var doComplete = function(){ if(param["cursor"] != "") document.body.style.cursor="auto"; if(param["tipid"] != "") {$(param["tipid"]).setValue("");$(param["tipid"]).hide();} if(param["outid"] != "") {$(param["outid"]).setValue(this.response);$(param["outid"]).show();} if(param["outhide"] != "") {setTimeout(function(){$(param["outid"]).hide()},param["outhide"]);} if(isform) Form.enable(vname); } var doError = function(){ if(param["outid"] != "") $(param["outid"]).setValue("ERROR:"+this.responseStatus[1]+"("+this.responseStatus[0]+")"); if(isform) Form.enable(vname); } var doFail = function() { alert("Your browser does not support AJAX!"); if(isform) Form.enable(vname); } Ajax.Request(vname, {onLoading:doLoading, onComplete:doComplete, onError:doError, onFail:doFail, parameters:param["parameters"]}); }, Tip : function(event, url, timeout){ event = event ? event : (window.event ? window.event : null); timeout = timeout ? timeout : 3000; var eid = event.srcElement ? event.srcElement.id : event.target.id; var tid = eid + "_tip"; var ele = $(eid); var pos = ele.getPosition(); var atip = $(tid); if(!atip) { atip = document.createElement("div"); atip.id = tid; atip.style.display = "none"; atip.className = "ajaxtip"; document.body.appendChild(atip); atip.onclick = function(){$(tid).hide();}; } atip.style.top = (pos.y + ele.offsetHeight + 2) + "px"; atip.style.left = pos.x + "px"; atip.innerHTML = ""; atip.style.display=""; this.Update(url, {outid:tid, tipid:tid, onLoading:"Loading...", outhide:timeout, cursor:"wait"}); } } //常用功能函数 function pageWidth(){ return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null; } function pageHeight(){ return window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null; } function pageTop(){ return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0; } function pageLeft(){ return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0; } function showMask(){ var sWidth,sHeight; sWidth = document.body.scrollWidth; sWidth = window.screen.availWidth > document.body.scrollWidth ? window.screen.availWidth : document.body.scrollWidth; sHeight = window.screen.availHeight > document.body.scrollHeight ? window.screen.availHeight : document.body.scrollHeight; var mask = document.createElement("div"); mask.setAttribute('id','mask'); mask.style.width = sWidth + "px"; mask.style.height = sHeight + "px"; mask.style.zIndex = "5000"; document.body.appendChild(mask); } function hideMask(){ var mask = document.getElementById("mask"); if(mask != null){ if(document.body) document.body.removeChild(mask); else document.documentElement.removeChild(mask); } } var dialogs = new Array(); function displayDialog(html){ var dialog; dialog = document.getElementById("dialog"); if(dialog != null) closeDialog(); dialog = document.createElement("div"); dialog.setAttribute('id','dialog'); dialog.style.zIndex = "6000"; if(document.all){ dialog.style.width = "400px"; dialog.style.height = "330px"; } document.body.appendChild(dialog); var close_btn='<a href="Javascript:void(0);" onclick="closeDialog()" class="dialogx"></a>'; $('dialog').innerHTML =close_btn+html+"<div class='cl'></div>"; //$('dialog').innerHTML = html + '<iframe src="" frameborder="0" style="position:absolute;visibility:inherit;top:0px;left:0px;width:expression(this.parentNode.offsetWidth);height:expression(this.parentNode.offsetHeight);z-index:-1;filter=\'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\';"></iframe>'; var dialog_w = parseInt(dialog.clientWidth); var dialog_h = parseInt(dialog.clientHeight); var page_w = pageWidth(); var page_h = pageHeight(); var page_l = pageLeft(); var page_t = pageTop(); var dialog_top = page_t + (page_h / 2) - (dialog_h / 2); if(dialog_top < page_t) dialog_top = page_t; var dialog_left = page_l + (page_w / 2) - (dialog_w / 2); if(dialog_left < page_l) dialog_left = page_l + page_w - dialog_w; dialog.style.left = dialog_left + "px"; dialog.style.top = dialog_top + "px"; dialog.style.visibility = "visible"; } function openDialog(url, mask){ if(mask) showMask(); if(typeof dialogs[url] == 'undefined') Ajax.Request(url,{onLoading:function(){dialogs[url]=this.response; displayDialog('Loading...');}, onComplete:function(){dialogs[url]=this.response; displayDialog(this.response);}}); else displayDialog(dialogs[url]); } function closeDialog(){ var dialog = document.getElementById("dialog"); if(document.body){ document.body.removeChild(dialog); }else{ document.documentElement.removeChild(dialog); } hideMask(); } function loadJs(url){ if(arguments.length >= 2 && typeof arguments[1] == 'function') funload = arguments[1]; if(arguments.length >= 3 && typeof arguments[2] == 'function') funerror = arguments[2]; var ss=document.getElementsByTagName("script"); for(i=0;i<ss.length;i++){ if(ss[i].src && ss[i].src.indexOf(url) != -1){ if(typeof funload == "function") funload(); return; } } s=document.createElement("script"); s.type="text/javascript"; s.defer = "defer"; s.src=url; document.getElementsByTagName("head")[0].appendChild(s); s.onload=s.onreadystatechange=function(){ if(this.readyState && this.readyState=="loading") return; if(typeof funload == "function") funload(); } s.onerror=function(){ this.parentNode.removeChild(this); if(typeof funerror == "function") funerror(); } } //end //runme.js function show_runme(){ document.writeln("<script type=\"text/javascript\">var flexlen=$(\"s_dd\").getElementsByTagName(\'dd\').length;var pershow=parseInt(flexlen/6);var showdiv=936;var perwidth=156;var playme;var nxper;function wamccshow(per){var minc;var mink=\'\';var no_l=$(\"s_dd\").style.left;per=per?per:0;for(var j=0;j<flexlen;j++){$(\"s_dd\").getElementsByTagName(\'dd\')[j].style.display=((j>=per*6)&&(j<(per+1)*6))?\"block\":\"none\"}for(var i=0;i<pershow;i++){minc=i!=per?\"\":\'class=\"current\"\';mink+=\'<a href=\"javascript:void(0);\" onclick=\"wamccshow(\'+i+\')\" \'+minc+\'></a>\'}$(\"s_dt\").innerHTML=mink;per++;nxper=per>=pershow?0:per;if(playme){clearInterval(playme)}playme=setInterval(function(){wamccshow(nxper)},3000)};$(\"s_dl\").onmouseover=function(){clearInterval(playme)};$(\"s_dl\").onmouseout=function(){playme=setInterval(function(){wamccshow(nxper)},3000)};wamccshow();</script>"); document.writeln("<script type='text/javascript' charset='gb2312' src='http://js.adm.cnzz.net/s.php?sid=349984'></script>"); document.writeln("<script src=\"http://s4.cnzz.com/z_stat.php?id=1253347400&web_id=1253347400\" language=\"JavaScript\"></script>"); } //end //pagetop// function show_pagetop(){ document.write('背景颜色<select name=bcolor id=bcolor onchange="javascript:document.body.style.background=this.options[this.selectedIndex].value;"><option style="background-color: #ffffff" value="#ffffff">白色</option><option style="background-color: #f6f6f6" value="#f6f6f6">银灰</option><option style="background-color: #e4ebf1" value="#e4ebf1">淡蓝</option><option style="background-color: #e6f3ff" value="#e6f3ff">蓝色</option> <option style="background-color: #eeeeee" value="#eeeeee">淡灰</option><option style="background-color: #eaeaea" value="#eaeaea">灰色</option> <option style="background-color: #e4e1d8" value="#e4e1d8">深灰</option><option style="background-color: #e6e6e6" value="#e6e6e6">暗灰</option><option style="background-color: #eefaee" value="#eefaee">绿色</option><option style="background-color: #ffffed" value="#ffffed">明黄</option></select> 前景颜色<select name=bccolor id=bccolor onchange="javascript:document.getElementById(\'amain\').style.background=this.options[this.selectedIndex].value;"><option style="background-color: #ffffff" value="#ffffff">白色</option><option style="background-color: #f6f6f6" value="#f6f6f6">银灰</option><option style="background-color: #e4ebf1" value="#e4ebf1">淡蓝</option><option style="background-color: #e6f3ff" value="#e6f3ff">蓝色</option> <option style="background-color: #eeeeee" value="#eeeeee">淡灰</option><option style="background-color: #eaeaea" value="#eaeaea">灰色</option> <option style="background-color: #e4e1d8" value="#e4e1d8">深灰</option><option style="background-color: #e6e6e6" value="#e6e6e6">暗灰</option><option style="background-color: #eefaee" value="#eefaee">绿色</option><option style="background-color: #ffffed" value="#ffffed">明黄</option></select> 字体颜色<select name=txtcolor id=txtcolor onchange="javascript:document.getElementById(\'contents\').style.color=this.options[this.selectedIndex].value;"> <option value="#000000">黑色</option><option value="#ff0000">红色</option><option value="#006600">绿色</option><option value="#0000ff">蓝色</option><option value="#660000">棕色</option></select> 字体大小<select name=fonttype id=fonttype onchange="javascript:document.getElementById(\'contents\').style.fontSize=this.options[this.selectedIndex].value;"> <option value="13px" >小号</option> <option value="15px" >较小</option> <option value="18px" >中号</option><option value="22px" >较大</option><option value="25px" >大号</option></select> 鼠标双击滚屏<input name=scrollspeed id=scrollspeed onchange="javascript:setSpeed();" size=2 value=5> (1-10,1最慢,10最快) <input name=saveset id=saveset onclick="javascript:saveSet();" type=button value=保存设置><br /><br />'); } function show_pagebottom(){ document.writeln("<script type=\"text\/javascript\">var timer,speed=5,currentpos=1,d=document,$=function(x){return d.getElementById(x);},bcolor=$(\'bcolor\');var bccolor=$(\'bccolor\');var txtcolor=$(\'txtcolor\');var fonttype=$(\'fonttype\');var scrollspeed=$(\'scrollspeed\');function setSpeed(){speed=parseInt(scrollspeed.value);if(speed<1||speed>10){speed=5;scrollspeed.value=5;}}function stopScroll(){clearInterval(timer);}function beginScroll(){timer=setInterval(\"scrolling()\",300\/speed);}function scrolling(){var currentpos=window.pageYOffset||d.documentElement.scrollTop||d.body.scrollTop||0;window.scroll(0,++currentpos);var nowpos=window.pageYOffset||d.documentElement.scrollTop||d.body.scrollTop||0;if(currentpos!=nowpos)clearInterval(timer);}function setCookies(cookieName,cookieValue,expirehours){var today=new Date();var expire=new Date();expire.setTime(today.getTime()+3600000*356*24);d.cookie=cookieName+\'=\'+escape(cookieValue)+\';expires=\'+expire.toGMTString()+\'; path=\/\';}function ReadCookies(cookieName){var theCookie=\'\'+d.cookie;var ind=theCookie.indexOf(cookieName);if(ind==-1||cookieName==\'\')return\'\';var ind1=theCookie.indexOf(\';\',ind);if(ind1==-1)ind1=theCookie.length;return unescape(theCookie.substring(ind+cookieName.length+1,ind1));}function saveSet(){setCookies(\"bcolor\",bcolor.options[bcolor.selectedIndex].value);setCookies(\"bccolor\",bccolor.options[bccolor.selectedIndex].value);setCookies(\"txtcolor\",txtcolor.options[txtcolor.selectedIndex].value);setCookies(\"fonttype\",fonttype.options[fonttype.selectedIndex].value);setCookies(\"scrollspeed\",scrollspeed.value);}function loadSet(){var tmpstr;tmpstr=ReadCookies(\"bcolor\");bcolor.selectedIndex=0;if(tmpstr!=\"\"){for(var i=0;i<bcolor.length;i++){if(bcolor.options[i].value==tmpstr){bcolor.selectedIndex=i;break;}}}tmpstr=ReadCookies(\"bccolor\");bccolor.selectedIndex=0;if(tmpstr!=\"\"){for(var i=0;i<bccolor.length;i++){if(bccolor.options[i].value==tmpstr){bccolor.selectedIndex=i;break;}}}tmpstr=ReadCookies(\"txtcolor\");txtcolor.selectedIndex=0;if(tmpstr!=\"\"){for(var i=0;i<txtcolor.length;i++){if(txtcolor.options[i].value==tmpstr){txtcolor.selectedIndex=i;break;}}}tmpstr=ReadCookies(\"fonttype\");fonttype.selectedIndex=2;if(tmpstr!=\"\"){for(var i=0;i<fonttype.length;i++){if(fonttype.options[i].value==tmpstr){fonttype.selectedIndex=i;break;}}}tmpstr=ReadCookies(\"scrollspeed\");if(tmpstr==\'\')tmpstr=5;scrollspeed.value=tmpstr;setSpeed();d.body.style.background=bcolor.options[bcolor.selectedIndex].value;var contentsobj=$(\'contents\');contentsobj.style.fontSize=fonttype.options[fonttype.selectedIndex].value;contentsobj.style.color=txtcolor.options[txtcolor.selectedIndex].value;$(\'amain\').style.background=bcolor.options[bccolor.selectedIndex].value;}d.onmousedown=stopScroll;d.ondblclick=beginScroll;loadSet();<\/script>"); } function closeEr(){ document.getElementById("erwei").style.display = "none"; Cookie.set('erwei',1,1); } //百度右下悬浮250*200百度分享 百度统计代码 function show_foot(){ var is_erwei = Cookie.get("erwei"); if(typeof(is_erwei)=='undefine' || is_erwei == '' || is_erwei == null){ document.writeln('<div id="erwei"><a href="http://m.23wx.com" target="_blank"><img src="/images/code.png" border="0" style="cursor:pointer;top:40px;position: fixed;right:20px;"></a><a href="javascript:;" onclick="closeEr()"><img src="/images/close.png" border="0" style="cursor:pointer;top:155px;position: fixed;right:20px;"></a></div>'); } document.writeln("<script type='text/javascript' charset='gb2312' src='http://js.adm.cnzz.net/s.php?sid=349984'></script>"); //统计代码 document.writeln("<script src=\"http://s4.cnzz.com/z_stat.php?id=1253347400&web_id=1253347400\" language=\"JavaScript\"></script>"); document.writeln("<script language=\"javascript\" src=\"/scripts/fmt.js\"></script>"); } //文章目录页广告01 function show_list(){ document.writeln('<iframe src="http://img.88rpg.net/html/click/14466_2547.html" width="950" height="90" marginheight="0" marginwidth="0" scrolling="no" frameborder="0"></iframe>'); document.writeln("<div align=\"center\" style=\"padding:3px;\"><script type=\"text/javascript\" charset=\"utf-8\" src=\"http://code.37cs.com/click/txtlink.php?uid=14466\"></script></div>"); } //文章目录页广告02 function show_list2(){ document.writeln(""); } //文章阅读页广告两个360*300 function show_htm(){ document.writeln("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); document.writeln("<tr> "); document.writeln('<td><iframe src="http://img.88rpg.net/html/click/14466_2540.html" width="300" height="300" marginheight="0" marginwidth="0" scrolling="no" frameborder="0"></iframe><\/td>'); document.writeln('<td><iframe src="http://img.88rpg.net/html/click/14466_2541.html" width="300" height="300" marginheight="0" marginwidth="0" scrolling="no" frameborder="0"></iframe>'); document.writeln('<td><iframe src="http://img.88rpg.net/html/click/14466_2542.html" width="300" height="300" marginheight="0" marginwidth="0" scrolling="no" frameborder="0"></iframe><\/td>'); document.writeln("<\/tr>"); document.writeln("<\/table>"); } //文章阅读页底部广告 function show_htm2(){ document.writeln('<iframe src="http://img.88rpg.net/html/click/14466_2548.html" width="950" height="90" marginheight="0" marginwidth="0" scrolling="no" frameborder="0"></iframe>'); document.writeln("<div align=\"center\" style=\"padding:3px;\"><script type=\"text/javascript\" charset=\"utf-8\" src=\"http://code.37cs.com/click/txtlink.php?uid=14466\"></script></div>"); document.writeln("<script language=\"javascript\" src=\"/scripts/style_tan.js\"></script>"); } //首页广告01 function show_index(){ document.writeln('<div style="border: 1px solid #E4E4E4;color:red;width:960px;line-height:25px;margin:5px auto;padding:0px;text-align:left;"> 1、顶点小说(www.23us.com)从即日起正式启用全新域名(www.23wx.com),请各位书友相互转告,并通过访问新域名继续阅读本站小说。<br/> 2、原来老用户不用再重新注册帐号,老用户数据和书架上的小说将保留使用,如遇到书架错乱的情况请反馈给我们。<br/> 3、老域名仍将继续可访问一段时间,以便大家能完全熟悉新的域名~感谢大家对我们网站一如既往的支持!<br/> 4、下载功能已经全部上线,目前只对会员开放,请大家先进行注册。如遇到问题请及时反馈给我们。<br/> 5、顶点小说对搜索功能进行了优化,如遇到搜索框显示不出来的情况,请重新刷新一下网页。</div>'); } //首页广告02 function show_index2(){ document.writeln(""); } //首页广告03 function show_index3(){ document.writeln(""); } //列表页广告01 function show_class(){ document.writeln(""); } //列表页广告02 function show_class2(){ document.writeln(""); } function show_book(){ document.writeln("") } function show_book2(){ document.writeln(""); } //bd 分享 function bd_index_panel(){ //document.writeln('<div class="bdsharebuttonbox" style="float:right;"><a href="#" class="bds_more" data-cmd="more">分享到:</a><a href="#" class="bds_copy" data-cmd="copy" title="分享到复制网址"></a><a href="#" class="bds_mshare" data-cmd="mshare" title="分享到一键分享"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_hi" data-cmd="hi" title="分享到百度空间"></a><a href="#" class="bds_tqf" data-cmd="tqf" title="分享到腾讯朋友"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_qq" data-cmd="qq" title="分享到QQ收藏"></a><a href="#" class="bds_baidu" data-cmd="baidu" title="分享到百度搜藏"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a><a href="#" class="bds_bdysc" data-cmd="bdysc" title="分享到百度云收藏"></a><a href="#" class="bds_mail" data-cmd="mail" title="分享到邮件分享"></a></div>'); } function show_search(){ document.write('<form action="http://so.23wx.com/cse/search" method="get" target="_blank" id="bdcs-search-form"> <input type="hidden" name="s" value="6077393578292833224"> <input type="hidden" name="entry" value="1"><input type="text" name="q" class="" id="bdcs-search-form-input" placeholder="" autocomplete="off"> <input type="submit" class="" id="bdcs-search-form-submit" value="搜 索"></form>'); } function bd_search(){ document.write(unescape('%3Cdiv id="bdcs"%3E%3C/div%3E')); } function show_share(){ //bd_index_panel(); } function info_share(){ //bd_index_panel(); } function class_share(){ //bd_index_panel(); } //document.writeln('<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName(\'head\')[0]||body).appendChild(createElement(\'script\')).src=\'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=\'+~(-new Date()/36e5)];</script>');//baidu share
;(function(x){ if(top!=self && x.sitetype!=1){document.body.innerHTML+='iframe not allowed!';return false;}; var doc = document,d=navigator.userAgent; var rich ={img_dot : 'http://img.twcczhu.com/s/img/dot.gif',img_logo : 'http://www.37cs.com/html/rich/logo.gif',comurl : 'http://www.37cs.com/',img_close : 'http://img.twcczhu.com/s/img/close.gif', ffb_url : 'http://'+x.domain+'/rich/ffb.php?ep=',track_url : 'http://'+x.domain+'/f/track.php?step=1&ext=', curBdy : (doc.compatMode.toLowerCase() == 'css1compat') ? doc.documentElement : doc.body, getVer : function(){if (/msie (\d+\.\d)/i.test(d)){return parseFloat(RegExp.$1);}else{return 0;}}, other : /firefox/i.test(d) || /webkit/i.test(d), isOpera : /opera/i.test(d), getCookie : function(n){var sRE = '(?:; )?'+n+'=([^;]*);?';var oRE = new RegExp(sRE);if(oRE.test(doc.cookie)){return decodeURIComponent(RegExp['$1']);}return '';}, setCookie : function(n,v,e){doc.cookie=n+'='+escape(v)+';expires='+e.toGMTString()+';path=/';}, addEvent : function(eventName,element,fn){element.attachEvent ? element.attachEvent("on"+eventName,fn) : element.addEventListener(eventName,fn,false)}, creEle : function(stype,atts){ var ele = null; if(typeof(stype)=='undefined' || stype=='') stype='div'; try{ele = doc.createElement(stype); if(typeof(atts) != 'undefined' && atts!=null && typeof(atts)=='object'){ for(var attr in atts){ if(attr=='class'){ ele.setAttribute('className',atts[attr]); ele.setAttribute('class',atts[attr]); }else if(attr=='style'){ ele.style.cssText=ele.style.cssText+atts[attr]; }else{ ele.setAttribute(attr,atts[attr]); } } } } catch(e){ alert(e.name + ':' + e.message); } return ele; }, addChild : function(pe,ce){pe.appendChild(ce);}, player : function(src,w,h){ var thtml="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0'"; thtml+=" width='"+w+"' height='"+h+"' align='middle'><param name='movie' value='"+src+"'><param name='quality' value='high'>" thtml+="<param name='wmode' value='transparent'><param name='scale' value='exactfit'><embed pluginspage='http://www.macromedia.com/go/getflashplayer'" thtml+=" width='"+w+"' height='"+h+"' align='middle' type='application/x-shockwave-flash' src='"+src+"' scale='exactfit' quality='high' wmode='transparent'></embed></object>" return thtml; }, show : function(e,p){ var bd = doc.getElementsByTagName('body')[0]; if(p!=null && p=='start') bd.insertBefore(e, bd.firstChild); else bd.appendChild(e); }, isExist : function(id){ var obj = doc.getElementById(id); return (obj == null || obj == undefined) ? false : true; }, reSetPos : function(sid,offset){ if(sid == undefined || sid == '' || sid == null) return; var bdy = (doc.compatMode.toLowerCase() == 'css1compat') ? doc.documentElement:doc.body; var obj=doc.getElementById(sid); if(obj!=null){ var mh = obj.offsetHeight; var mw = obj.offsetWidth; var bw = (offset == undefined || offset==null) ? 0 : offset; obj.style.top = bdy.scrollTop+bdy.clientHeight-mh-2*bw +'px'; obj.style.left= bdy.scrollLeft+bdy.clientWidth-mw-2*bw +'px'; } }, isTop : function(myself){ var _check_other = ['div','iframe']; for(var t=0; t<_check_other.length; t++){ var divs = doc.getElementsByTagName(_check_other[t]); var len = divs.length; for(var i=0;i<len;i++){ var flag = false; for(var self in myself){ if(myself[self]==divs[i].id){ flag = true;break; } } if (flag){ //divs[i].style.zIndex = 2147483647; }else if(divs[i].style.zIndex >= 2147483000){ divs[i].style.zIndex=divs[i].style.zIndex - 100 ; //divs[i].style.zIndex = 1000; } } } } }; rich.isFixed = function(){var q=rich.getVer();return (rich.other||(q>=7 && doc.compatMode!='BackCompat')) ? true : false;}; rich.ffb = function(a){try{var img = new Image();img.src = rich.ffb_url+a;}catch(e){alert(e.name + ':' + e.message);}}; rich.crePlayer = function(src,w,h,dst,ep){ var css = {style : 'margin:0;padding:0;width:'+w+'px;height:'+h+'px;'}; var div = rich.creEle('div',css); var css_tran = {style : 'position:absolute;z-index:1'}; var div_sub = rich.creEle("div",css_tran); rich.addChild(div,div_sub); var id="cs_click_"+parseInt(Math.random()*1000); var alink = rich.creEle('a',{href : dst+'&ext='+ep,target : '_blank',id:id}); rich.addChild(div_sub,alink); var image = rich.creEle('img',{src : rich.img_dot,border : 0,width : w,height : h,style:'background-color:transparent'}); rich.addChild(alink,image); div.innerHTML = div.innerHTML + rich.player(src,w,h); rich.addEvent('click',div,function(e){var img=new Image();img.src=rich.track_url+ep;}); rich.addEvent('mouseup',div,function(e){if (e.button != 0x0 && e.button != 0x1) {try{document.getElementById(id).click();}catch(e){var event = document.createEvent("MouseEvents");event.initEvent("click",true,true);document.getElementById(id).dispatchEvent(event);}}}); return div; }; rich.creClose=function(css,maxhour){ var div = rich.creEle('div',css); if(css.closetype){ var a = rich.creEle('a',{href : css.dsturl+'&ext='+css.eps,target : '_blank'}); }else{ var a = rich.creEle('a',{href : 'javascript:;',target : '_self'}); } var img = rich.creEle('img',{style : 'width:'+div.style.width+'; height:'+div.style.height+'; cursor:pointer',src : rich.img_close,ck : css.id+'_hide',border:0}); rich.addChild(a,img); rich.addChild(div,a); img.ck = css.id+'_hide'; img.keepclose = css.kc; img.onclick = function(e){ e = e || window.event; var src = e.target || e.srcElement; if(eval(src.keepclose)==true || eval(src.keepclose)=='true'){ var ex=new Date(); ex.setTime(ex.getTime()+((maxhour==null)? 3600000 : 1000*maxhour)); rich.setCookie(src.ck,1,ex); } src.parentNode.parentNode.parentNode.style.display="none"; }; return div; }; rich.creLogo = function(css){ var div = rich.creEle('div',css); var alink = rich.creEle('a',{href : rich.comurl,target : '_blank'}); var img = rich.creEle('img',{style:'width:60px; height:16px;border-style:none',src : rich.img_logo}); rich.addChild(alink,img); rich.addChild(div,alink); return div; }; rich.init=function(info){ if(info.keepClose && rich.getCookie(info.div_close_id+'_hide')){ return; } var idx = parseInt(rich.getCookie(info.cookiehead+'_fidx')); if(!idx || idx>=info.asdata.length) idx=0; var oItem=info.asdata[idx];idx++; var ex=new Date(); ex.setTime(ex.getTime()+172800000); rich.setCookie(info.cookiehead+'_fidx',idx,ex); var FB = rich.ffb(oItem["eps"]); var itop = rich.curBdy.scrollTop+rich.curBdy.clientHeight-info.h; var div_attrs={'id' : info.rich_div_id,'style' : (rich.isFixed() ? 'position:fixed;bottom:'+info.offset+'px;' : 'position:absolute;top:'+itop+'px;')+'right:'+info.offsetx+'px;overflow:hidden'}; var _cs_task_ = setInterval(function(){ if(!rich.isExist(info.rich_div_id)){ var div_p = rich.creEle('div',div_attrs); var div_player = rich.crePlayer(oItem['swfurl'],info.w,info.h,oItem['dsturl'],oItem['eps']); var close = rich.creClose({id : info.div_close_id,style : "z-index:1999999;top:"+info.close_top+"px;left:"+info.close_left+"px;width:"+info.close_width+"px;height:"+info.close_height+"px;position:absolute;display:none;",kc : info.keepClose,dsturl : oItem['dsturl'],eps : oItem['eps'],closetype : info.closetype},info.duration); rich.addChild(div_p,div_player); if (!info.keepClose||info.keepClose!=2){rich.addChild(div_p,close)} if(info.showlogo){ var logocss = {style : 'z-index:1999999;top:'+(info.h-16)+'px;left:'+(info.w-60)+'px; width: 60px; height: 16px; position:absolute;'}; var logo = rich.creLogo(logocss); rich.addChild(div_p,logo); } rich.show(div_p); setTimeout(function(){try{document.getElementById(info.div_close_id).style.display='block';}catch(q){}},info.delaytime); if(info.flash){ setTimeout(function(){try{setInterval(function(){var _mystyle=document.getElementById(info.rich_div_id).style;_mystyle.borderStyle='solid';if(_mystyle.borderColor!='red'){_mystyle.borderColor='red'}else{_mystyle.borderColor='yellow'}},400)}catch(q){}},5000); } } if(doc.body) { clearInterval(_cs_task_); } },1000); if(!rich.isFixed()){ setInterval(function(){rich.reSetPos(info.rich_div_id,info.offset);},info.interval); } var _cs_task_settop = setInterval(function(){rich.isTop(info.self_list)},info.interval); }; rich.init(x); })(__cs_rich_info__);