function ViewPollResults(siteUrl)
{
  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;
    }
  }
  window.location = siteUrl + '/PollResults.aspx?pl=' + pollId.value + '&ans=' + checkedAnswerId;
}

function AddProductToBasket(productId)
{
        var hidProductId = document.getElementById( 'hidProductId' );
        if ( hidProductId == null )
        {
            return;
        }
        
        hidProductId.value = productId;
        
        var theForm = document.forms['aspnetForm'];
        if ( !theForm )
        {
            theForm = document.form;
        }
        
        if ( !theForm.onsubmit || (theForm.onsubmit() != false) )
        {
            theForm.submit();
        }
}

function NavigateToPage(pageNumber)
{
  var hfCurrentPage;
  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();
        }
}
