Index: branches/RC/themes/default2007/platform/inc/ajax.js =================================================================== diff -u -N -r11248 -r11324 --- branches/RC/themes/default2007/platform/inc/ajax.js (.../ajax.js) (revision 11248) +++ branches/RC/themes/default2007/platform/inc/ajax.js (.../ajax.js) (revision 11324) @@ -237,4 +237,27 @@ RatingManager.prototype.errorCallback = function($request, $params, $object) { alert('AJAX Error; class: RatingManager; ' + Request.getErrorHtml($request)); +} + +function PollManager ($url) { + this.Url = $url; + this.BusyRequest = false; +} + +PollManager.prototype.makeVote = function ($prefix, $poll_id, $option_id) { + var $url = this.Url.replace('#PREFIX#', $prefix).replace('#POLL_ID#', $poll_id).replace('#OPTION_ID#', $option_id); + Request.makeRequest($url, this.BusyRequest, '', this.successCallback, this.errorCallback, [$poll_id, $option_id], this); +} + +PollManager.prototype.successCallback = function ($request, $params, $object) { + var response = $request.responseText; + if (response.substring(0, 5) == '@err:') { + alert(response.substring(5)); + return ; + } + document.getElementById('pollvote_' + $params[0]).innerHTML = response; +} + +PollManager.prototype.errorCallback = function($request, $params, $object) { + alert('AJAX Error; class: PollManager; ' + Request.getErrorHtml($request)); } \ No newline at end of file