javascript:var LWx=function(){LWx.init();var entries=$$('.entry');for(var i=0;i');};LWx.next_unread=function(event){LWx.current++;if(LWx.current>=LWx.unread.length){alert('No unread comments.');return;};LWx.unread[LWx.current].up().scrollTo();LWx.update();};LWx.element.observe('click',LWx.next_unread);LWx.DB=null;LWx.id_regexp=/[a-zA-Z0-9]*_t([0-9])_([a-z0-9]*)/;LWx.from_36=function(str36){var base='0123456789abcdefghijklmnopqrstuvwxyz';var result=0;var len=str36.length;for(var i=len-1;i>=0;i--){result+=base.indexOf(str36.charAt(i))*Math.pow(36,len-i-1);};return result;};LWx.init=function(){if(!window.openDatabase){alert('Sorry. Unsuported browser.');return;};LWx.DB=window.openDatabase('LWxDB','1','Less Wrong extension',1024*1024);LWx.DB.transaction(function(tx){tx.executeSql('CREATE TABLE IF NOT EXISTS Entries(id INTEGER PRIMARY KEY)',[]);});};LWx.process_entry=function(entry){var re_result=LWx.id_regexp.exec(entry.id);if(!re_result||re_result[1]!='1')return;var entry_id=LWx.from_36(re_result[2]);entry.comment_id36=re_result[2];LWx.DB.transaction(function(tx){tx.entry_element=entry;tx.entry_id=entry_id;tx.executeSql('SELECT * FROM Entries WHERE id = ?',[entry_id],function(tx,rs){if(rs.rows.length==0){LWx.unread.push(tx.entry_element);LWx.highlight(tx.entry_element);LWx.DB.transaction(function(tx1){tx1.executeSql('INSERT INTO Entries (id) VALUES(?)',[tx.entry_id],function(tx1,rs1){LWx.update();});});}});});};LWx();