
(function(){var islog=/log/.test(location.pathname);var isindexX=/index/.test(location.pathname);if(islog){return false;}
var domain="http://"+location.hostname
var curPage=1;if(isindexX){curPage=parseFloat(location.pathname.match(/[0-9]+/));}
var loading=false;var div=document.createElement("div");var xmlHttp;var url=domain+"/index_"+(curPage+1)+".html";var lasttext="";function pageHeight(){return document.body.scrollHeight;}
function scrollY(){var de=document.documentElement;return self.pageYOffset||(de&&de.scrollTop)||document.body.scrollTop;}
function windowHeight(){var de=document.documentElement;return self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;}
window.onscroll=function(){if(curPage>=1&&!loading&&pageHeight()-scrollY()-windowHeight()<windowHeight()/2){loading=true;var waitload=setTimeout(function(){startRequest()},100);pleasewait();}}
function pleasewait(){div.className="please";div.innerHTML="loading more...";document.body.appendChild(div);}
function createXMLHttpRequest(){if(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
else if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();}}
function startRequest(){createXMLHttpRequest();xmlHttp.onreadystatechange=doit;xmlHttp.open("get",url);xmlHttp.send(null);}
function doit(){if(xmlHttp.readyState==4){if(xmlHttp.status==200){whenisdone();}}}
function whenisdone(){var newText=xmlHttp.responseText;if(!document.getElementById("posts")){return false;}
var ul=document.getElementById("posts");if(lasttext==newText){div.innerHTML="The End";timecolor(div);var allover=setTimeout(function(){document.body.removeChild(div);},1000);return false;}
var newposts=newText.match(/(?:<ul )id="posts">[\s\S]*<div class="pageNavi">/);if(newposts==null){return false;}
var posts=newposts.toString().split(/<div class="postHeader">/);for(var i=1;i<posts.length;i++){var eachposttext=posts[i].toString().match(/[\s\S]*(?=<\/li>)/);var li=document.createElement("li");timecolor(li);li.innerHTML='<div class="postHeader">'+eachposttext;ul.appendChild(li);}
curPage++;url=domain+"/index_"+(curPage+1)+".html";lasttext=newText;loading=false;document.body.removeChild(div);}
function timecolor(obj){var i=0;obj.style.background="rgb(255,255,"+i+")"
i=100;var g=setInterval(function(){if(i==255){clearInterval(g);obj.style.backgroundColor="transparent";return false;}
i+=5;obj.style.background="rgb(255,255,"+i+")";},20);}})();