if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a,b){var c=this.length;b=Number(b)||0;b=b<0?Math.ceil(b):Math.floor(b);if(b<0)b+=c;for(;b<c;b++)if(b in this&&this[b]===a)return b;return-1};
var Thistory={eventFunction:null,currentHash:document.location.hash,init:function(){var a;if(window.ActiveXObject){if(Thistory.currentHash==="")Thistory.currentHash="#";a=document.createElement("iframe");a.setAttribute("id","pIEHistory");a.style.display="none";document.body.insertBefore(a,document.body.firstChild);a=a.contentWindow.document;a.open();a.close();a.location.hash=Thistory.currentHash;window.scroll(0,0)}Thistory.eventFunction=window.onHashchange;Thistory.eventFunction(Thistory.currentHash.replace(/^#/,
""));setInterval(Thistory.__check,200)},__check:function(){var a=window.ActiveXObject?document.getElementById("pIEHistory").contentWindow.document.location.hash:document.location.hash;if(a!==Thistory.currentHash){if(window.ActiveXObject)document.location.hash=a;Thistory.currentHash=a;Thistory.eventFunction(a.replace(/^#/,""))}},register:function(a){a=a.href.replace(/^\S*#/,"");var b;if(window.ActiveXObject){b=document.getElementById("pIEHistory");b=b.contentWindow.document||b.contentDocument;b.open();
b.close();b.location.hash="#"+a}},__onRegister:function(){for(var a=document.getElementsByTagName("a"),b,c=0,d=a.length;c<d;c++){b=a[c];if(b.getAttribute("rel")==="ajaxlink")b.attachEvent?b.attachEvent("onclick",Thistory.register):b.addEventListener("click",Thistory.register,false)}}},Tcookie={set:function(a,b){var c=new Date;c.setTime(c.getTime()+6048E5);document.cookie=a+"="+escape(b)+"; path=/; expires="+c.toGMTString()},get:function(a){var b,c,d=0,e=0,f;b=" "+document.cookie+";";for(var k=b.length;d<
k;){e=b.indexOf(";",d);c=b.substring(d+1,e);f=c.indexOf("=");if(c.substring(0,f)===a)return unescape(c.substring(f+1,e-d-1));d=e+1}return""}},Tthread={gotPost:[],isIE:function(){if(document.all&&window.ActiveXObject){document.styleSheets["page-skin-1"].cssText+=".reply { display: inline ; zoom: 1; }";return true}else return false}(),showMore:function(a){$("div#ThreadPost_"+a+" > div.quote > span").each(function(){if(this.className==="content")this.className="";if(this.id==="More_"+a)this.className=
"hidden"})},showMore2:function(a,b){$("div#"+a+" > div.quote > div.jump-link").append('<img src="http://scribe.chkkk.idv.tw/ajax-loading.gif" />');$.get(b,function(c){$("div#"+a+" > div.quote").html($("<div />").append(c.replace(/<script(\S|\s)*?\/script>/gi,"")).find("div.quote:first").find('span[id^="More_"]').remove().end().html())})},switchThread:function(a){if(a!==null){$("div[id^=ThreadPost_]").not("#ThreadPost_"+a).attr("class","hidden");$("div#ThreadPost_"+a).attr("class","shown")}else $("div[id^=ThreadPost_]").attr("class",
"shown")},getComments:function(a,b){if(Tthread.gotPost[b]!==true){$("div#Comment_"+b).append('<img src="http://scribe.chkkk.idv.tw/ajax-loading.gif" />');$.ajax({url:a,type:"GET",complete:function(c,d){if(d==="success"||d==="notmodified")$("div#Comment_"+b).hide().html($("<div />").append(c.responseText.replace(/<script(\S|\s)*?\/script>/gi,"")).find("div#Comment_"+b)).each(function(){Tthread.commentProcess(b)}).slideDown("slow")}});Tthread.gotPost[b]=true}},commentProcess:function(a){$("#Comment_"+
a+" div").each(function(){if(this.className==="quote")this.innerHTML=this.innerHTML.replace(/(^|<br\/?>)((?:&gt;|>|\uff1e)[\S\s]*?)(?=<br\/?>|$)/gi,'$1<span class="qlight">$2</span>');Tthread.isIE&&this.className==="reply"&&this.insertAdjacentHTML("afterEnd","<br />")})},triggerMoreArticles:function(a){a=a[Math.floor(Math.random()*a.length)];var b=document.createElement("script");b.src="/feeds/posts/summary/-/"+a+"?alt=json-in-script&callback=Tthread.showMoreArticles&max-results=25";document.getElementById("MoreArticles").appendChild(b)},
showMoreArticles:function(a){a=a.feed.entry;var b=[],c,d=document.getElementById("MoreArticles"),e="",f="",k=location.href.replace(/\.html\S*/,".html"),l=5,g=a.length;if(!(g===0||g===1)){for(c=0;c<g;b[c]=c++);(function(j,o){for(var p,m,h=0;h<o-1;m=parseInt(Math.random()*(o-h))+h,p=j[h],j[h++]=j[m],j[m]=p);})(b,g);if(g<l)l=g;e+='<div class="reply" id="rMoreArti"><input type="checkbox" name="MoreArti" value="delete" />&nbsp;<span class="name">\u5176\u4ed6\u76f8\u95dc\u6587\u7ae0</span> [\u7cfb\u7d71\u81ea\u52d5\u7522\u751f]&nbsp;<div class="quote"><ul>';
for(var n=0;n<g;n++){c=b[n];for(var i=0,q=a[c].link.length;i<q;i++)if(a[c].link[i].rel==="alternate"&&a[c].link[i].type==="text/html"){f=a[c].link[i].href;break}if(f!==k){e+="<li>"+a[c].title.$t.link(f)+"</li>";if(--l<=0)break}}e+="</ul></div></div>";d.innerHTML+=e}}},Tform={check:function(){var a=$("#postform_main").get(0);if(!a.postBody.value){alert("\u8acb\u5beb\u5165\u5167\u6587");a.postBody.focus();return false}if(a.anonURL.value==="http://")a.anonURL.value="";Tcookie.set("anonName",a.anonName.value);
Tcookie.set("anonURL",a.anonURL.value);return true},load:function(){var a=Tcookie.get("anonName"),b=Tcookie.get("anonURL"),c=$("#postform_main").get(0);if(a)c.anonName.value=a;if(b)c.anonURL.value=b},show:function(a,b){$("#postform").attr("class","shown");$("#postform_main").get(0).postID.value=b;Tthread.switchThread(b);$("#ThreadPost_"+b+" div.jump-link").length?Tthread.showMore2("ThreadPost_"+b,a):Tthread.showMore(b);a!==null&&Tthread.gotPost[b]!==true&&Tthread.getComments(a,b);a===null&&Tthread.commentProcess(b)},
hide:function(){$("#postform").attr("class","hidden");Tthread.switchThread(null)},getTrip:function(){var a=$("#postform_main").get(0).anonName;if(a.value.match(/(\S*?)?(#|\uff03)(\S*)/g)!==null)a.value=RegExp.$1+"\u25c6"+genTrip(RegExp.$3)}},TdpBlogger={Setting:{Base:"http://scribe.chkkk.idv.tw/dp/14"},Sensor:{Name:"",Interval:null,LibLoaded:[]},Alias:{Cpp:["cpp","c","c++"],CSharp:["c#","c-sharp","csharp"],Css:["css"],Delphi:["delphi","pascal"],Java:["java"],JScript:["js","jscript","javascript"],
Php:["php"],Python:["py","python"],Ruby:["rb","ruby","rails","ror"],Sql:["sql"],Vb:["vb","vb.net"],Xml:["xml","html","xhtml","xslt"],Batch:["batch","dos","bat"]},SyntaxHighlighter:function(a){TdpBlogger.Sensor.Name=a;$("textarea[name="+a+"]").each(function(){this.value=this.value.replace(/<br\s*\/?>|&lt;br\s*\/?&gt;/gi,"");for(var e in TdpBlogger.Alias)if(TdpBlogger.Alias[e].indexOf(this.className)!==-1){TdpBlogger.Sensor.LibLoaded.push(e);delete TdpBlogger.Alias[e];break}});a=TdpBlogger.Sensor.LibLoaded.length;
if(a!==0){TdpBlogger.Sensor.LibLoaded.unshift("Core");for(var b=document.getElementsByTagName("head")[0],c=0;c<a+1;c++){var d=document.createElement("script");d.type="text/javascript";d.src=TdpBlogger.Setting.Base+"/sh"+(c>0?"Brush":"")+TdpBlogger.Sensor.LibLoaded[c]+".js";b.appendChild(d)}TdpBlogger.Sensor.Interval=setInterval(TdpBlogger.executeSyntaxHighlighter,1E3)}},executeSyntaxHighlighter:function(){if(typeof dp==="undefined")return false;for(var a in TdpBlogger.Sensor.LibLoaded)typeof dp.sh.Brushes[TdpBlogger.Sensor.LibLoaded[a]]===
"function"&&TdpBlogger.Sensor.LibLoaded.splice(a,1);if(TdpBlogger.Sensor.LibLoaded.join("")==="Core"){clearInterval(TdpBlogger.Sensor.Interval);dp.SyntaxHighlighter.HighlightAll(TdpBlogger.Sensor.Name)}}},Tblog={search:function(){var a=prompt("\u8acb\u8f38\u5165\u4f60\u60f3\u8981\u641c\u5c0b\u7684\u5b57\u8a5e\u3002Please input the word you want to search for.","");if(a!==null)location.href="/search?q="+encodeURIComponent(a);return false},toggleSidebar:function(){var a=$("div#sidebar"),b=$("div#threads");
if(a.get(0).style.display!=="none")a.animate({opacity:"hide"},"fast","linear",function(){b.attr("class","")});else{b.attr("class","threads");a.fadeIn("slow")}},toggleSidebarExt:function(){$("div#sidebar").animate({left:-200,opacity:"hide"},500).hide();$("div#sidebar-ext").animate({left:70,opacity:"show"},500).show()},toggleSidebarExt2:function(){$("div#sidebar").animate({left:70,opacity:"show"},500).show();$("div#sidebar-ext").animate({left:-550,opacity:"hide"},500).hide()},imageOpenNewWindow:function(){$("div[id^=ThreadPost] > div.quote a").not("[href=#]").each(function(){if(this.href.match(/\.(gif|jpg|png)$/i))this.target=
"_blank"})},bindFunction:function(){$("div.jump-link > a").live("click",function(){Tthread.showMore2(this.parentNode.parentNode.parentNode.id,this.href);return false})},initialize:function(){(new Image).src="http://scribe.chkkk.idv.tw/ajax-loading.gif";$("div#sidebar-ext").css("left","-550px");Tblog.bindFunction();Thistory.init();TdpBlogger.SyntaxHighlighter("code");Tblog.imageOpenNewWindow()}};
window.onHashchange=function(a){switch(a){case "":typeof DONTHIDE==="undefined"&&Tform.hide();break;case "NONE":break;default:}};