function WebPartVote(Id, submitUrl) {    
    var objThis = this;    
    this.Id = Id;
    this.ActionValue = submitUrl;
    this.Selected = false;
    
    this.ObjAnswer = $(this.Id + "_answers");
    this.ObjSubmitButton = $(this.Id + "_submit");
    
    this.ObjSubmitButton.addEvents({
        'click': function(event){          
	        objThis.SubmitForm();
        }
    });

    this.SubmitForm = function() {
        var temp = 0;
        for (temp = 0; temp < items.length; temp++)
            if (items[temp].checked == true)
        { var rez_id = items[temp].value; break; }

        var answers = objThis.ObjAnswer.getElementsByTagName("input");        
        for (var i = 0; i < answers.length; i++) {
            if (answers[i].checked == true) {
                this.Selected = true;
                break;
            }
        }

        var f = new Array(0);
        f[0] = { name: 'pool_rez', value: rez_id };
        __doCallBack(this.Id, "Vote", function(responseText, responseXML, context) {
            if (context.Selected == true && context.ActionValue) {
            /*
                theForm.action = context.ActionValue;
            */
                theForm.submit();
            }
        }, f, this);
    };
};



