function getRPCHTML(module,action,arg,id) {
	var url = 'index.php';
	var pars = 'do='+module+'&action='+action+'&arg='+arg;
    var myAjax = new Ajax.Updater({success: id} , url, { method: 'post', postBody: pars, asynchronous:true, evalScripts:true, onFailure: reportError });
}
function getRPCForm(module,action,frm,id) {
	str = getForm(frm);
	var url = 'index.php';
	var pars = 'do='+module+'&action='+action+'&frm='+str;
    var myAjax = new Ajax.Updater({success: id} , url, { method: 'get', parameters: pars,asynchronous:true, evalScripts:true, onFailure: reportError });
}
function getForm(fobj) { 
  var str = ""; 
  var ft = ""; 
  var fv = ""; 
  var fn = ""; 
  var els = ""; 
  for(var i = 0;i < fobj.elements.length;i++) { 
	els = fobj.elements[i]; 
	ft = els.title; 
	fv = els.value; 
	fn = els.name; 
	switch(els.type) { 
		case "text": 
		case "hidden": 
		case "password": 
		case "textarea": 
	    	str += fn + "=" + encodeURI(fv) + "&";  
   		break;   
   
	   case "checkbox":  
	   case "radio":  
	   if(els.checked) str += fn + "=" + encodeURI(fv) + "&";break;      
   
	  case "select-one":  
	     str += fn + "=" +  
	     els.options[els.selectedIndex].value + "&";  
	  break;  
   } // switch  
  } // for  
  str = str.substr(0,(str.length - 1));  
  return str;  
}  
function reportError(request) {
	alert('Sorry. There was an error.  Try again / Une erreur est survenu.  Essayez encore'+request);
}
