Здравствуйте, хочу узнать, ожидает ли меня смена места жительства и когда? Татьяна 22.09.1984г. // <![CDATA[ /** @preserve version !region_version! ... - вопрос №1425057

*/ var tnscm_adn; /** @define {boolean} */ var ENABLE_CONSOLE = true; /** @define {boolean} */ var ENABLE_ERROR_HANDLING = false; (function (window, document, undefined) { «use strict»; /** @export */ var CONFIG = { «juke_host»: 'juke.mmi.bemobile.ua/bug/pic.gif', «host»: «pagestat.mmi.bemobile.ua», «sslhost»: «sslpagestat.mmi.bemobile.ua», «source»: «source.mmi.bemobile.ua», «err_host»: «er.mmi.bemobile.ua», «timer»: { frequency: 5, // seconds «pings»: [5, 15, 30, 60, 120], «stop_after»: 5, // minutes «check_location_timer»: 1 }, «ads»: { «scan_frequency»: 5, // seconds // minimal size «width»: 50, «height»: 40 } }; extend(CONFIG, window.addonCMeter && addonCMeter.config); /** * Prepare CONFIG array for use. Apply local params for the specific domain. Add parameter for be able to work in iframe (by default is true). * **/ if (CONFIG[«custom_url»] && location.host === CONFIG[«custom_url»][«href»]) { CONFIG[«ads»][«scan_frequency»] = CONFIG[«custom_url»][«banner_scan_frequency»]; CONFIG[«work_in_frame»] = CONFIG[«custom_url»][«work_in_frame»]; } else { CONFIG[«work_in_frame»] = true; } // this part is already in helpers.js /** * Extend destination object with the items from the source object. * If 3d argument is true, functions from the source are bound and then copied.* Function returns nothing, first argument is modified instead * * @param {Object} dest destination, where to copy items from the source * @param {Object} src source object from where items are taken * @param {Boolean} [bindFuncs] if true — functions in the source will be bound and returned rather then original functions */ function extend(dest, src, bindFuncs) { var k, item; for (k in src) { if (src.hasOwnProperty(k)) { item = src[k]; dest[k] = bindFuncs && «function» === typeof item? bind(item, dest): item; } } } var head = { js: function (src, cb) { var s = document.createElement(«script»), head = document.head || document.getElementsByTagName('head')[0]; function done (err) { s.onload = s.onerror = s.onreadystatechange = null; if (cb && typeof cb == «function») { cb(err); } } extend(s, { «async»: true, «type»: «text/javascript», «onload»: function () { done(null); }, «onerror»: done, «onreadystatechange»: function () { if («loaded» === s.readyState || «complete» === s.readyState) { done(null); } } }); // put src assigning after extend() to make sure it // is being set later than other attributes s.src = src; head.insertBefore(s, head.lastChild); }, onready: function (cb) { function done() { each(head.onready.funcs, function (cb) { cb(); }); delete head.onready.funcs; } function onreadystatechanged() { if («loading» !== document.readyState) { done(); document.detachEvent(«onreadystatechange», onreadystatechanged); } } if («loading» !== document.readyState) { cb(); return; } if (head.onready.funcs) { head.onready.funcs.push(cb); } else { head.onready.funcs = [cb]; if (document.addEventListener) { document.addEventListener(«DOMContentLoaded», done, false); return; } if (document.attachEvent) { document.attachEvent(«onreadystatechange», onreadystatechanged); } } }, ready: function (cb) { head.onready(cb); } } window[«idCoreOnReady»] = function(id){ IDCore[«onFlashReady»](id); }; window[«tnsOnStatResult»] = function(e){ console.log(«result:» + e.result + " pid:" + e.pid + " e.id: " + e.id); if(e.result != «success») { } }; // generate random value // unused in extension function random(){ var d = new Date().valueOf().toString(); return parseInt(d.substr(d.length — 8, d.length)) + Math.round(Math.random() * Math.pow(10, 9)); }; // resolve url by site protocol, host and path // unused in extension function getUrl(host, sslhost, path){ return location.protocol + "//" + (location.protocol == «https:»? sslhost: host) + path; }; // bind function to another scope // bind function implementation // unused in extension function delegate(fn, scope){ return function(){ return fn.apply((scope || window), Array.prototype.slice .call(arguments)); }; }; // return now in unixtime function time(){ return new Date().getTime(); }; // send requests by cors function createCors(errorHandler){ var cors; try { if(window.XDomainRequest) { cors = new window.XDomainRequest(); if(errorHandler){ cors.onerror = function(){ errorHandler.call(null, cors); }; } } else { cors = new XMLHttpRequest(); if(errorHandler){ cors.onreadystatechange = function (e) { if (cors.readyState == 4) { if(cors.status == 200){ }else{ errorHandler.call(null, cors); } } }; } } } catch(e) { console.error(«cors:» + e); } return cors; }; // check is mobile by regex from useragent // double var isMobile = (function(){ return /Mobi|Mini|Symbian|SAMSUNG|Nokia|BlackBerry|Series|Bada|SymbOS|PLAYSTATION/g .test(navigator.userAgent.toString()); }()); // add param to url function addParam(url, param, value){ var newurl = url; var delimiter = "&"; if(newurl.indexOf("?") == -1) { delimiter = "?"; } newurl += delimiter + param + "=" + value; return newurl; }; /* create UUID * */ function createUUID(){ var s = []; var hexDigits = «0123456789ABCDEF»; for( var i = 0; i < 32; i++) { s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); } s[12] = «4»; s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1); return s.join(""); }; function setCookie(name, value, expires, path, domain, secure){ document.cookie = name + "=" + escape(value) + ((expires)? "; expires=" + expires: "") + ((path)? "; path=" + path: "") + ((domain)? "; domain=" + domain: "") + ((secure)? "; secure": ""); }; function getCookie(name){ var cookie = " " + document.cookie; var search = " " + name + "="; var setStr = null; var offset = 0; var end = 0; if(cookie.length > 0) { offset = cookie.indexOf(search); if(offset != -1) { offset += search.length; end = cookie.indexOf(";", offset) if(end == -1) { end = cookie.length; } setStr = unescape(cookie.substring(offset, end)); } } return (setStr); }; function deleteCookie(name){ document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; }; var hasLocalStorage = (function(){ try { return «localStorage» in window && window[«localStorage»] !== null; } catch(e) { return false; } }()); var hasFlash = (function(){ if(typeof navigator.plugins == «undefined» || navigator.plugins.length == 0) { try { return !!(new ActiveXObject(«ShockwaveFlash.ShockwaveFlash»)); } catch(er) { return false; } } else { return navigator.plugins[«Shockwave Flash»]; } }()); var isIE = (function(){ return /MSIE/.test(navigator.userAgent); }()); var isIE7 = (function(){ return /MSIE\ 7/.test(navigator.userAgent); }()); function getBody(){ var body; try { body = document.getElementsByTagName(«body»)[0]; } catch(e) { } if(typeof body == «undefined» || body == null) { if(typeof document.body != «undefined») { body = document.body; if(!body) { // console.warn(«body is not availible»); } } } return body; }; var isCookieEnabled = (function(){ var cookieEnabled = (navigator.cookieEnabled)? true: false; if(typeof navigator.cookieEnabled == «undefined» && !cookieEnabled) { document.cookie = «testcookie»; cookieEnabled = (document.cookie.indexOf(«testcookie») != -1)? true: false; deleteCookie(«testcookie»); } return (cookieEnabled); }()); function isNotEmpty(str){ return undefined !== str && null != str && str.replace(/\s/g, "") != ""; }; function getPath(str, root){ var path = str; if(path.toLowerCase().indexOf("/") == 0) { if(root) { path = root + path; } else { var location = window.location.protocol.toString() + "//" + window.location.hostname.toString() + window.location.port.toString(); if(location != "") { path = location + path; } } } return encodeURIComponent(path); }; function round(n){ return Math.floor(n * 100) / 100; }; function makeArray(items){ try { return Array.prototype.slice.call(items); } catch(ex) { var i = 0, len = items.length, result = Array(len); while(i < len) { result[i] = items[i]; i++; } return result; } }; var idScope = (function(){ var scope = «l»; if(hasFlash){ scope = «b»; }else if(window.postMessage && (hasLocalStorage || isCookieEnabled)){ scope = «d»; }else if(hasLocalStorage == false && isCookieEnabled == false){ scope = «g»; } try { if(window.chrome){ for(var i in navigator.plugins){ if(/PepperFlashPlayer/gi.test(navigator.plugins[i].filename)){ scope = «c»; break; } } } }catch(e){ console.warn(«chrome: PepperFlashPlayer — has some error»); } return scope; }()); var IDCore = (function(){ var isReady = false; var host = window.addonCMeter && addonCMeter.hostAddon; var version = «1.73-r52607»; var short_version = version.replace(/-r\d+$/, ""); var juke_host = CONFIG.juke_host || 'juke.mmi.bemobile.ua/bug/pic.gif'; var hostForFlash = «» + CONFIG.source; var cookie = {}; cookie[«id»] = «vplayer_user_id»; cookie[«wasInitialized»] = «tns_was_initialized»; cookie[«wasMigrated»] = «tns_was_migrated»; cookie[«flag»] = «flag»; var wasInitialized = false; var holder = «div_holder»; var buffer = new Array(); var uid = ""; var refs = new Array(); function cds(){ function initCds() { try { var remoteStorage = new CrossDomainStorage(hostForFlash, "/id-core/" + version + "/id.html"); remoteStorage[«requestValue»](cookie[«id»], function(key, id){ onLocalReady(id); }); } catch(e) { console.error(«cds.js:» + e); uid = createUUID(); onLocalReady(uid); } } if (typeof CrossDomainStorage === «undefined») { head.js(host + "/id-core/" + version + "/cds.js", initCds); } else { initCds(); } } function setMigrate(){ var expirationDate = new Date(); expirationDate.setFullYear(expirationDate.getFullYear() + 1); // toGMTString() is deprecated setCookie(cookie[«wasMigrated»], true, expirationDate.toUTCString(), "/", ""); // when everything is okay onLocalReady(uid); } function migrate(){ if(getCookie(cookie[«wasMigrated»])) { return false; } if(isCookieEnabled) { var initialized = getCookie(cookie[«wasInitialized»]); if(initialized) { uid = getCookie(cookie[«id»]); if(hasLocalStorage) { head.js(host + "/id-core/cds.js", function(){ try { var remoteStorage = new CrossDomainStorage( hostForFlash, «id.html»); remoteStorage[«requestValue»](cookie[«id»] + ":" + uid, function(key, id){ if(id != uid) { console.error(«id: » + id + " != " + uid); } else { setMigrate(); } }); } catch(e) { console.error(«migrate:» + e); } }); deleteCookie(cookie[«id»]); deleteCookie(cookie[«wasInitialized»]); } else if(hasFlash) { window[«tns_uid»] = uid; head.js(host + "/id-core/" + version + "/flash.js", function(){ setMigrate(); // delete window[«tns_uid»]; }); } return true; } } return false; } function init(){ wasInitialized = true; if(migrate()) { return; } if(hasLocalStorage) { uid = localStorage.getItem(cookie[«id»]); if(uid) { onLocalReady(uid); } else { if(window.postMessage && !window.JSON && window.localStorage) { head.js(host + "/json2.min.js", function(){ if(getBody()) { cds(); } else { head.ready(function(){ cds(); }); } }); } else if(window.postMessage && window.JSON && window.localStorage) { if(getBody()) { cds(); } else { head.ready(function(){ cds(); }); } } else { onLocalReady(createUUID()); } } } else { if(hasFlash) { if(getBody()) { head.js(host + "/id-core/" + version + "/flash.js"); } else { head.ready(function(){ head.js(host + "/id-core/" + version + "/flash.js"); }); } } else { uid = getCookie(cookie[«id»]); if(!uid) { uid = createUUID(); } onLocalReady(uid); } } } function flushOnReady(){ var i; for(i in buffer) { if(buffer.hasOwnProperty(i)) { var url = buffer[i][«url»]; var params = buffer[i][«params»]; var time = buffer[i][«time»]; var type = buffer[i][«type»]; var onError = buffer[i][«onError»]; if(/^POST$/ig.test(type)) { sendPost(url, params, time, onError); } else { sendGet(url, params, time, type, onError); } } } buffer = Array(); var ref; for(ref in refs) { if(refs.hasOwnProperty(ref)) { refs[ref].call(this, uid); } } refs = new Array(); } function onLocalReady(id){ saveId(id); isReady = true; flushOnReady(); if(hasLocalStorage){ if(!localStorage.getItem(cookie[«flag»])) { (new Image).src = location.protocol + "//" + juke_host + "?uid=" + id + "&time=" + new Date().valueOf(); localStorage.setItem(cookie[«flag»], «true»); } } else if(isCookieEnabled) { if(!getCookie(cookie[«flag»])){ var expirationDate = new Date(); expirationDate.setFullYear(expirationDate.getFullYear() + 1); setCookie(cookie[«flag»], «true», expirationDate.toGMTString(), "/", ""); (new Image).src = location.protocol + "//" + juke_host + "?uid=" + id + "&time=" + new Date().valueOf(); } } } function saveId(id){ uid = id; if(hasLocalStorage) { localStorage.setItem(cookie[«id»], id); } else if(isCookieEnabled) { var expirationDate = new Date(); expirationDate.setFullYear(expirationDate.getFullYear() + 1); setCookie(cookie[«id»], id, expirationDate.toGMTString(), "/", ""); setCookie(cookie[«wasInitialized»], true, expirationDate .toGMTString(), "/", ""); } } function addParams(url, params){ var i, key; if(params instanceof Array) { for(i in params) { url = addParam(url, params[i][«key»], params[i][«value»]); } } else { for(key in params) { url = addParam(url, key, params[key]); } } return url; } function onFlashReady(id){ try { var div = document.getElementById(holder); div.parentNode.removeChild(div); } catch(e) { } swfobjectlite = null; onLocalReady(id); } function getVersion(){ return short_version; } function sendPost(url, params, time, onError){ try { var cors = createCors(onError); cors.open(«POST», url, true); if(!params) { params = {}; } if(params instanceof Array) { params.push({ «key»: «cookie», «value»: uid }); params.push({ «key»: «time», «value»: time? time: new Date().valueOf() }); } else { params[«cookie»] = uid; params[«time»] = time? time: new Date().valueOf(); } if(isIE) { cors.contentType = «text/plain»; } else { cors.setRequestHeader(«Content-type», «application/x-www-form-urlencoded;charset=UTF-8»); } var postParams = addParams("?", params).replace(/^\?/, ""); cors.send(postParams); }catch(e){ console.error(e); } } function sendGet(url, params, time, type, onError){ if(!params) { params = {}; } url = addParam(url, «cookie», uid); url = addParam(url, «time», time? time: new Date().valueOf()); url = addParams(url, params); // TODO: If this version will be in production — return send JSONP capability try { // Opera supports CORS only since v12 // For other Operas there is no obvious way to call external API // except injecting script into page if((type && type == «JSONP») || (window.opera && !(«withCredentials» in new XMLHttpRequest))) { var script = document.createElement(«script»); script.setAttribute(«src», url); document.getElementsByTagName(«head»)[0].appendChild(script); } else if(type && type == «GET») { var cors = createCors(onError); cors.open(«GET», url, true); if(isIE == false) { cors.setRequestHeader(«Accept», «application/json»); } cors.send(); } } catch(e) { console.log(e); } } return { «init»: function(){ if(wasInitialized == false) { if(isCookieEnabled && !getCookie(cookie[«wasMigrated»])){ if(getBody()){ init(); }else{ head.ready(function(){ init(); }); } }else{ init(); } } else if(isReady) { flushOnReady(); } }, «send»: function(url, params, type, onError){ if(!params){ params = {}; } params[«vt»] = idScope; var now = new Date().valueOf(); if(isReady) { if(/^POST$/ig.test(type)) { sendPost(url, params, now, onError); } else { sendGet(url, params, now, type, onError); } } else { buffer.push({ «url»: url, «params»: params, «type»: type, «time»: now, «onError»: onError }); } }, «onFlashReady»: function(id){ onFlashReady(id); }, «addOnReadyListener»: function(ref){ refs.push(ref); }, «isReady»: function(){ return isReady; }, «getId»: function(){ return uid; }, «version»: function(){ return getVersion(); } }; })(); IDCore[«init»](); /*jslint browser:true,devel:true,plusplus:true,regexp:true*/ /*global TUtility,IDCore,addonCMeter,ENABLE_CONSOLE*/ /** @const */ var VERSION = «3.3.361_ua»; var v = VERSION + "/" + IDCore.version(), perf = window.performance, perf_t = perf? perf.timing: null, started = perf_t? new Date(perf_t.navigationStart || perf_t.connectStart): new Date(), ua = navigator.userAgent, mobile = /android|mobi|mini|blackberry|samsung|bada|nokia|series|symb(ian|os)|playstation/i.test(ua), vendors = ["", «moz», «ms», «webkit»], isFrame = top !== self, id = IDCore.getId(), templates = {}, excludeElements = [], // array for keeping exclude elements from video tags subscribers = {}, previousLocation = location.href.replace(location.hash,""); // Utils /** * Just empty function. Intended for some cases as callback where no actions should be performed */ function nop() {} function random() { var d = new Date().valueOf().toString(); return parseInt(d.substr(d.length — 8, d.length)) + Math.round(Math.random() * Math.pow(10, 9)); }; var hasFlash = (function(){ if(typeof navigator.plugins == «undefined» || navigator.plugins.length == 0) { try { return !!(new ActiveXObject(«ShockwaveFlash.ShockwaveFlash»)); } catch(er) { return false; } } else { return navigator.plugins[«Shockwave Flash»]; } }()); /** * Strip initial & trailing whitespaces. * * @param str * @returns {String} */ function trim(str) { if (String.prototype.trim !== undefined) { return String.prototype.trim.call(str); } return str.replace(/^\s+|\s+$/g, ''); } /** * Apply callback to each element of the sequence (arr item / sting symbol) * * @param {Array|String|NodeList} arr array to process * @param {Function} cb callback to apply to each array item */ function each(arr, cb) { var i, l; if (!arr) { return; } l = arr.length; if (!l) { return; } for (i = 0; i < l; i += 1) { try { cb(arr[i], i, arr); } catch (ignore) {} } } /** * We need such function since IE < 9 doesn't support it natively for arrays — stackoverflow.com/a/9768663 * * @param {Array} arr * @param item * @return {Number} index >= 0 if found, -1 otherwise */ function indexOf(arr, item) { var i = 0, l = arr.length; while (i < l) { if (arr[i++] === item) { return i — 1; } } return -1; } function bind(fn, obj) { return function () { return fn.apply(obj, arguments); }; } /** * asynchronous version of each function — apply callback to each element of array and call in async way and finally call custom callback * * @param {Array} arr array to walk * @param {Function} cbEach callback to apply to each element of the array * @param {Function} [cbEnd] function to be called on the end of * @returns {Boolean|undefined|Number} setInterval ID, false or nothing */ function iterateAsync(arr, cbEach, cbEnd) { var interval, l; cbEnd = cbEnd || nop; if (!arr) { return false; } l = arr.length; if (0 === l) { cbEnd(); } if (!l) { return undefined; } interval = setInterval(function () { var i = 10; // every time use next 10 items from arr do { l -= 1; if (-1 === l) { clearInterval(interval); cbEnd(); return; } cbEach(arr[l], l, arr); } while (--i); }, 4); return interval; } /** * Extend destination object with the items from the source object. * If 3d argument is true, functions from the source are bound and then copied. * Function returns nothing, first argument is modified instead * * @param {Object} dest destination, where to copy items from the source * @param {Object} src source object from where items are taken * @param {Boolean} [bindFuncs] if true — functions in the source will be bound and returned rather then original functions */ function extend(dest, src, bindFuncs) { var k, item; for (k in src) { if (src.hasOwnProperty(k)) { item = src[k]; dest[k] = bindFuncs && «function» === typeof item? bind(item, dest): item; } } } function on(node, event, cb) { if (window.addEventListener) { node.addEventListener(event, cb, false); } else if (window.attachEvent) { node.attachEvent(«on» + event, cb); } } /** * Schedule callback to be run when DOM is ready. * Callback will be fired immediately if DOM has already been parsed. * * @param {Function} cb callback to execute */ function onready(cb) { function done() { each(onready.funcs, function (cb) { cb(); }); delete onready.funcs; } function onreadystatechanged() { if («loading» !== document.readyState) { done(); document.detachEvent(«onreadystatechange», onreadystatechanged); } } if («loading» !== document.readyState) { cb(); return; } if (onready.funcs) { onready.funcs.push(cb); } else { onready.funcs = [cb]; if (document.addEventListener) { document.addEventListener(«DOMContentLoaded», done, false); return; } if (document.attachEvent) { document.attachEvent(«onreadystatechange», onreadystatechanged); } } } /** * Schedule callback to be run on window load. * Callback will be fired immediately if window is * already neither loading nor parsing DOM. * The only argument passed against callback is time when * load state had been reached. * * @param {Function} cb callback function to be run */ function load(cb) { var q; function done() { var e = «loadEventStart»; load.time = perf_t && perf_t[e] > 0? new Date(perf_t[e]): new Date(); while (q.length) { q.shift()(load.time); } } if (load.time) { cb(load.time); return; } if (!load.queue) { load.queue = []; on(window, «load», done); } q = load.queue; q.push(cb); if («complete» === document.readyState) { done(); } } function onViewportChange(cb) { on(window, «scroll», cb); on(window, «resize», cb); cb(); } // TODO: Investigate if it is better to pass object w/ methods // instead of two separate callbacks. // Will it need to implement @interface to compile properly? function onVisibilityChange(cbVis, cbInv) { var i, field; cbInv = cbInv || nop; function trigger() { var state = document[field] || «visible»; switch (state) { case «hidden»: cbInv(state); break; default: cbVis(state); break; } } for (i = 0; i < vendors.length; i++) { field = vendors[i] + «VisibilityState»; field = field.charAt(0).toLowerCase() + field.substring(1); if (document[field]) { // we create and register new trigger() on // every call to function onVisibilityChange on(document, vendors[i] + «visibilitychange», trigger); if («hidden» !== document[field]) { trigger(); } return; } } trigger(); } /** * Split string to Key-value object. * @param {String} source string for parse * @returns {Object} Key-value Object */ function parseParams(source) { var params = {}; if (source) { each(source.split("&"), function (param) { var p = param.split("="); params[decodeURIComponent(p[0].toLowerCase())] = decodeURIComponent(p[1]); }); } return params; } /** Function tries identify path to ads destination. * * @param {Element} node for inspection. * @returns {String|Boolean} path to ads source or false. */ function getDestinationPath(node) { var tagName = node.nodeName, cl, param_str, params_list = node.childNodes, parent = node.parentNode, node_attr = '', params = {}; function findParam(params) { var result = false; each(['link1', 'clicktag', 'alink1', 'url'], function (attr_value) { if (params.hasOwnProperty(attr_value)) { result = params[attr_value]; } }); return result; } switch (tagName) { case «IMG»: while (parent) { if («A» === parent.nodeName) { cl = parent.href; break; } parent = parent.parentNode; } break; case «OBJECT»: each(params_list, function (param) { if («PARAM» === param.nodeName && «flashvars» === param.getAttribute(«name»).toLowerCase()) { param_str = param.getAttribute(«value»); params = parseParams(param_str.replace(/&/g, "&")); cl = findParam(params); } }); break; case «EMBED»: node_attr = node.getAttribute(«flashvars»); if (node_attr) { params = parseParams(node_attr.replace(/&/g, "&")); cl = findParam(params); } break; } try { if («string» === typeof cl) cl = decodeURIComponent(cl); } catch (ignore) {} return cl; } function getDocumentHeight() { var b = document.body, d = document.documentElement, h = b? Math.max(b.scrollHeight, b.offsetHeight, b.clientHeight): 0; return Math.max(h, d.scrollHeight, d.offsetHeight, d.clientHeight); } function isVisible(node) { var retVal = false, r, rects = node.getClientRects(), h = getDocumentHeight(), i = rects.length; while (i--) { r = rects[i]; if (0 === r.width || 0 === r.height) { continue; } if (r.top > 0) { return r.top <= h; } if (r.bottom > 0) { return r.bottom <= h; } retVal = true; } return retVal; } /** * Get specific style's value of the DOM element * * @param {Element} element DOM element to explore * @param {String} name style name * @returns {String|null} Text style value **/ function getStyle(element, name) { var s; if (document.defaultView && document.defaultView.getComputedStyle) { // W3C name = name.replace(/([A-Z])/g, "-$1").toLowerCase(); s = document.defaultView.getComputedStyle(element, null); return s && s.getPropertyValue(name); } if (element.currentStyle) { // IE? return element.currentStyle[name]; } if (element.style && element.style[name]) { return element.style[name]; } return null; } /** * Calculate offset of the element, taking into account all his parents. * If on any step there is NaN (seems no offsetTop / offsetLeft property) — undefined is returned instead * Falsie argument returns (0; 0) coordinates * * @param {Object} e DOM element object * @returns {Object} {left: X, top: Y} */ function getOffset(e) { if (!e) { return { top: 0, left: 0 }; } var offset = { top: e.offsetTop, left: e.offsetLeft }, parent = getOffset(e.offsetParent); offset.top += parent.top; offset.left += parent.left; if (isNaN(offset.top)) { offset.top = undefined; } if (isNaN(offset.left)) { offset.left = undefined; } return offset; } // WARNING: it will return zero as height for document.body if there is // only one element on page and it has been positioned absolutely function getSize(node) { var props = { w: [«paddingLeft», «paddingRight», «borderLeftWidth», «borderRightWidth»], h: [«paddingTop», «paddingBottom», «borderTopWidth», «borderBottomWidth»] }, s = { w: node.offsetWidth, h: node.offsetHeight }, type, i, style; for (type in s) { if (s.hasOwnProperty(type)) { if (s[type] > 0) { i = props[type].length; while (i--) { s[type] -= parseInt(getStyle(node, props[type][i]), 10) || 0; } } style = s[type] || getStyle(node, «w» === type? «width»: «height»); if (/%/.test(style)) { continue; } s[type] = parseInt(style, 10); } } return s; } function getDoc(node) { // second is for IE -1 && index < 8)) { document = getDoc(frame); if (document && document.getElementById) { return true; } } } catch (ignore) {} return false; } function getNodeSrc(node) { var src, i, params, param, flashvars; function checkExcludes(element) { if (-1 === indexOf(excludeElements, element)) { excludeElements.push(element); } } if (!node.tagName) { return false; } if («OBJECT» === node.tagName) { src = node.getAttribute(«data»); params = node.childNodes; if (!src) { // [fix23828] as of msdn.microsoft.com/library/ms536439#5 /* params = node.getElementsByTagName(«param»); i = params.length; while (i--) { if («movie» === params[i].getAttribute(«name»)) { return params[i].getAttribute(«value»); } } */ i = params.length; while (i--) { param = params[i]; if («PARAM» === param.nodeName && «movie» === param.getAttribute(«name»).toLowerCase()) { return param.getAttribute(«value»); } } } i = params.length; while (i--) { param = params[i]; if («PARAM» === param.nodeName && «flashvars» === param.getAttribute(«name»).toLowerCase()) { flashvars = parseParams(param.getAttribute(«value»).replace(/&/g, "&")); if (flashvars[«video1»]) { try { return decodeURIComponent(flashvars[«video1»]); } catch (e) { return flashvars[«video1»]; } } } } return src; } if («VIDEO» === node.tagName) { var sources = node.childNodes, length = sources.length, sourceElement, src ,type; if (!node.canPlayType){ return false; } for (var i = 0; i < length; i++) { sourceElement = sources[i]; if («SOURCE» === sourceElement.nodeName) { type = sourceElement.getAttribute(«type»); if (node.canPlayType(type)) { src = sourceElement.getAttribute(«src») || false; each(node.getElementsByTagName(«embed»), checkExcludes); each(node.getElementsByTagName(«object»), checkExcludes); return src; } } } src = node.getAttribute(«src»); return src; } else { src = node.getAttribute(«src»); if (src != null && src.substring(0, 10) !== 'data:image') { src = node.getAttribute(«src»); } else { if (src && src.substring(0, 10) == 'data:image') { return CONFIG[«juke_host»] || null; } else { return null } } } return src; } function emit (event, data) { each(subscribers[event], function (func) { if (ENABLE_CONSOLE) { console.log(«fire callback»); } data = func.call(this, data); }); return data; } // Classes /** * A message. * @constructor */ function CM_Message(type, obj) { var that = this; function init () { function addonReady(e) { if («AddonCMeterReady» !== e.data) { return; } window.removeEventListener(«message», addonReady, false); that.initialize(emit(«init_» + type)); } // XXX: Google Chrome extension workaround. if ((window.localStorage && «initializing» === localStorage.getItem(«AddonCMeter»)) || (window.sessionStorage && «initializing» === sessionStorage.getItem(«AddonCMeter»)) ) { window.addEventListener(«message», addonReady, false); } else { that.initialize(emit(«init_» + type)); } } on(window, 'beforeunload', function(e) { that.doNotSendError = true; }); if (arguments.length >= 2) { extend(this, obj, true); } /** * `params` must be an array, but may have additional own properties. * They will be sent along w/ ordinary array items. * * For instance, consider the following: * var params = ["~param1~", 2]; * params.customKey = «customVal»; * * This will send following message: * param1: "~param1~" * param2: 2 * customKey: «customVal» */ this.params = this.params || []; this.params[0] = "~cm_" + type + "~"; // since code of cm.js is executed exactly before //
26.03.15
1 ответ

Ответы

через год будет смена места жительства
26.03.15

✅Настасья Павловна✅

Сейчас на сайте
Читать ответы

Ксения

Сейчас на сайте
Читать ответы

Неонила

Сейчас на сайте
Читать ответы
Посмотреть всех экспертов из раздела Эзотерика
Пользуйтесь нашим приложением Доступно на Google Play Загрузите в App Store