if(!window.SQLRUForums) { window.SQLRUForums = { myforums: {}, collapsed: 0, imgs: null, regs: {read: /myforums=([^;]+)(;|$)/, bid: /bid=(\d+)$/}, events: { img: function (e) { if(SQLRUForums.collapsed){return;} e = e || window.event; e = e.target || e.srcElement; var r = e.parentNode.parentNode; SQLRUForums.setMyForums(r.idForum, !r.ismy); SQLRUForums.setRow(r, !r.ismy, true); SQLRUForums.Save(); }, imgo: function (e) { if(SQLRUForums.collapsed){return;} e = e || window.event; e = e.target || e.srcElement; e.style.borderLeftWidth = 1; }, imgl: function (e) { if(SQLRUForums.collapsed){return;} e = e || window.event; e = e.target || e.srcElement; e.style.borderLeftWidth = 0; }, collapse: function (e) { e = e || window.event; e = e.target || e.srcElement; SQLRUForums.setCollapsed(e.checked); SQLRUForums.Save(); } }, setCookie: function(v) { document.cookie = "myforums=" + v + "; expires=" + new Date(new Date().getFullYear()+3, 10, 10, 0, 0, 0).toString() + "; path=/; domain=.sql.ru;"; }, Save: function() { var i, a = [this.collapsed]; for(i in this.myforums){a.push(i);} this.setCookie(a.join('|')); }, Read: function() { this.myforums = {}; this.collapsed = 0; if(this.regs.read.test(document.cookie)) { if((RegExp.$1).length === 0){return;} var a = (RegExp.$1).split('|'); this.collapsed = parseInt(a[0]); for(var i=1; i 40) { this.table = tbls[i]; break; } } var style = document.createElement('style'); document.getElementsByTagName('head')[0].appendChild(style); this.ssDN = document.styleSheets[document.styleSheets.length - 1]; this._setCollapse(0); if(this.ssDN.addRule){this.ssDN.addRule('.' + this.pcnHide + ' .'+this.cnHide[0], 'display:none;');} else { if(this.ssDN.insertRule) { this.ssDN.insertRule('.' + this.pcnHide + ' .' + this.cnHide[0] + ' {display:none;}', 0); }} this.chb = document.createElement('input'); this.chb.type = 'checkbox'; this.chb.id = 'MyForumsChBVis'; var lbl = document.createElement('label'); lbl.setAttribute('for', 'MyForumsChBVis'); lbl.innerHTML = 'Отображать только мои форумы'; var tab1 = this.table.parentNode.parentNode.parentNode.parentNode; this.chb.style.cursor = 'pointer'; lbl.style.cursor = 'pointer'; tab1.parentNode.insertBefore(this.chb, tab1); tab1.parentNode.insertBefore(lbl, tab1); this.chb.onclick = this.events.collapse; this.Read(); this.chb.checked = (this.collapsed == 1); this.each(this.fnBegin); this._setCollapse(this.collapsed); } }; SQLRUForums.Begin(); }