function Check()
{ 
  PageMethods.GetLatestHeadlineTick(OnSucceeded, OnFailed);  
}

function OnSucceeded(result, userContext, methodName)
{  
  var LatestTick = parseInt(result);
  var LatestDisplayTick = parseInt($get('LatestDisplayTick').value); 

  if (LatestTick > LatestDisplayTick)
  {
    __doPostBack('up1', '');         
    }
  else
  { setTimeout("Check()", 10000);}
}

// Stub to make the page method call happy.
function OnFailed(error, userContext, methodName) {}

function pageLoad()
{
  // On initial load and partial postbacks, 
  //  check for newer articles in five seconds.
  setTimeout("Check()", 10000);
}
