function show_rates (index) {
  var node;
  
  node = document.getElementById ('rates_on_' + index);
  node.style.display = 'none';
  
  node = document.getElementById ('rates_off_' + index);
  node.style.display = '';
  
  node = document.getElementById ('rates_' + index);
  node.style.display = '';
}

function hide_rates (index) {
  var node;
  
  node = document.getElementById ('rates_on_' + index);
  node.style.display = '';
  
  node = document.getElementById ('rates_off_' + index);
  node.style.display = 'none';
  
  node = document.getElementById ('rates_' + index);
  node.style.display = 'none';
}


// User rating stuff
$(document).ready(function() {
  $('div.accom-types-body').hide();
  $('div.accom-types-header').click(function() { $(this).next().toggle(); }).css('cursor', 'pointer');
  $('div.accom-types:first').before('<p>Click on an accommodation type for more information</p>');
  
  
  if (location.hash == '#accommodation') {
    location.href = friendly_url + '/accommodation';
  } else if (location.hash == '#activities') {
    location.href = friendly_url + '/activities';
  } else if (location.hash == '#review') {
    location.href = friendly_url + '/reviews';
  } else if (location.hash == '#specials') {
    location.href = friendly_url + '/specials';
  }
  
  
  $('#overview-description a[href*=#]').click(function() {
    var idx = $(this).attr('href').lastIndexOf('#');
    var hash = $(this).attr('href').substr(idx);
    
    if (hash == '#accommodation') {
      location.href = friendly_url + '/accommodation';
      return false;
      
    } else if (hash == '#activities') {
      location.href = friendly_url + '/activities';
      return false;
      
    } else if (hash == '#review') {
      location.href = friendly_url + '/reviews';
      return false;
      
    } else if (hash == '#specials') {
      location.href = friendly_url + '/specials';
      return false;
      
    }
  });
});

