﻿if (typeof(ReForma)=="undefined") ReForma = {};
if (typeof(ReForma.Controls)=="undefined") ReForma.Controls = {};

ReForma_Controls_Scripts_Class = function() {};
ReForma_Controls_Scripts_Class.prototype = {
  AjaxLoadPoll: function(__callback) {
    jQuery.ajax({
       type: "POST",
       url: ReForma.Controls.Scripts.invokeUrl,
       data: __TO_JSON({
         "__METHOD": "AjaxLoadPoll" 
       }),
       contentType: "text/plain",
       success: function(data, status) {
         var obj = null;
         eval('obj = ' + data + '*' + '/');
         if (__callback) __callback(obj, status);
       }
     })
  },
  AjaxVotePoll: function(__poll_id, __answer_id, __callback) {
    jQuery.ajax({
       type: "POST",
       url: ReForma.Controls.Scripts.invokeUrl,
       data: __TO_JSON({
         "__METHOD": "AjaxVotePoll" 
         , "poll_id": __poll_id         , "answer_id": __answer_id       }),
       contentType: "text/plain",
       success: function(data, status) {
         var obj = null;
         eval('obj = ' + data + '*' + '/');
         if (__callback) __callback(obj, status);
       }
     })
  },
  AjaxSkipPoll: function(__poll_id, __callback) {
    jQuery.ajax({
       type: "POST",
       url: ReForma.Controls.Scripts.invokeUrl,
       data: __TO_JSON({
         "__METHOD": "AjaxSkipPoll" 
         , "poll_id": __poll_id       }),
       contentType: "text/plain",
       success: function(data, status) {
         var obj = null;
         eval('obj = ' + data + '*' + '/');
         if (__callback) __callback(obj, status);
       }
     })
  },
  AjaxMessageDelete: function(__message_id, __callback) {
    jQuery.ajax({
       type: "POST",
       url: ReForma.Controls.Scripts.invokeUrl,
       data: __TO_JSON({
         "__METHOD": "AjaxMessageDelete" 
         , "message_id": __message_id       }),
       contentType: "text/plain",
       success: function(data, status) {
         var obj = null;
         eval('obj = ' + data + '*' + '/');
         if (__callback) __callback(obj, status);
       }
     })
  },
  invokeUrl: "/AjaxType.ashx?type=ReForma.Controls.Scripts&t=634085145637734455"
};

ReForma.Controls.Scripts = new ReForma_Controls_Scripts_Class();
