var refresh;
var bannerGroup  = 'all_468x60';
var m3_r = Math.floor(Math.random()*99999999999);

function getWindowHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    myHeight = window.innerHeight;
  }
  else {
    if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      myHeight = document.documentElement.clientHeight;
    }
    else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        myHeight = document.body.clientHeight;
      }
    }
  }
  return myHeight;
}

function placeContainer() {
  var el;
  var scrollFromTop = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
  if (el = document.getElementById('hosting_banner_'+m3_r)) {
    el.style.top=(getWindowHeight()+scrollFromTop-70)+'px';
  }
}            


//document.write("<script type='text/javascript' src='http://z.times.lv/times_banner.php?zKey=" + bannerGroup + "&zH=" + randomNum + "'></script>");

var m3_u = 'http://x.times.lv/delivery/ajs_hosting.php';
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=49&amp;charset=Windows-1251");
document.write ('&amp;cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
document.write ('&amp;charset=Windows-1251');
document.write ("&amp;loc=" + escape(window.location));
if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
document.write ("'><\/scr"+"ipt>");




var pp_gemius_identifier = new String('.ReQBOb74wX.SPDbqmxmz3YZ35hZ9W9_5PcdfeldXr..j7');
document.write ("<scr"+"ipt type='text/javascript' src='http://www.times.lv/global/js/xgemius.js");
document.write ("'><\/scr"+"ipt>");


(function(){
if(window.smartad_space)smartad_space+=',1049';
else{smartad_space='1049';
var f=function(){var h=document.getElementsByTagName('head')[0],s=document.createElement('script');
s.src=location.protocol+unescape('//ad.smartad.lv/script.php%3fv=2%26space=')+smartad_space+unescape('%26refurl=')+escape(document.referrer)+unescape('%26pageurl=')+escape(document.location);
h.insertBefore(s, h.firstChild);}
if(window.addEventListener)window.addEventListener('load',f,false);
else if(window.attachEvent)window.attachEvent('onload',f);
}})();



refresh = setInterval(placeContainer,50);
window.onscroll = function() { placeContainer() }


