function ViewPollResults(afterVoting) {
    var rbgAnswers = document.getElementsByName("rbgAnswers");
    var pollId = document.getElementById("hfPollId");
    var checkedAnswerId;
    for (i = 0; i < rbgAnswers.length; i++) {
        if (rbgAnswers[i].checked) {
            checkedAnswerId = rbgAnswers[i].value;
            break;
        }
    }

    if (afterVoting) {
        window.location.href = 'PollResults.aspx?pl=' + pollId.value + '&ans=' + checkedAnswerId;
    }
    else {
        window.location.href = 'PollResults.aspx?pl=' + pollId.value;
    }

}

function NavigateToPage(pageNumber, contentType) {
    var hfCurrentPage;
    if (contentType == 'Product') {
        hfCurrentPage = document.getElementById('ctl00_cphMain_hfCurrentProductPage');
    }

    hfCurrentPage.value = pageNumber;
    SubmitForm();
}

function SubmitForm() {
    var theForm = document.forms[0];
    if (!theForm) {
        theForm = document.form;
    }

    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.submit();
    }
}


