function getContentGroup() {
  var url    = document.URL;
  var domain = document.domain;
  if (domain.match(/cmc?kb.cellmigration.org/))
    return 'Knowledgebase';

  var path = url.replace('http://'+domain+'/','');
  var cg
    = path == '' || path.match(/^index.shtml/)     ? 'Home'
    : path.match(/^science\//)                     ? 'Migration 101'
    : path.match(/^cmcnews\//)                     ? 'News'
    : path.match(/^cmg_update\/conferences.shtml/) ? 'Conferences'
    : path.match(/^resource\//)                    ? 'CMC Activity Center'
    : path.match(/^(?:aboutus|consortium)\//)      ? 'Consortium'
    : path.match(/^(?:sitemap.shtml|cmg_update\/rss.rdf|cmg_update\/ealert\/)/) ? 'Site Admin'
    : path.match(/^cmg_update\//)                  ? 'Updates'
    :                                                'Other';
  return cg;
}

function getContentSubGroup() {
  var url = document.URL;
  var domain = document.domain;
  if (domain.match(/cmc?kb.cellmigration.org/))
    return;

  var head = 'http://'+domain+'/resource/';
  if (! url.match(head))
    return;

  var path = url.replace(head,'');
  var csg
    = path == '' || path.match(/^index.shtml/) ? 'Home'
    : path.match(/^bioinformatics/)            ? 'Bioinformatics'
    : path.match(/^biomaterials/)              ? 'Biomaterials'
    : path.match(/^communications/)            ? 'Communications'
    : path.match(/^discovery/)                 ? 'Discovery'
    : path.match(/^imaging/)                   ? 'Imaging_Photomanipulation'
    : path.match(/^modeling/)                  ? 'Modeling'
    : path.match(/^biosensors/)                ? 'Biosensors'
    : path.match(/^structure/)                 ? 'Structures'
    : path.match(/^komouse/)                   ? 'Transgneic_Knockout_Mice'
    : path.match(/^proteomics/)                ? 'Proteomics'
    :                                            'Other';
  return csg;
}
