function $(id)
{
 return document.getElementById(id);
}

function applyText(obj,text)
{
 $(obj).innerHTML=text;
}

function ajaxFunction(dist,query,text) {
var maxtimeout=60*2*1000;
AjaxRequest.get(
  {
    'url':query
    ,'onLoading':function() { applyText(dist,text); }
    ,'onLoaded':function() {  }
    ,'onInteractive':function() {  }
    ,'onComplete':function() {  }
    ,'onSuccess':function(req) { applyText(dist,req.responseText); }
    ,'onError':function() { applyText(dist,"Error!"); }
    ,'timeout':maxtimeout
    ,'onTimeout':function() { applyText(dist,"Error!"); }
  }
);}

