content_master.log:ПРАВИЛО: Правила Content Master / Удаление в скриптах по ключевым словам (СМ)ФРАГМЕНТ:<script type="text/javascript">// метод Array.push()if(Array.prototype.push==null){Array.prototype.push=function(item){this[this.length]=item;return this.length;}}// регистрирует обработчик, вызываемый при открытии страницыvar _LoadCall=new Array();function registerLoader(name){_LoadCall.push(name);}function _callLoaders(){for(var i=0;i<_LoadCall.length;i++){var code=_LoadCall[i]+'()';try{eval.call(window,code);}catch(e){alert(e);}}}// фун. $ - сокращение для document.getElementByIdif(document.getElementById) var $ = function(id){return document.getElementById(id);};else if(document.all) var $ = function(id){return document.all[id];};if(document.getElementsByName) var $$ = function(id){return document.getElementsByName(id);};function ShowImg(sImgPath, width, height){ var scroll = 'no'; var top=0, left=0; if(width > screen.width-10 || height > screen.height-28) scroll = 'yes'; if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14); if(width < screen.width-10) left = Math.floor((screen.width - width)/2); width = Math.min(width, screen.width-10); height = Math.min(height, screen.height-28); window.open('/tools/imagepg.php?img='+sImgPath,'','scrollbars='+scroll+',resizable=yes,width='+width+',height='+height+',left='+left+',top='+top);}function AdmMenuCookies(cookie_name, id){ var flts = "", curval = ""; var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if(cookie_name == aCrumb[0]) { if(aCrumb.length>1 && aCrumb[1].length>0) { var val = aCrumb[1]; var arFVals = val.split("&"); for (var j=0; j < arFVals.length; j++) { val = arFVals[j]; if(val.length>0) { val = unescape(val); val = val.split("="); if(val.length>1 && val[1].length>0) { if(val[0] == id) curval = val[1]; else flts = flts + escape(val[0] + "=" + val[1]) + "&"; } } } } } } return flts;}// устанавливает ограничитель максимальной длины строки, вводимой в поля формы,// у которых указан атрибут maxlength и показывает введеное количество и максимальное символовString.prototype.substrCount = function(needle){ var L=this.length; var m=needle.length; for(var i=0,c=0; i<=L; i++){ if(needle == this.substr(i,m)) c++; } return c;} String.prototype.byteLength = function(){ var lfCount = this.substrCount(String.fromCharCode(10)); // \n var crCount = this.substrCount(String.fromCharCode(13)); // \r var crlfCount = this.substrCount(String.fromCharCode(13,10)); // \r\n var count = 0; var str = this; str = str.replace(/\r/g, 'r'); str = str.replace(/\n/g, 'n'); str = encodeURIComponent(str); str = str.replace(/%../g, 'x'); count = str.length; if(crlfCount > 0) count = count - crlfCount + lfCount; // win ie, win opera else if(lfCount > 0) count += lfCount; // win ff, win chrom else if(crCount > 0) count += crCount; // mac return count;};function setFieldMaxLength() { var tags = ['textarea']; var counter = document.createElement('div'); counter.className = 'MaxLengthCounter'; for(tagname in tags){ var x = document.getElementsByTagName(tags[tagname]); for (var i=0;i<x.length;i++) { if (x[i].getAttribute('maxlength')) { var counterClone = counter.cloneNode(true); counterClone.relatedElement = x[i]; counterClone.innerHTML = '<span>0</span>/'+x[i].getAttribute('maxlength'); x[i].parentNode.insertBefore(counterClone,x[i].nextSibling); x[i].relatedElement = counterClone.getElementsByTagName('span')[0]; x[i].onkeyup = function() { var maxLength = this.getAttribute('maxlength'); var currentLength = this.value.length; this.relatedElement.className = (currentLength > maxLength)?'toomuch':''; this.relatedElement.firstChild.nodeValue = currentLength; }; x[i].onchange = function() { var maxLength = this.getAttribute('maxlength'); var currentLength = this.value.length; this.relatedElement.className = (currentLength > maxLength)?'toomuch':''; this.relatedElement.firstChild.nodeValue = currentLength; }; x[i].onchange(); }else if (x[i].getAttribute('maxlengthbyte')) { var counterClone = counter.cloneNode(true); counterClone.relatedElement = x[i]; counterClone.innerHTML = '<span>0</span>/'+x[i].getAttribute('maxlengthbyte'); x[i].parentNode.insertBefore(counterClone,x[i].nextSibling); x[i].relatedElement = counterClone.getElementsByTagName('span')[0]; x[i].onkeyup = function() { var maxLength = this.getAttribute('maxlengthbyte'); var currentLength = this.value.byteLength(); this.relatedElement.className = (currentLength > maxLength)?'toomuch':''; this.relatedElement.firstChild.nodeValue = currentLength; }; x[i].onchange = function() { var maxLength = this.getAttribute('maxlengthbyte'); var currentLength = this.value.byteLength(); this.relatedElement.className = (currentLength > maxLength)?'toomuch':''; this.relatedElement.firstChild.nodeValue = currentLength; }; x[i].onchange(); } } }}registerLoader("setFieldMaxLength");// reduce image flicker in IE6function reduceFlicker(){try{document.execCommand('BackgroundImageCache', false, true);}catch(e){};}registerLoader("reduceFlicker");if(document.addEventListener && !document.all){document.addEventListener("DOMContentLoaded",_callLoaders,null);}else if(document.addEventListener){document.addEventListener("load",_callLoaders,null);}else{window.onload=_callLoaders;}</script>