function hideGuests var showedQuestions var allQuestions var res start

1
function hideGuests() {var showedQuestions=0;var allQuestions=0;var res=/(?:\\?|&)start=([^&]*)/.exec(document.location.href);if(res)allQuestions=res[1];if(document.getElementById('wpr2tr')) {var hrefs=document.getElementById('wpr2tr').getElementsByTagName('a');var chet=false;var questionId='';var questionText='';var prevQuestionId='';var afterlast=true;var stop=false;for(var i=0;i<hrefs.length;i++) {if(hrefs[i].className.indexOf('wpitCSS wpiqCSS')!=-1) {questionText=hrefs[i].innerHTML;questionId=/(?:\\?|&)tid=([^&]*)/.exec(hrefs[i].href)[1];}if(hrefs[i].className.indexOf('wpfiuCSS')!=-1) {if(hrefs[i].previousSibling.tagName!='IMG' && hrefs[i].title!=userName) {var img=document.createElement('img');img.src='http://www.google.com/reader/ui/2513649784-icon-unsubscribe.png';img.width=13;img.height=13;img.hspace=1;img.setAttribute('onClick','if(confirm(\"Поместить '+hrefs[i].title+' в чёрный список?\")){userBlackList.push(\"'+hrefs[i].title+'\");showUserBlackList();hideGuests()}');img.align='left';img.title='Добавить в чёрный список';hrefs[i].parentNode.insertBefore(img,hrefs[i]);}var hideQuestion=!filterFunction(hrefs[i].title,questionText);if(showedQuestions>29 && !hideQuestion) {afterlast=false;}if((hideQuestion && hrefs[i].parentNode.parentNode.parentNode.getElementsByTagName('img')[0].src.indexOf('star_solid')==-1) || showedQuestions>29 || prevQuestionId==questionId) {hrefs[i].parentNode.parentNode.parentNode.style.display='none';} else {hrefs[i].parentNode.parentNode.parentNode.style.display='';hrefs[i].parentNode.parentNode.parentNode.style.backgroundColor=chet?'':'rgb(244, 248, 255)';chet=!chet;showedQuestions++;}prevQuestionId=questionId;if(showedQuestions<30 || afterlast) {allQuestions++;}}}if(questionId!='') {if(nextHref) {nextHref.href=nextHref.href.replace(/(\\?|&)start=(?:[^&]*)/,function($0,$1) {return $1+'start='+allQuestions;});}if(document.getElementById('wrppr')) {document.getElementById('wrppr').style.display='none';}if(showedQuestions<30 && nextHref) {getAdditionalQuestion();}}}}function onReady(req) {if(req.readyState==4 && req.status==200) {if(req.responseText.indexOf('>Далее</a>')==-1) {nextHref=false;}var myHTML=req.responseText.substring(0,req.responseText.indexOf('<div class=wppklbCSS>'));myHTML=myHTML.substring(myHTML.indexOf('<table class=wpr2trCSS'));myHTML=myHTML.substring(0,myHTML.indexOf('\\n</tbody>'));myHTML=myHTML.substring(myHTML.indexOf('\\n<tr>'));var startOfScript=0;var endOfScript=0;var oldwrite=document.write;document.write=function(text){writeResult=text;};writeResult='';if(document.location.href.indexOf('/label')!=-1) {var qOnPage=20;} else {var qOnPage=30;}if(typeof lastCsuid=='undefined'){csuidDelta=qOnPage;for(lastCsuid=1;document.getElementById('csuid'+lastCsuid+'_span');lastCsuid++);} else {csuidDelta+=qOnPage;}for(var i=lastCsuid-qOnPage;i<lastCsuid;i++) {myHTML=str_replace('csuid'+i,'csuid'+(i+csuidDelta),myHTML);}var postScript='';var resHTML='';while((startOfScript=myHTML.indexOf('<script>'))!=-1) {var script=myHTML.substring(startOfScript+8,(endOfScript=myHTML.indexOf('</script>')));resHTML+=myHTML.substring(0,startOfScript);myHTML=myHTML.substring(endOfScript+9);if(script.indexOf('redrawTopicSubscriber')!=-1) {postScript+=script;} else {eval(script);resHTML+=writeResult;}}var tbody=document.getElementById('wpr2tr').getElementsByTagName('tbody')[0];tbody.innerHTML+=resHTML+myHTML;eval(postScript);document.write=oldwrite;hideGuests();}}function getAdditionalQuestion() {req = new XMLHttpRequest();req.open('GET', nextHref.href, true);req.onreadystatechange = function (){onReady(req);};req.send('');}nextHref=false;prevHref=false;var div=document.getElementById('wpr2tr');if(div) {while(div && div.tagName!='DIV')div=div.nextSibling;if(div) {var downHrefs=div.getElementsByTagName('A');for(var i=0;i<downHrefs.length;i++) {if(downHrefs[i].innerHTML=='Далее' || downHrefs[i].innerHTML=='\\nЕще&nbsp;»') {nextHref=downHrefs[i];} else if(downHrefs[i].innerHTML=='Назад') {prevHref=downHrefs[i];} else {downHrefs[i].style.display='none';}}}}var tecPage=0;var i=/(?:\\?|&)start=([^&]*)/.exec(document.location.href);if(i)tecPage=i[1];var storage = globalStorage[document.domain];if(typeof storage['page_history'] == 'undefined') {pageHistory='';} else {pageHistory=String(storage['page_history']);}pageHistory=pageHistory.split(/\\,/);pageHistoryNew=[];for(var i in pageHistory) {if(parseInt(pageHistory[i])<tecPage)pageHistoryNew.push(parseInt(pageHistory[i]));}pageHistoryNew.sort(function(a, b) {if (parseInt(a)<parseInt(b))return -1;if(parseInt(a)>parseInt(b))return 1;return 0;});if(pageHistoryNew) {prevPage=pageHistoryNew.pop();pageHistoryNew.push(prevPage);if(prevHref) {prevHref.href=prevHref.href.replace(/(\\?|&)start=(?:[^&]*)/,function($0,$1) {return $1+'start='+prevPage;});}}pageHistoryNew.push(tecPage);storage['page_history']=pageHistoryNew.join(',');var newStyle=document.createElement('style');document.getElementsByTagName('head')[0].appendChild(newStyle);newStyle = document.styleSheets[document.styleSheets.length - 1];newStyle.insertRule('#wpr2tr .wpr2cpCSS{width:11ex}',0);newStyle.insertRule('#wpr2tr .wpr2ctsCSS{width:6ex}',1);