var selected;
if (Drupal.jsEnabled) {
  $(document).ready(function() {
    pathArray = window.location.pathname.split( '/' );
    if (pathArray[1] == 'home'  || pathArray[2] == 'home' || pathArray[2] == '') {
      $('a[@href="/home"]').parent().attr('class', 'navItemSelected');
    }else 
    if (pathArray[1] == ''  || pathArray[2] == '') {
      $('a[@href="/training/"]').parent().attr('class', 'navItemSelected');
    }else 
    if (pathArray[1] == 'the_experts' || pathArray[2] == 'the_experts') {
      $('a[@href$="the_experts"]').parent().attr('class', 'navItemSelected');
    }else 
    if (pathArray[1] == 'online_training' || pathArray[2] == 'online_training' ) {
      $('a[@href$="online_training"]').parent().attr('class', 'navItemSelected');
    }else 
    if (pathArray[1] == 'resources' || pathArray[2] == 'resources') {
      $('a[@href$="resources"]').parent().attr('class', 'navItemSelected');
    }else 
    if (pathArray[1] == 'contact_us' || pathArray[2] == 'contact_us') {
      $('a[@href$="contact_us"]').parent().attr('class', 'navItemSelected');
    }else 
    if ((pathArray[1] == 'topics') || (pathArray[2] == 'topics') || (pathArray[1] == 'sections') || (pathArray[2] == 'sections') ||
        (pathArray[1] == 'node') || (pathArray[2] == 'node') || (pathArray[1] == 'trainings') || (pathArray[2] == 'trainings') ) {
      $('a[@href$="trainings"]').parent().attr('class', 'navItemSelected');
    }

  });
}

function jumper() {
  var selectedItem = document.jumpToTraining.trainingID.selectedIndex;
  var selectedTrainingID = document.jumpToTraining.trainingID.options[selectedItem].value;
  window.location = 'http://www.globaltobaccocontrol.org/topics/' + selectedTrainingID;
}


