function getText(el) {
  var text = "";
  if (el != null) {
    if (el.childNodes) {
      for (var i = 0; i < el.childNodes.length; i++) {
        var childNode = el.childNodes[i];
        if (childNode.nodeValue != null) {
          text = text + childNode.nodeValue;
        }
      }
    }
  }
  return text;
}


function showResponse(req)
{
	$('update').innerHTML = req.responseText;
}	



function init() {
	var antal = getText($('antal'));
	var pars = 'antal=' + antal;

	var ajax = new Ajax.PeriodicalUpdater(
         'update',    
         'update.php',
         {            
	         method:'get',
			 parameters: pars, 
             onComplete: showResponse,
             asynchronous:true,
             frequency:60
         });

}

Event.observe(window, 'load', init, false); //
