window.loadTitles = function(){};
function renderTitles(e)
{
if ('title' in e && 'val' in e.title)
{
var titles = document.getElementById('tpinformer');
if (!titles) return;
var buf = '
';
buf += 'Top.Mail.Ru';
titles.innerHTML = buf;
}
window.setTimeout(window.loadTitles, 1000);
}
(function () {
function chain(function1, function2) {
return function() {
if (function1) function1();
if (function2) function2();
};
}
function onload()
{
var e = document.getElementById("tpinformer");
if (!e) return;
var cid = e.getAttribute("cid");
if (!cid) return;
window.loadTitles = function()
{
var d = document;
var ts = d.createElement("script"); ts.type = "text/javascript"; //ts.async = true;
ts.setAttribute("id", "jsonpinformer");
ts.src = "https://top-informer.mail.ru/informer?id=" + cid + "&_=" + Math.floor(new Date().valueOf() / 1000);
var existingScript = document.getElementById('jsonpinformer');
if (!existingScript)
{
var s = d.getElementsByTagName("script");
s = s[s.length-1];
s.parentNode.insertBefore(ts, s.nextSibling);
}
else
{
existingScript.parentNode.replaceChild(ts, existingScript);
}
};
window.loadTitles();
}
if(document.readyState === 'complete') onload(); //async loading: the onload might have been fired already (?)
else window.onload = chain(window.onload, onload);
})();