if (window.location.pathname == '/resources/other-resources')
  window.location = '/resources/juveniles#rr';

function go()
{
  box =  $$('select[name=navi]')[0]
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}


jQuery.noConflict();
function trackPage(element)
{
  try {
    if (typeof(_gaq) != 'undefined') {
      text = element == null ? "" : element.pathname + element.hash; 
      _gaq.push(['_trackPageview', text]);
    }
  } catch(e) {}

}

function trackEvent(element)
{
  try {
    if (typeof(_gaq) != 'undefined') {
      text = element == null ? "" : element.pathname + element.hash;
      _gaq.push(['_trackEvent', "TabView", window.location.pathname, text]);
    }
  } catch(e) {}

}

jQuery(document).ready(function(){
    try {
    trackPage(jQuery('ul.tabNav a')[0]);

    jQuery('ul.tabNav a').click(function() {
      trackPage(this);
      var curChildIndex = jQuery(this).parent().prevAll().length + 1;
      jQuery(this).parents('ul').children().removeClass('current');
      jQuery(this).parent().addClass('current');
      jQuery(this).parents('ul').siblings('.tabContainer').children('.current').slideUp('fast',function() {
        jQuery(this).removeClass('current');
        jQuery(this).parent().children('div:nth-child('+curChildIndex+')').slideDown('normal',function() {
          jQuery(this).addClass('current');
          });
          });
        return true;        
        });

      var href = jQuery('ul.tabNav a:first').attr('href');
      var selected = (window.location.hash || href)
      jQuery('.tabContainer ' + selected).addClass('current');
      jQuery('ul.tabNav a[href='+selected+']').parent().addClass('current');
    } catch(e) {}
});  


jQuery(document).ready(function() {
  try {
  jQuery('a').click(function(){
    if (typeof(_gaq) != 'undefined') {
      var href = jQuery(this).attr('href');
      var attr = href.match(/\..+$/) ? '/downloads' : '/outgoing';

      _gaq.push(['_trackEvent', 'links', attr, href]);
      }
    });
  } catch(e) {}
  });

