/* news and events tabs */
function monObj() {
  var dateObj = new Date();
  var mon = "";
  var currentMonth = dateObj.getMonth();
  
  return currentMonth;
}

/* news and events tabs */
function getMon()
{
  var currentMonth = monObj();
  
  switch (currentMonth)
  {
	case 0:
	mon = "Jan";
	break;
	case 1:
	mon = "Feb";
	break;
	case 2:
	mon = "Mar";
	break;
	case 3:
	mon = "Apr";
	break;
	case 4:
	mon = "May";
	break;
	case 5:
	mon = "Jun";
	break;
	case 6:
	mon = "Jul";
	break;
	case 7:
	mon = "Aug";
	break;
	case 8:
	mon = "Sep";
	break;
	case 9:
	mon = "Oct";
	break;
	case 10:
	mon = "Nov";
	break;
	case 11:
	mon = "Dec";
	break;
	default:
	mon="Jan";
  }
  
  return mon;
}

/* general tabs */
function tabs() {
  $('.pane').hide();
  
  if ( $('.months').length )
  {
	var mon = getMon();
	var currentMonth = monObj();
	
	$('.tabs li a:contains('+mon+')').addClass('active');
	var monTab = $('.tabs li a:contains('+mon+')').attr('href');
    $(monTab).show();
  }
  else
  {
	$('.tabs li a:last').addClass('active');
	var lastTab = $('.tabs li a:last').attr('href');
    $(lastTab).show();
  }
  
  $('.tabs li a').click(function(){
    $('.tabs li a').removeClass('active');
    $(this).addClass('active');
    var currentTab = $(this).attr('href');
    $('.pane').hide();
   $(currentTab).show();
    return false;
  });
}

/* go */
$(document).ready(function() {
    tabs();
});