if(!Array.prototype.indexOf){Array.prototype.indexOf=function(a){var b=this.length;for(var i=0;i<b;i++){if(this[i]===a){return i}}return-1}}var TmodShowhide={hideList:[],isChange:false,init:function(){var t;if(location.href.indexOf('.php?res=')!==-1){return}jQuery('div.threadpost').each(function(){if(!this.id){return}var j=jQuery(this).wrap('<div class="threadStructure" id="t'+this.id+'"></div>').parent();var a=[];while((j=j.next('.reply, br')).size()!==0){a.push(j)}jQuery(a).appendTo(jQuery(this).parent())});if(t=getCookie('hideList')){TmodShowhide.hideList=t.split(',');jQuery('div.threadStructure').each(function(){if(TmodShowhide.hideList.indexOf(this.id)!==-1){jQuery(this).hide()}})}jQuery('div.threadStructure').each(function(){jQuery(this).before('[<a href="javascript:void(0);" onclick="TmodShowhide.switchThread(\''+this.id+'\');" title="Hide/Show this thread">+ / -</a>]<br />')})},switchThread:function(a){var t;TmodShowhide.isChange=true;if((t=TmodShowhide.hideList.indexOf(a))!==-1){TmodShowhide.hideList.splice(t,1);jQuery('div.threadStructure#'+a).show('slow')}else{TmodShowhide.hideList.push(a);jQuery('div.threadStructure#'+a).hide('slow')}},unload:function(){if(TmodShowhide.isChange){setCookie('hideList',TmodShowhide.hideList.join(','))}}};jQuery(TmodShowhide.init);jQuery(window).unload(TmodShowhide.unload);