var translator = { run: function(translationLanguage, translationTextarea, masterKey, categoryID) { var options = { 'call' : '_google_translation', 'key': masterKey, 'translation': translationLanguage, 'category' : categoryID }; var ajax = new sack(DOKU_BASE + 'lib/exe/ajax.php'); ajax.AjaxFailedAlert = function() {}; ajax.encodeURIString = true; ajax.onCompletion = function() { $(translationTextarea).value = ajax.response; }; for ( var option in options) { if ( option === null ) { continue; } ajax.setVar(option, options[option]); } try { ajax.runAJAX(); } catch (e) {} } };