﻿
	function Poll(pollid) {
        if (ISLOGIN == "True") {
            $('.' + "optionclass" + pollid).hide();

            var answer = $("input[@name='option" + pollid + "']:checked").val();

            $('#pollloading' + pollid).show();
            $.ajax({
                type: 'GET',
                url: "ajax/Poll.ashx",
                data: "action=addanswer&pollid=" + pollid + "&answer=" + answer,
                success: function(elCevap) {
                    $('#poll' + pollid).html(elCevap);
                }
            });
        } else {
        $('#loginmessage' + pollid).show();
        
        }
    }
    
    var current = 0;
    function ShowHide(pollid) {
        $('#poll' + current).toggle("fold", {},2000); 
        $('#poll' + pollid).toggle("fold", {},2000);
        current = pollid;
        if (eval("IsPolled" + pollid) == 1) {
            $.ajax({
                type: 'GET',
                url: "ajax/Poll.ashx",
                data: "action=onlyanswer&pollid=" + pollid,
                success: function(elCevap) {
                    $('#poll' + pollid).html(elCevap);
                }
            });
        }
    }


