window.addEvent('domready', function() {
  updateNotify();
  var intervalID = updateNotify.periodical(20000);
});
function updateNotify(){
  var cUpdates = new Request({
    method: "get",
    url: "misc_js.php?task=updates",
    onComplete: function(response) {
      if (response > 0) {
        $('newupdates').setStyle('display', 'block');
        $('notify_total').set('html',response);
      } else if ($('newupdates')) {
        $('newupdates').setStyle('display', 'none');
      }
    }
  }).get();
}
