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 SendQuery( url )
{
window.location.href = url;
}


function OpenProduct( url )
{
window.location.href = url;
}

function AdjustMenu2( submenu )
{
  var uls = document.getElementsByTagName('ul');
  
  for (i = 0; i < uls.length; i++)
  {
     var ul = uls[i];
     var ulid = ul.getAttribute('id');
     if (ulid && ulid.match('subMenu'))
     {
        ul.style.display='none';
     }
  }
  document.getElementById(submenu).style.display=(document.getElementById(submenu).style.display=='none'?'':'none');
}
 
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 AdjustMenu( submenu )
{
  var uls = document.getElementsByTagName('ul');
  
  for (i = 0; i < uls.length; i++)
  {
     var ul = uls[i];
     var ulid = ul.getAttribute('id');
     if (ulid && ulid.match('subMenu') && ulid != submenu)
     {
        ul.style.display='none';
     }
  }
  document.getElementById(submenu).style.display=(document.getElementById(submenu).style.display=='none'?'':'none');
}


function OpenProduct( url )
{
window.location.href = url;
}



function ClearTextInTextbox(textBoxID, defaultText)
{
    var textBox = document.getElementById( textBoxID );
    if ( textBox == null )
    {
        return;
    }

    if ( textBox.value == defaultText)
    {
        textBox.value = "";
    }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
