function toggleSection(id) {
  var cur = document.getElementById(id);
  var linkName = id + "Link";
  var link = document.getElementById(linkName);
  if (cur.style.display == 'inline') {
    cur.style.display = 'none';
    link.innerHTML = link.innerHTML.replace(/collapse/,"expand");
    link.className = 'linkCollapsed';
  } else {
    cur.style.display = 'inline';
    link.innerHTML = link.innerHTML.replace(/expand/,"collapse");
    link.className = 'linkExpanded';
  }
}

// I only want the recommendations block to display in the 'long'
// printed version
function hideRecommendationsBlock() {
  var rec = document.getElementById('recommendations');
  rec.style.display = '';
  rec.className = 'inPrintVersionOnly pageBreakForPrint';
}

function setOptional(status) {
  // it's not that these sections aren't important, but they're
  // not critical to the average engineer who might be interviewing
  var optionalSections = [
    'lessRecentEmployment',
    'publications',
    'patents',
    'recommendations',
    'references',
  ];
  for(i=0; i<optionalSections.length; i++) {
    var id = document.getElementById(optionalSections[i]);
    var link = document.getElementById(optionalSections[i] + "Link");
    id.style.display = status;
    link.style.display = status;
  }
}

function shortVersion() {
  setOptional('none');
  document.getElementById('shortVersion').className = 'hideLink';
  document.getElementById('longVersion').className = 'showLink';
}

function longVersion() {
  setOptional('inline');
  hideRecommendationsBlock();
  document.getElementById('shortVersion').className = 'showLink';
  document.getElementById('longVersion').className = 'hideLink';
}

