function ViewPollResults(afterVoting, siteUrl)
{
  var rbgAnswers = document.getElementsByName("IDAnketaOdgovor");

  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 = siteUrl + "/PollResults.aspx?PollId=" + pollId.value + "&AnswerId=" + checkedAnswerId;
  }
  else
  {
    window.location.href = siteUrl + "/PollResults.aspx?PollId=" + pollId.value;
  }
}

 function OpenQueryForm( url )
{
window.location.href = url;
return false;
}


function ClearTextInTextbox(textBoxID, defaultText)
{
    var textBox = document.getElementById( textBoxID );
    if ( textBox == null )
    {
        return;
    }

    if ( textBox.value == defaultText)
    {
        textBox.value = "";
    }
}


function Submit(currentPage)
{
         document.getElementById( 'hfCurrentNewsPage' ).value = currentPage;
  
           
        var theForm = document.forms[0];
        if ( !theForm )
        {
            theForm = document.form;
        }
        
        if ( !theForm.onsubmit || (theForm.onsubmit() != false) )
        {
            theForm.submit();
        }
}