$(document).ready(function(){
  $("#logintoggler").accordion({
    clearStyle: true,
    autoHeight: false,
    header: "a.toggler"
  });

  $('#superlogintoggler li').click(
    function(){
      var id = $(this).attr('id').replace('_opener', '');
      if ( $('.displayfield:first').attr('id') == id ) {
          return false;
      }
      $('#logintoggled .displayfield').fadeOut('fast', function(){
      $(this).removeClass('displayfield').addClass('hidefield');
      $('#superlogintoggler li.active').removeClass('active');
      $('#'+id).fadeIn('fast', function(){
        $('#'+id+'_opener').addClass('active');
        $(this).addClass('displayfield');
              });
          })
          return false;
        }
      );

  $('#toggler div.infobox a').click(
    function(){
      window.location = $(this).attr("href");
      return false;
    }
  );

  $('#toggler li').click(
    function(){
      var id = $(this).attr('id').replace('_opener', '');
      if ( $('.displayfield:first').attr('id') == id ) {
          return false;
      }
      $('#toggled .displayfield').hide(1, function(){
        $(this).removeClass('displayfield').addClass('hidefield');
        $('#toggler li.active').removeClass('active');
          $('#'+id).show(1, function(){
            $('#'+id+'_opener').addClass('active');
            $(this).addClass('displayfield');
          });
      })
      return false;
    }
  );
});

function hestefakta_starttype(select) {
  if (select.value == 1) {
    $('#sok_spor .rekke').show();
  } else {
    $('#sok_spor .rekke').hide();
    if ($('#sok_spor').val() == "111" || $('#sok_spor').val() == "222") {
      $('#sok_spor').val(0);
    }
  }
}





