1function isRendered(domObj) { 2 if (!domObj) { 3 return false; 4 } 5 6 if ((domObj.nodeType != 1) || (domObj == document.body)) { 7 return true; 8 } 9 if (domObj.currentStyle && domObj.currentStyle["display"] != "none" && domObj.currentStyle["visibility"] != "hidden") { 10 return isRendered(domObj.parentNode); 11 } else if (window.getComputedStyle) { 12 var cs = document.defaultView.getComputedStyle(domObj, null); 13 if (cs.getPropertyValue("display") != "none" && cs.getPropertyValue("visibility") != "hidden") { 14 return isRendered(domObj.parentNode); 15 } 16 } 17 return false; 18} 19 20function getScriptParentTag() { 21 var scriptTag = document.scripts[document.scripts.length - 1]; 22 23 return scriptTag.parentNode; 24} 25 26function setCookie(name, value, options) { 27 options = options || {}; 28 29 if (!options.path) { 30 options.path = '/'; 31 } 32 33 var expires = options.expires; 34 35 if (typeof expires == "number" && expires) { 36 var d = new Date(); 37 d.setTime(d.getTime() + expires * 1000); 38 expires = options.expires = d; 39 } 40 if (expires && expires.toUTCString) { 41 options.expires = expires.toUTCString(); 42 } 43 44 value = encodeURIComponent(value); 45 46 var updatedCookie = name + "=" + value; 47 48 for (var propName in options) { 49 updatedCookie += "; " + propName; 50 var propValue = options[propName]; 51 if (propValue !== true) { 52 updatedCookie += "=" + propValue; 53 } 54 } 55 56 document.cookie = updatedCookie; 57} 58 59function getCookie(name) { 60 var matches = document.cookie.match(new RegExp( 61 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 62 )); 63 return matches ? decodeURIComponent(matches[1]) : undefined; 64} 65 66getNoun = function (number, one, two, five) { 67 number = Math.abs(number); 68 number %= 100; 69 if (number >= 5 && number <= 20) { 70 return five; 71 } 72 number %= 10; 73 if (number === 1) { 74 return one; 75 } 76 if (number >= 2 && number <= 4) { 77 return two; 78 } 79 return five; 80}; 81 82function asCurrency(value) { 83 if (typeof Intl == 'object' && typeof Intl.NumberFormat == 'function') { 84 var formatter = new Intl.NumberFormat('ru-RU', { 85 style: 'decimal', 86 minimumFractionDigits: 0, 87 }); 88 89 return formatter.format(value) + ' Ñ.'; 90 } 91 92 return value + ' Ñ.'; 93}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.