// Simple function to operate the tabs on the front page.
var tabA
var tabB
var contA
var contB
// Remove class from string and preserve any other assigned classes
function removeClass(str) {
  if (str.indexOf('on') != -1) {
    str = str.replace('on','');
  }
  return str;
}
// Swap out the classes/styles
function tabber(tab) {
  if (tab == 'A') {
    tabA.className += ' on';
    tabB.className = removeClass(tabB.className);
    contA.style.display = 'block';
    contB.style.display = 'none';
    tabA.blur();
  }
  if (tab == 'B') {
    tabA.className = removeClass(tabA.className);
    tabB.className += ' on';
    contA.style.display = 'none';
    contB.style.display = 'block';
    tabB.blur();
  }
}
// Initialise
window.onload = function() {
  contA = document.getElementById('home_search_A');
  contB = document.getElementById('home_search_B');
  tabA = document.getElementById('tabA');
  tabB = document.getElementById('tabB');
}

