/*

  Hi there!  Thanks for taking an interest in my sourcecode.  If you have
  any questions about the inner-workings of recgroups, you can email me at
  talisto [at] gmail.com.  But, please, don't steal my hard work.


                      Here's the obligatory legal-ese:

  This website is Copyright (c) 2004 recgroups.com.  All Rights Reserved.

  Except as required for client functionality, no part of this site may be
  downloaded, reproduced, modified, used to create derivative works, or
  transmitted in any form or by any means, except as permitted under Section
  107 of the 1976 U.S. Copyright Act. Visitors will not attempt to reverse
  engineer, disassemble, decompose, amend or modify or similarly manipulate
  all or any portion of recgroups.com.
































*/
var cmsgID=0;function preloadImg(strImg){var pImg=new Image();pImg.src=strImg;return pImg};var img1=preloadImg('/s.gif');var img2=preloadImg('/p.gif');var img3=preloadImg('/pr.gif');var img4=preloadImg('/pw.gif');var img5=preloadImg('/mn.gif');var img6=preloadImg('/mr.gif');var img7=preloadImg('/mw.gif');var img8=preloadImg('/m.gif');var img9=preloadImg('/b.gif');var img10=preloadImg('/f.gif');var img10=preloadImg('/i.gif');var img11=preloadImg('/c.gif');var img12=preloadImg('/cc.gif');var img13=preloadImg('/cl.gif');function change_sort_by(newsortby,showFrom){document.getElementById("wait").style.display="";document.location="/tl/"+gID+"/"+page+"?sortby="+newsortby+"&showfrom="+showFrom+"&expand="+expand+"&subject="+searchSubject+'&author='+searchAuthor+"&fav="+showFav;return false};function find_first_msg(){ar=document.getElementById("threads").rows;if(ar.length>2){if(ar[0].className=="fav-header-row")return ar[2];else return ar[1]}else return false};function count_rows(tRow,vis){var counter=-1;var vcounter=0;ar=document.getElementById("threads").rows;do{counter=counter+1;if(vis!=""){if(ar[counter].className==vis)vcounter=vcounter+1}}while((counter<ar.length)&&(ar[counter]!=tRow));if(counter==ar.length)return false;else return(vis==""?(counter-1):vcounter)};function set_active_msg(num,scroll){if(document.getElementById){var tRow=document.getElementById("t"+num);if(tRow){if((parseInt(tRow.getAttribute("r"))==0)||(!tRow.getAttribute("r"))){set_msg_read(tRow,"r");set_link_read(tRow,"r");update_parents_read(tRow,-1);tRow.setAttribute("r",1)}set_active_row(tRow);if((tRow.className=="non")||((tRow.getAttribute("p")=="t0")&&(scroll==1))){if(tRow.getAttribute("p")!="t0")do{tRow=document.getElementById(tRow.getAttribute("p"))}while(tRow.getAttribute("p")!="t0");t(tRow.getAttribute("id"),'vis')}if(scroll==1){window.scrollBy(0,16)}else if(scroll==-1){window.scrollBy(0,-16)}}}};function toggle_all_threads(vis,showFrom){if(vis=='flat'){document.getElementById("wait").style.display="";parent.document.location="/ft/"+gID+"/1?sortby="+sortBy+"&showfrom="+showFrom+"&expand=flat&subject="+searchSubject+'&author='+searchAuthor+"&fav="+showFav;return false}else if(expand=='flat'){document.getElementById("wait").style.display="";parent.document.location="/ft/"+gID+"/1?sortby="+sortBy+"&showfrom="+showFrom+"&expand="+vis+"&subject="+searchSubject+'&author='+searchAuthor+"&fav="+showFav;return false}ar=document.getElementById("threads").rows;for(var i=0;i<ar.length;i++){if((ar[i].className=='vis')||(ar[i].className=='non')){if(ar[i].getAttribute){if(ar[i].getAttribute("p")!="t0"){if(ar[i].className!=vis){ar[i].className=vis;toggle_button(ar[i],vis,1)}}else{toggle_button(ar[i],vis,1)}}}}};function set_msg_read(obj,setto){var counter=-1;var divs=obj.getElementsByTagName("img");do{counter=counter+1}while((counter<divs.length)&&(divs[counter].className!="mn")&&(divs[counter].className!="mr"));if(divs[counter]){if((!setto)||(setto=="")){divs[counter].className=(divs[counter].className=="mr"?"mn":"mr");divs[counter].src="/"+(divs[counter].className=="mr"?"mn":"mr")+".gif"}else{divs[counter].className="m"+setto;divs[counter].src="/m"+setto+".gif"}}};function set_all_read(threadID){if(threadID==false){ar=document.getElementById("threads").rows;for(var i=0;i<ar.length;i++){if(ar[i].getAttribute("p")){if(ar[i].getAttribute("p")=="t0"){ar[i].setAttribute("c",0);update_unread_number(ar[i]);update_button(ar[i])}set_msg_read(ar[i],"r");set_link_read(ar[i],"r");ar[i].setAttribute("r",1)}}}else{var tRow=document.getElementById('t'+threadID);tRow.setAttribute("c",0);update_unread_number(tRow);do{set_msg_read(tRow,"r");set_link_read(tRow,"r");tRow.setAttribute("r",1);if(tRow.nextSibling)tRow=tRow.nextSibling;else tRow=false;if((!tRow.getAttribute)&&(tRow.nextSibling))tRow=tRow.nextSibling}while(tRow.getAttribute("t")==''+threadID+'')}};function set_link_read(obj,setto){var ahref=obj.getElementsByTagName("a");if((!setto)||(setto=="")){ahref[0].className=(ahref[0].className=="mr"?"mn":"mr")}else{ahref[0].className="m"+setto}};function set_active_row(obj){if(cmsgID.style)cmsgID.style.backgroundColor='';obj.style.backgroundColor='#FEF7EA';cmsgID=obj};function update_unread_number(obj){if(document.getElementById){var spans=obj.getElementsByTagName("span");var counter=-1;do{counter=counter+1}while((counter<spans.length)&&(spans[counter].className!="unread"));if(spans[counter]){if(spans[counter].className=="unread"){if((obj.getAttribute("c")==0)||(!obj.getAttribute("c")))spans[counter].innerHTML="";else spans[counter].innerHTML="("+obj.getAttribute("c")+")"}}}};function update_parents_read(obj,set){if(document.getElementById){if(obj.getAttribute("p")!="t0"){var tParent=document.getElementById(obj.getAttribute("p"));if(tParent){tParent.setAttribute("c",parseInt(tParent.getAttribute("c"))+parseInt(set));update_parents_read(tParent,set)}}else{update_unread_number(obj)}}};function update_parents_watch(obj){if(document.getElementById){if(obj.getAttribute("p")!="t0"){var tParent=document.getElementById(obj.getAttribute("p"));if(tParent){tParent.setAttribute("wc",parseInt(tParent.getAttribute("wc"))-1);update_parents_watch(tParent)}}}};function a(tRow,aload){if(tRow.tagName=="A"){tRow=tRow.parentNode.parentNode}if(document.getElementById){if((parseInt(tRow.getAttribute("r"))==0)||(!tRow.getAttribute("r"))){set_msg_read(tRow,"r");set_link_read(tRow,"r");update_parents_read(tRow,-1);tRow.setAttribute("r",1)}if(parseInt(tRow.getAttribute("w"))>0){tRow.setAttribute("w",0);update_parents_watch(tRow)}set_active_row(tRow);t(tRow,"vis",tRow.getAttribute("c")>0?0:1);}if((aload==1)&&(parent.parent.frames["articleFrame"])){parent.parent.frames["articleFrame"].frames["article"].document.location="/a/"+(window.top.gID==0?tRow.getAttribute("g"):window.top.gID)+"/"+tRow.getAttribute("id").substring(1)+"/"}document.returnValue=true};function update_button(obj){var btn=obj.getElementsByTagName("img");var counter=-1;do{counter=counter+1}while((counter<btn.length)&&(btn[counter].className!="btnPlus")&&(btn[counter].className!="btnPlusR")&&(btn[counter].className!="btnPlusW")&&(btn[counter].className!="btnMinus"));if(btn[counter]){if((btn[counter].className=="btnPlus")||(btn[counter].className=="btnPlusR")||(btn[counter].className=="btnPlusW")){if(obj.getAttribute("wc")>0){btn[counter].className="btnPlusW";btn[counter].src="/pw.gif"}else if(obj.getAttribute("c")>0){btn[counter].className="btnPlusR";btn[counter].src="/pr.gif"}else{btn[counter].className="btnPlus";btn[counter].src="/p.gif"}}}};function toggle_button(obj,vis,force){var btn=obj.getElementsByTagName("img");var counter=-1;do{counter=counter+1}while((counter<btn.length)&&(btn[counter].className!="btnPlus")&&(btn[counter].className!="btnPlusR")&&(btn[counter].className!="btnPlusW")&&(btn[counter].className!="btnMinus"));if(btn[counter]){if((btn[counter].className=="btnPlus")||(btn[counter].className=="btnPlusR")||(btn[counter].className=="btnPlusW")){if((!vis)||(vis==""))var vis="vis";if(vis=="vis"){btn[counter].className="btnMinus";btn[counter].src="/m.gif"}}else if(btn[counter].className=="btnMinus"){if(force){if((!vis)||(vis==""))var vis="non";if(vis=="non"){if(obj.getAttribute("wc")>0){btn[counter].className="btnPlusW";btn[counter].src="/pw.gif"}else if(obj.getAttribute("c")>0){btn[counter].className="btnPlusR";btn[counter].src="/pr.gif"}else{btn[counter].className="btnPlus";btn[counter].src="/p.gif"}}}else{vis="vis"}}}return vis};function favThread(num,groupID,newclass){var xmlhttp=startXMLHTTP();if(xmlhttp){xmlhttp.open("GET",'/function.php?gID='+groupID+'&ID='+num+'&f='+(newclass=="fav"?"favs":(newclass=="ign"?"ign":"favu")),true);xmlhttp.send(null)}else{window.top.frames["loader"].document.location='/function.php?gID='+groupID+'&ID='+num+'&f='+(newclass=="fav"?"favs":(newclass=="ign"?"ign":"favu"))}tRow=window.document.getElementById("t"+num);if(!tRow)return false;do{var btn=tRow.getElementsByTagName("img");var counter=-1;do{counter=counter+1}while((counter<btn.length)&&(btn[counter].className!="blank")&&(btn[counter].className!="fav")&&(btn[counter].className!="ign"));btn[counter].className=newclass;if(newclass=="blank")btn[counter].src="/b.gif";else if(newclass=="fav")btn[counter].src="/f.gif";else btn[counter].src="/i.gif";if(tRow.nextSibling)tRow=tRow.nextSibling;else tRow=false;if((!tRow.getAttribute)&&(tRow.nextSibling))tRow=tRow.nextSibling}while((tRow.getAttribute)&&(tRow.getAttribute("t")==num))};function blockPoster(poster){if(confirm('Are you SURE you want to add '+poster+' to your block list?\n\nNote: you will need to refresh the threads to view your block-list changes.')){var xmlhttp=startXMLHTTP();if(xmlhttp){xmlhttp.open("GET",'/function.php?f=block&poster='+escape(poster),true);xmlhttp.send(null)}else{window.top.frames["loader"].document.location='/function.php?f=block&poster='+escape(poster)}return true}else{return false}};function fav(tBtn,groupID){if(tBtn.className=="blank"){var newclass="fav"}else if(tBtn.className=="fav"){var newclass="ign"}else{var newclass="blank"}tBtn.className=newclass;tRow=tBtn.parentNode.parentNode;var num=tRow.getAttribute("t");favThread(num,groupID,newclass)};function t(tRow,vis,force){if(tRow.tagName=="IMG"){if(tRow.className=="btnMinus")force=1;tRow=tRow.parentNode.parentNode}if(force==undefined)force=(tRow.getAttribute("c")>0?0:1);vis=toggle_button(tRow,vis,(vis=="non"?(force==1?1:0):1));var num=tRow.getAttribute("id");if(tRow.nextSibling)tRow=tRow.nextSibling;else return false;do{if((!tRow.getAttribute)&&(tRow.nextSibling))tRow=tRow.nextSibling;if((tRow.getAttribute)&&(tRow.getAttribute("p")==num)){tRow.className=vis;if((force==1)||((force==0)&&(tRow.getAttribute("c")>0))){tRow=t(tRow,vis,force)}else{tRow=t(tRow,"non",0)}}}while((tRow.getAttribute)&&(tRow.getAttribute("p")==num));return tRow};function t_over(){if(!pauseOver){if(cmsgID!=this){if(this.className!="non"){this.style.backgroundColor='#E8F3FF'}}}return false};function t_out(){if(!pauseOver){if(cmsgID!=this){if(this.className!="non"){this.style.backgroundColor='#FFFFFF'}}}return false};function t_click(e){if(typeof event=="undefined")var obj=e.target;else var obj=event.srcElement;if(obj.tagName=="TD"){a(obj.parentNode,1)}else if(obj.tagName=="DIV"){a(obj.parentNode.parentNode,1)}else if(obj.tagName=="IMG"&&((obj.className=="mr")||(obj.className=="mn"))){set_msg_read(this,"");set_link_read(this,"");if((parseInt(this.getAttribute("r"))==0)||(!this.getAttribute("r"))){this.setAttribute("r",1);update_parents_read(this,-1)}else if(parseInt(this.getAttribute("r"))==1){this.setAttribute("r",0);update_parents_read(this,1)}}};onload=function(){if(activeID){if(activeID>0){var tRow=window.document.getElementById("t"+activeID);if(tRow){set_active_row(tRow);t(window.document.getElementById("t"+tRow.getAttribute("t")),"vis",1);var rowCount=(count_rows(tRow,"vis")*16)-80;if(rowCount<0)rowCount=0;window.scrollTo(0,rowCount)}}}if(document.getElementById){document.getElementById("wait").style.display="none";var ar=document.getElementById("threads").getElementsByTagName("tr");for(var i=0;i<ar.length;i++){if((ar[i].className=='vis')||(ar[i].className=='non')){ar[i].onmouseover=t_over;ar[i].onmouseout=t_out;if(window.top.gID!=0){ar[i].onmousedown=t_click}}}}document.getElementById('wait').style.display='none'};

