﻿function SBuilder(a){this.strings=new Array("");this.append(a)}SBuilder.prototype.append=function(a){if(a){this.strings.push(a)}return this};SBuilder.prototype.toString=function(){return this.strings.join("")};var domainName=".qidian.com";if(document.location.href.toLowerCase().indexOf("qidianmm.com")>0){document.domain="qidianmm.com"}if(document.location.href.toLowerCase().indexOf("qdmm.com")>0){document.domain="qdmm.com"}if(document.location.href.toLowerCase().indexOf("qidian.com")>0){document.domain="qidian.com"}var tophref,thishref;try{tophref=top.location.href.toLowerCase();thishref=this.location.href.toLowerCase()}catch(e){}if(this!=top&&tophref!=null&&tophref.indexOf("localhost")<0||thishref!=null&&thishref.indexOf("localhost")<0||top.location.href.toLowerCase().indexOf("qidianmm.com")<0||top.location.href.toLowerCase().indexOf("qdmm.com")<0){try{if(this!=top&&top.location.href.toLowerCase().indexOf("qidian.com")<0&&top.location.href.toLowerCase().indexOf("qidianmm.com")<0&&top.location.href.toLowerCase().indexOf("qdmm.com")<0){top.location.href="http://www.qidian.com"}}catch(e){}if(this.location.href.toLowerCase().indexOf("qidian.com")<0&&top.location.href.toLowerCase().indexOf("qidianmm.com")<0&&top.location.href.toLowerCase().indexOf("qdmm.com")<0){top.location.href="http://www.qidian.com"}}String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};String.prototype.FormatSingleQuotation=function(){var a=new RegExp("'","g");return this.replace(a,"\\'")};String.prototype.trimEnd=function(a){var b=new RegExp(a+"*$","g");return this.replace(b,"")};String.prototype.len=function(){return this.replace(/[^\x00-\xff]/g,"aa").length};String.prototype.cformat=function(){var a=this;for(var b=0;b<arguments.length;b++){var c=new RegExp("\\{"+(b)+"\\}","gm");a=a.replace(c,arguments[b])}return a};function StringBuilder(a){this.strings=new Array("");this.append(a)}StringBuilder.prototype.append=function(a){if(a){this.strings.push(a)}};StringBuilder.prototype.clear=function(){this.strings.length=1};StringBuilder.prototype.toString=function(){return this.strings.join("")};if(!String._FORMAT_SEPARATOR){String._FORMAT_SEPARATOR=String.fromCharCode(31);String._FORMAT_ARGS_PATTERN=new RegExp("^[^"+String._FORMAT_SEPARATOR+"]*"+new Array(100).join("(?:.([^"+String._FORMAT_SEPARATOR+"]*))?"))}if(!String.format){String.format=function(a){return Array.prototype.join.call(arguments,String._FORMAT_SEPARATOR).replace(String._FORMAT_ARGS_PATTERN,a)}}if(!"".format){String.prototype.format=function(){return(String._FORMAT_SEPARATOR+Array.prototype.join.call(arguments,String._FORMAT_SEPARATOR)).replace(String._FORMAT_ARGS_PATTERN,this)}}function checkLoginByCookie(){var a="AUTHTEST";if(window.location.href.toLowerCase().indexOf("qidian.com")>-1){a="cmfuToken"}if(window.location.href.toLowerCase().indexOf("qidianmm.com")>-1){a="cmfuToken"}if(window.location.href.toLowerCase().indexOf("qdmm.com")>-1){a="cmfuToken"}if((GetCookie(a)!=null&&GetCookie(a).length>0)){return true}else{if(GetCookie("cmfu_al")!=null&&GetCookie("cmfu_al").length>0){return true}}return false}function getUrlParam(b){var c=new RegExp("(^|&)"+b+"=([^&]*)(&|$)","i");var a=window.location.search.substr(1).match(c);if(a!=null){return unescape(a[2])}else{return null}}function CheckPostFromCookie(g,c,h){var a=getUrlParam(g);var d=GetCookie(g);if(d!=null&&a!=null&&d==a){var f=new Date();var b=new Date(GetCookie("pTime"));if(parseInt(Math.abs(f-b)/1000)<=c){alert("您发帖速度太快了, 先休息一会吧.");return false}}return true}function SetPostCookie(b,c){var a=getUrlParam(b);SetCookie(b,a);SetCookie("pTime",new Date());SetCookie("content",c)}function $(objName){if(document.getElementById){return document.getElementById(objName)}else{if(document.layers){return eval("document.layers['"+objName+"']")}else{return eval("document.all."+objName)}}}function eventBind(b,c,a){if(b.addEventListener){b.addEventListener(c,a,false)}else{if(b.attachEvent){b.attachEvent("on"+c,a)}}}function DateAdd(h,m,j){var b=new Date(h.replace("-",","));var c=1;var f=c*1000;var a=f*60;var g=a*60;var d=g*24;var k=d*365;var l;var i=new Date(b);var i=i.valueOf();switch(j){case"ms":l=new Date(i+c*m);break;case"s":l=new Date(i+f*m);break;case"mi":l=new Date(i+a*m);break;case"h":l=new Date(i+g*m);break;case"d":l=new Date(i+d*m);break;case"y":l=new Date(i+k*m);break;default:return escape("日期格式不对")}l=new Date(l);return l.getFullYear()+"-"+(l.getMonth()+1)+"-"+l.getDate()}Date.prototype.AddDays=function(k){var b=this;var c=1;var f=c*1000;var a=f*60;var h=a*60;var d=h*24;var i=d*365;var j;var g=new Date(b);var g=g.valueOf();j=new Date(g+d*k);j=new Date(j);return j};function SetCookie(f,c){var j=SetCookie.arguments;var a=SetCookie.arguments.length;var d=(a>2)?j[2].toGMTString():null;var i=(a>3)?j[3]:null;var b=(a>4)?j[4]:null;var g=(a>5)?j[5]:false;var h=f+"="+escape(c)+";";if(d!=null){h+=" expires="+d+";"}if(i!=null){h+=" path="+i+";"}if(b!=null){b+=" domain="+b+";"}if(g!=null){g+=" secure="+g+";"}document.cookie=h}function GetCookie(a){var b=document.cookie;var c=b.indexOf(a+"=");if(c==-1){return null}c+=a.length+1;var d=b.indexOf(";",c);if(d==-1){return unescape(b.substring(c))}return unescape(b.substring(c,d))}function GetAdSettingCookie(a){var b=document.cookie;var c=b.indexOf(a+"=");if(c==-1){return null}c+=a.length+1;var d=b.indexOf(";",c);if(d==-1){return decodeURIComponent(b.substring(c))}return decodeURIComponent(b.substring(c,d))}function ShowConditionAd(d,c,j,g,a,o,m,k,b,n){var f=false;var l;var i=GetAdSettingCookie("userInfoForAd");if(typeof(i)!="undefined"&&i!=null){l=i.split(",");if(l.length==4){if((g=="无"||g.indexOf(l[0])>=0)&&(m=="无"||m==l[1])&&((k==0&&b==0)||(b>l[2]&&k<=l[2]))&&(n==-1||n==cSetting[3])){f=true}}}if(typeof(JChannelId)!="undefined"){if(a!="无"&&a.indexOf(JChannelId)>=0){f=true}}if(typeof(JBookId)!="undefined"){if(o!="无"&&o.indexOf(JBookId)>=0){f=true}}if(j==1){var h;if(f==true){h="QidianBackPop"+d}else{h="QidianBackPop"+c}ExcutePop(h)}else{if(f==true){document.getElementById(d).style.display="";document.getElementById(c).style.display="none"}else{document.getElementById(d).style.display="none";document.getElementById(c).style.display=""}}}function TextBoxOnFocus(a,b){if(a.value==b){a.value=""}}function TextBoxOnBlur(a,b){if(a.value.replace(/(^[\s]*)|([\s]*$)/g,"")==""){a.value=b}}function UploadImage(b,c,a,d,f){var g=window.open(uploadURL+"?clientImageId="+b+"&imageurl="+c+"&uploadUrl="+a+"&clientHddImageId="+d+"&imagename="+document.getElementById(d).value+"&realimagename="+f,"","menubar=no,width=450,height=240,resizeable=no","");return false}function ChangeImage(b,a,f,d){if(f!=null){var c=Math.random();document.getElementById(b).src=a+f+"?"+c;document.getElementById(d).value=f}}function GetCurrentRawUrl(){var a=document.location.href;var b=document.location.host;a=a.replace(b,"");a=a.replace("http://","");return escape(a)}function MultiSendWin(c,a){var b=window.open(uploadURL+"?subject="+c+"&content="+a,"","menubar=no,width=480,height=550,resizeable=no","");return false}function Invite2ClubWin(a){var b=window.open(invite2ClubURL+"?nickName="+a,"","menubar=no,width=500,height=400,resizeable=no","");return false}function SpaceSendMsg(a){var b=window.open(spaceSendMsgURL+"?toUserId="+a,"","menubar=no,width=500,height=400,resizeable=no","");return false}function startmarquee(h,c,d){var g=false;var f;var b=document.getElementById("marqueebox");b.innerHTML+=b.innerHTML;b.style.marginTop=0;b.onmouseover=function(){g=true};b.onmouseout=function(){g=false};function i(){f=setInterval(a,c);if(!g){b.style.marginTop=parseInt(b.style.marginTop)-1+"px"}}function a(){if(parseInt(b.style.marginTop)%h!=0){b.style.marginTop=parseInt(b.style.marginTop)-1+"px";if(Math.abs(parseInt(b.style.marginTop))>=b.scrollHeight/2){b.style.marginTop=0}}else{clearInterval(f);setTimeout(i,d)}}setTimeout(i,d)}function HideObject(a){$(a).style.display="none"}function ShowObject(a){$(a).style.display=""}function IsHide(a){if($(a).style.display==""){return false}else{if($(a).style.display=="none"){return true}}}function ShowServerMessage(result){eval(result.value)}function KeydownSubmitForm(a){var b=document.getElementById(a);if(b!=null&&event.keyCode==13){event.returnValue=false;event.keyCode=9;b.click()}}function MDown(a){Obj=a.id;document.all(Obj).setCapture();pX=event.x-document.all(Obj).style.pixelLeft;pY=event.y-document.all(Obj).style.pixelTop}function MMove(){if(Obj!=""){document.all(Obj).style.left=event.x-pX;document.all(Obj).style.top=event.y-pY}}function MUp(){if(Obj!=""){document.all(Obj).releaseCapture();Obj=""}}function LayerClose(a){document.getElementById(a).style.visibility="hidden"}function LayerShow(a,c){var b=document.getElementById(a);b.style.left=screen.width-530;b.style.top=screen.Height-480;b.style.visibility="visible";document.getElementById("lblPrize1").innerHTML=c;document.getElementById("lblPrize2").innerHTML=c;window.setInterval("LayerClose('"+a+"')",15000)}function HideMenu(a){var f=document.getElementById(a);if(f.style.display=="none"){f.style.display=""}else{f.style.display="none"}if(f.style.display==""){var b="M0";for(var c=1;c<=9;c++){var d=b+c;if(d!=a){document.getElementById(d).style.display="none"}}}}function ShowLoginDiv(){var a="";a+="<table border='0' cellpadding='0' cellspacing='0'><tr class='TitleTR'><td align='left'>登录</td><td align='right'>";a+="<span title='关闭' onclick='HideLoginMask();'>×</span></td></tr><tr><td colspan='2'>";a+="<iframe src='/DivUserLogin.aspx' width='225px' height='125px' name='loginFrame' ";a+="id='loginFrame' frameborder='0' scrolling='no'></iframe></td></tr></table>";document.getElementById("DivMask").style.height=document.body.scrollHeight;document.getElementById("DivMask").style.width=document.body.scrollWidth;document.getElementById("DivMask").style.display="block";document.getElementById("DivLogin").style.display="block";document.getElementById("DivLogin").innerHTML=a;ScrollDiv();window.onscroll=ScrollDiv;window.onresize=ScrollDiv;window.onload=ScrollDiv}function $$echo(a){try{console.log(a)}catch(b){}}function ShowLoginMask(){var a=new SBuilder();a.append("<table border='0' cellpadding='0' cellspacing='0'><tr class='TitleTR'><td align='left'>登录</td><td align='right'>");a.append("<span onclick='HideLoginMask();' title='关闭'>×</span></td></tr><tr><td colspan='2'>");a.append("<iframe src='/DivUserLogin.aspx' width='225px' height='125px' name='loginFrame' ");a.append("id='loginFrame' frameborder='0' scrolling='no'></iframe>");a.append("</td></tr></table>");document.getElementById("DivMask").style.height=document.body.scrollHeight;document.getElementById("DivMask").style.width=document.body.scrollWidth;document.getElementById("DivMask").style.display="block";document.getElementById("DivLogin").style.display="block";document.getElementById("DivLogin").innerHTML=a.toString();ScrollDiv();window.onscroll=ScrollDiv;window.onresize=ScrollDiv;window.onload=ScrollDiv}function HideLoginMask(){$("DivMask").style.display="none";$("DivLogin").style.display="none"}function ScrollDiv(){var g=$("DivLogin");var i=$("AddMark");var c=$("DivMask");var d=$("LoginBar");var b=$("MonthVoteTip");var a=$("VipPlanTipsWin");if(g){var h;var f;if(typeof DivLoginoffsetHeight!="undefined"){h=DivLoginoffsetHeight}else{h=g.clientHeight}if(typeof DivLoginoffsetWidth!="undefined"){f=DivLoginoffsetWidth}else{f=g.clientWidth}g.style.top=((document.documentElement.scrollTop+document.body.scrollTop)+(document.documentElement.clientHeight-h)/2)+"px";g.style.left=((document.documentElement.scrollLeft+document.body.scrollLeft)+(document.documentElement.clientWidth-f)/2)+"px"}if(d){d.style.top=(document.body.scrollTop+(document.body.clientHeight-d.offsetHeight)-3)+"px";d.style.left=(-3)+"px";d.style.width=(document.body.clientWidth-2)+"px";document.body.focus()}if(i){i.style.top=document.body.clientHeight+document.body.scrollTop-200;i.style.left=document.body.clientWidth-56;i.style.display="";if(b){b.style.top=(getPosition(i).y-i.offsetHeight)+"px"}}if(a){a.style.top=(document.body.clientHeight+document.body.scrollTop-200)+"px"}}function AutoScroll(){eventBind(window,"load",ScrollDiv);eventBind(window,"resize",ScrollDiv);eventBind(window,"scroll",ScrollDiv)}function CheckInteger(){if(event.keyCode<45||event.keyCode>57){event.keyCode=0}}function getPosition(b){for(var a=0,c=0;b!=null;a+=b.offsetLeft,c+=b.offsetTop,b=b.offsetParent){}return{x:a,y:c}}function subString(d,b,k){var g=0;var f="";var c=/[^\x00-\xff]/g;var h="";var j=d.replace(c,"**").length;for(var a=0;a<j;a++){h=d.charAt(a).toString();if(h.match(c)!=null){g+=2}else{g++}if(g>b){break}f+=h}if(k&&j>b){f+="..."}return f}function GetStringLength(a){return a.replace(/[^\x00-\xff]/g,"**").length}function addMark(a,b){try{if(window.sidebar){window.sidebar.addPanel(a,b,"")}else{if(document.all){window.external.AddFavorite(b,a)}else{if(window.opera&&window.print){return true}}}}catch(c){alert("您的浏览器安全设置不允许该项操作")}}function AdLinkAct(b){var a;try{a=GetCookie("rk");if(a!=null&&a!=""){MyAjax.UseAdLinkView(b,AfterUseAdLinkView)}}catch(c){}}function AfterUseAdLinkView(a){}ie=((navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)>=4));function playSwf(b,a){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" style=\''+a+'\'><param name="movie" value="'+b+'"><param name=\'wmode\' value=\'transparent\'><param name="quality" value="high"><embed src="'+b+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" style=\''+a+"'></embed></object>")}var __matchedforbid=new Array();function capForbidText(a){__matchedforbid.push(a);return"□"}function ReplaceForbidKeyword(b){if(typeof __forbidKeywords=="undefined"||__forbidKeywords==null||__forbidKeywords==""){return b}var a=new RegExp("("+unescape(__forbidKeywords)+")","gim");return b.replace(a,capForbidText)}function CheckUserIP(){var a;var b=GetCookie("cui");if(b==null||b==""){if(typeof MyAjax!="undefined"){MyAjax.GetUserIP(SetUserIP)}return false}a=parseInt(b)%16777216;a=parseInt(a)-parseInt(a)%65536;a=parseInt(a)/65536;return true}function SetUserIP(f){var a=f.value;var b=new Array();var d;var c=new Date();if(c.getHours()<23){c.setHours(c.getHours()+1)}else{c.setDate(c.getDate()+1)}if(a!=null&&a!=""){b=a.split(".");if(b.length>=4){d=parseInt(b[0])*16777216+parseInt(b[1])*65536+parseInt(b[2])*256+parseInt(b[3]);SetCookie("cui",d,c)}}}function MM_swapImgRestore(){var d,b,c=document.MM_sr;for(d=0;c&&d<c.length&&(b=c[d])&&b.oSrc;d++){b.src=b.oSrc}}function MM_preloadImages(){var f=document;if(f.images){if(!f.MM_p){f.MM_p=new Array()}var b,g=f.MM_p.length,c=MM_preloadImages.arguments;for(b=0;b<c.length;b++){if(c[b].indexOf("#")!=0){f.MM_p[g]=new Image;f.MM_p[g++].src=c[b]}}}}function MM_findObj(a,c){var g,b,f;if(!c){c=document}if((g=a.indexOf("?"))>0&&parent.frames.length){c=parent.frames[a.substring(g+1)].document;a=a.substring(0,g)}if(!(f=c[a])&&c.all){f=c.all[a]}for(b=0;!f&&b<c.forms.length;b++){f=c.forms[b][a]}for(b=0;!f&&c.layers&&b<c.layers.length;b++){f=MM_findObj(a,c.layers[b].document)}if(!f&&c.getElementById){f=c.getElementById(a)}return f}function MM_swapImage(){var d,f=0,b,c=MM_swapImage.arguments;document.MM_sr=new Array;for(d=0;d<(c.length-2);d+=3){if((b=MM_findObj(c[d]))!=null){document.MM_sr[f++]=b;if(!b.oSrc){b.oSrc=b.src}b.src=c[d+2]}}}function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3){with(document){if(getElementById&&((obj=getElementById(args[i]))!=null)){v=args[i+2];if(obj.style){obj=obj.style;v=(v=="show")?"visible":(v=="hide")?"hidden":v}obj.visibility=v}}}}function ReplaceUnsafeKeyword(c){var a="•";var b=new RegExp("("+a+")","gim");c=c.replace(b,"");a="&#\\d+";b=new RegExp("("+a+")","gim");return c.replace(b,function(d){return"&amp;#"+d.substring(2)})}function findPosY(b){var a=0;if(b&&b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b&&b.y){a+=b.y}}return a}function findPosX(b){var a=0;if(b&&b.offsetParent){while(b.offsetParent){a+=b.offsetLeft;b=b.offsetParent}}else{if(b&&b.x){a+=b.x}}return a}function AttachScriptAd(a){var b=document.getElementById("div_"+a);if(b==null){return}if(window.addEventListener){b.addEventListener("click",MyAjax.SendAdClick(a,null),false)}else{b.attachEvent("onclick",function(){MyAjax.SendAdClick(a,null)})}}var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];var FFextraHeight=getFFVersion>=0.1?16:0;function dyniframesize(iframename){var pTar=null;if(document.getElementById){pTar=document.getElementById(iframename)}else{eval("pTar = "+iframename+";")}if(pTar&&!window.opera){pTar.style.display="block";if(pTar.contentDocument&&pTar.contentDocument.body.offsetHeight){pTar.height=pTar.contentDocument.body.offsetHeight+FFextraHeight}else{if(pTar.Document&&pTar.Document.body.scrollHeight){pTar.height=pTar.Document.body.scrollHeight}}}}function stopDefault(a){a=a||window.event;if(a&&a.preventDefault){a.preventDefault()}else{window.event.returnValue=false}return false};