/*
 * allrights reserved by tategakibunko
 * url : http://tategakibunko.mydns.jp
 * blog : http://tategakibunko.blog83.fc2.com
 */


var GearsCacheTable={open:function(){var a=google.gears.factory.create("beta.database");a.open("bungou");return a},load:function(){var e=this.open();var d=e.execute("select novel_id, length(raw_text) from RawText order by post_time desc");var g=[["作品URL","キャッシュサイズ","削除"]];while(d.isValidRow()){var h=d.field(0);var a=Math.floor((parseInt(d.field(1))*4)/1024)+" kbyte";var c="/novel/"+h;var f=Util.link(c+"/gears",[],c);var b=Util.link("javascript:GearsCacheTable.deleteCache("+h+")",[{name:"onclick",value:'return confirm("really?");'}],"<img src='/bungou/img/icon/delete.png'>");g.push([f,a,b]);d.next()}e.close();Dom.id("cache").innerHTML=Util.table(g,[{name:"class",value:"db-table"}],true)},deleteCache:function(b){var a=this.open();a.execute("delete from RawText where novel_id="+b);a.execute("delete from SeekTable where novel_id=?",[b]);a.close();location.reload()}};window.onload=function(){if(!window.google||!google.gears){msg="install google gears plz!";location.href="http://gears.google.com/?action=install&message="+encodeURIComponent(msg)+"&return=<your website url>"}};
