jQuery.getScript(location.protocol + '//s7.addthis.com/js/250/addthis_widget.js#pubid=wp-4e66d7344f903e1f');
jQuery.getScript(location.protocol + '//cdn.printfriendly.com/printfriendly.js');
jQuery(function($) {

  $('.mainnav li:first').remove();

  $('.mainnav>ul').superfish();

  $('a.to_top').click(function() {
    $(window).scrollTop(0);
    return false;
  });

  //Print links
  $('.link_print').click(function() {
    if (window.print) {
      print();
    }
    return false;
  });

  //Email links
  $('a.link_email').click(function() {
    if (window.addthis_sendto) {
      addthis_sendto('email');
      return false;
    } else {
      var href = 'mailto:?';
      href += 'subject=' + encodeURIComponent(document.title) + '&';
      href += 'body=' + encodeURIComponent(location.href);
      $(this).attr('href', href);
    }
  });

  $('a.link_email').click(function() {
    addthis_sendto('email');
    return false;
  });

	//Default Action
	$('.tab_content').hide(); //Hide all content
	$('ul.tabs li:first').addClass('active').show(); //Activate first tab
	$('.tab_content:first').show(); //Show first tab content

	//On Click Event
	$('ul.tabs li').click(function() {
		$('ul.tabs li').removeClass('active'); //Remove any "active" class
		$(this).addClass('active'); //Add "active" class to selected tab
		$('.tab_content').hide(); //Hide all tab content
		var activeTab = $(this).find('a').attr('href'); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

  //Examples of how to assign the ColorBox event to elements
  $('.lightbox_video').colorbox({iframe:true, innerWidth:425, innerHeight:344});

  $(window).load(function() {
    $('#nivoslider-141').nivoSlider({
      controlNav:false
    });
  });

});

//Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25615194-1']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script');
  ga.type = 'text/javascript';
  ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(ga, s);
})();

