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.open(siteUrl + '/PollResults.aspx?PollId=' + pollId.value + '&AnswerId=' + checkedAnswerId,'','scrollbars=yes,width=590,height=520');
     
   }
   else
   {
      window.open(siteUrl + '/PollResults.aspx?PollId=' + pollId.value,'','scrollbars=yes,width=590,height=520');
   }
 }


function AddProductToBasket(productId)
{
        var hidProductId = document.getElementById( 'hidProductId' );
         var hidAmount = document.getElementById( 'hidAmount' );
       



        if ( hidProductId == null )
        {
            return;
        }
        
        hidProductId.value = productId;
        hidAmount.value = document.getElementById( 'txt' + productId ).value;
       

       
       
        
        var theForm = document.forms['aspnetForm'];
        if ( !theForm )
        {
            theForm = document.form;
        }
        
        if ( !theForm.onsubmit || (theForm.onsubmit() != false) )
        {
            theForm.submit();
        }
}

function ClearTextInTextbox(textBoxID, defaultText)
{
    var textBox = document.getElementById( textBoxID );
    if ( textBox == null )
    {
        return;
    }

    if ( textBox.value == defaultText)
    {
        textBox.value = "";
    }
}


