function GO(id) {
  return document.getElementById(id);
}
function updateCounter() {
  if (!counterLoading) {
    var obj = GO("LiveInternet");
    if (obj) obj.src = obj.src.replace(/;[0-9\.]+$/,";"+Math.random());
  }
}

$(document).ready( function() {
  var fBox1 = parseInt($(".right").css("top").substring(0,$(".right").css("top").indexOf("px")));
 
  $(window).scroll( function() { 
    var scroll = $(document).scrollTop();
    var offset1 = (scroll<fBox1?fBox1:1) + scroll + "px";
    $('.right').animate(
      { top: offset1 },
      { 
        duration: 700,
        queue: false
      }
    );
  });
});


function add_teasernet() {
  if (typeof teasernet != 'undefined' && typeof teasernet_blocks_exists == 'undefined') {
    for (var blockid in teasernet) {
      var newScr = document.createElement('script'); newScr.type = 'text/javascript';
      newScr.src = 'http://echo.teasernet.ru/step1.php?blockid=' + blockid + '&padid=' + teasernet[blockid].padid + '&count=' + (teasernet[blockid].hor * teasernet[blockid].ver) + '&ref=' + escape(document.referrer) + '&' + Math.round(Math.random() * 100000);
      var el = document.getElementById('teasernet_' + blockid); 
      if (el) { el.appendChild(newScr); }
    }
    var teasernet_blocks_exists = true;
  }
}
