function PollResults()
{
  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;
     }
   }
  
   return checkedAnswerId;
 }
 
function SubmitForm(currentPage, itemCount)
{
         document.getElementById( 'hfCurrentNewsPage' ).value = currentPage;
         document.getElementById( 'hfNewsItem' ).value = itemCount;
  
           
        var theForm = document.forms[0];
        if ( !theForm )
        {
            theForm = document.form;
        }
        
        if ( !theForm.onsubmit || (theForm.onsubmit() != false) )
        {
            theForm.submit();
        }
}
function Submit(currentPage, itemCount)
{
         document.getElementById( 'hfCurrentGalleryPage' ).value = currentPage;
         document.getElementById( 'hfGalleryItem' ).value = itemCount;
  
           
        var theForm = document.forms[0];
        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 = "";
    }
}

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();
        }
}