var groups; /// Util functions // Shorthand for String.fromCharCode function gc(code) { return String.fromCharCode(code); } // Strip whitespace (or other characters) from the beginning and end of a string function trim(str) { return str.replace(/^[\s\xA0]+/, '').replace(/[\s\xA0]+$/, '').replace(/ +$/, '').replace(/^ +/, ''); } function escape_html(str) { return str.replace(/&/g, '&').replace(/ 1) { ret = confirm('Удалить ' + y5.Strings.plural(length, ['RSS-поток', 'RSS-потока', 'RSS-потоков']) + '?') } else if (length == 1) { var title = select.options[select.selectedIndex].text; ret = confirm('Удалить ' + (what ? what + ' ' : '') + gc(171) + title + gc(187) + '?'); } return ret; } function joinList(id) { var selected = []; var thisFrom = document.getElementById(id); for (var i = thisFrom.options.length - 1; i >= 0; i--) { selected[selected.length] = thisFrom.options[i].value; } return selected.join(','); } function joinBits(frm, name) { var i = 0, k, bits = 0, obj; while (frm[name + i]) { obj = frm[name + i]; if (obj.checked) { // checkbox bits += parseInt(obj.value); } if (obj.length) { // radio for (k = 0; k < obj.length; k++) { if (obj[k].checked) { bits += parseInt(obj[k].value); } } } i++; } return bits; } function setNull(id) { var swtch = document.getElementById('switch_' + id); var set = document.getElementById('switch_' + id + '_1'); var block = document.getElementById('for' + id); var swtcher = document.getElementById('switcher_' + id); if (set) { set.disabled = swtch.checked; } if (block) { block.className = swtch.checked ? '' : 'hiddenBlock'; } if (swtcher) { swtcher.className = swtch.checked ? '' : 'hiddenSwitch'; } return false; } function escape_1251(rawStr) { var chars = 'йцукенгшщзхъфывапролджэячсмитьбюёЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮЁ+()|?&$#@" '; var hexCP1251 = "%E9%F6%F3%EA%E5%ED%E3%F8%F9%E7%F5%FA%F4%FB%E2%E0%EF%F0%EE%EB%E4%E6%FD%FF%F7%F1%EC%E8%F2%FC%E1%FE%B8%C9%D6%D3%CA%C5%CD%C3%D8%D9%C7%D5%DA%D4%DB%C2%C0%CF%D0%CE%CB%C4%C6%DD%DF%D7%D1%CC%C8%D2%DC%C1%DE%A8%2B%28%29%7C%3F%26%24%23%40%22%20"; var ret = '', ch, pos, i; for (i = 0; i < rawStr.length; i++) { ch = rawStr.charAt(i); pos = chars.indexOf(ch); ret += ((pos >= 0) ? hexCP1251.substring(pos * 3, (pos + 1) * 3) : ch); } return ret; } function operateByButton(e) { e = e ? e : event; document.getElementById('flows').focus() if (e.keyCode == 46 && !document.getElementById('delItem').disabled) { flowManager.deleteItem() } if ((e.keyCode == 10 || e.keyCode == 13) && !document.getElementById('renameIt').disabled) { flowManager.renameItem(); } return true; }