function refresh(t) {
  /*
  some ajax code ....
  TODO: attualmente utilizzo sack
  (http://twilightuniverse.com/2005/05/sack-of-ajax/)
  in futuro andrebbe sostituito con qualcosa di pił evoluto
  capace magari di gestire anche xmlrpc ....
  ... qual'e' lo standard di zope/plone ?
  */
  ajax = new sack("portlet_queuestatus");
  ajax.element="portlet_queuestatus";
  // ajax.onCompletion = function() { deferRefresh(ajax,t); };
  ajax.onCompletion = function() { window.setTimeout("refresh("+t+")",t); };
  ajax.runAJAX("nodiv=1");
}

function deferRefreshStatus(ajax,t) {
  window.setTimeout("refresh("+t+")",t);
}
function uriimg(c,s,x) {
  if (document.getElementById) {
    // s = Math.min(parseInt(s),parseInt(x)-50);
    x = Math.min(parseInt(x),700);
    document.getElementById('i').src="image_view?ourcode="+c+"&amp;start="+s+"&amp;x="+x;
    document.getElementById('z').src="image_view?ourcode="+c+"&amp;start="+s+"&amp;x="+x+"&amp;zoom=1";
    document.getElementById('zrewind').x.value=Math.max(parseInt(x)-20,190);
    document.getElementById('zfastforward').x.value=Math.min(Math.min(parseInt(x)+20,690),parseInt(document.getElementById('lseq').value)+90);
    document.getElementById('rewind').start.value=Math.max(parseInt(s)-200,0);
    document.getElementById('fastforward').start.value=Math.min(parseInt(s)+200,parseInt(document.getElementById('lseq').value));
    document.getElementById('formimg').start.value=s;
    document.getElementById('zbegin').start.value=s;
    document.getElementById('zrewind').start.value=s;
    document.getElementById('zfastforward').start.value=s;
    document.getElementById('zend').start.value=s;
    return false;
  }
  return true;
}
