$(document).ready(function(){

	/* !homepage featured content */
	var lastTabId = 1;

	$('ul#home-featured-nav li a').click(function(){

		var thisLink = $(this).attr('href');
		var thisLinkId = thisLink.length - 1;
		var id = thisLink.substr(thisLinkId,1);

		$('div#section-'+lastTabId).fadeOut('slow');
		$('div#section-'+id).fadeIn('slow');

		lastTabId = id;
		
		var ourTabs = $('ul#home-featured-nav > li');
		
		for(var i = 0; i < ourTabs.length; i++)
		{
			if ((i + 1) == id)
			{
				ourTabs[i].className = 'active';
			}
			else
			{
				ourTabs[i].className = '';
			}
		}
		return false;
	});

	/* !Open external links in new windows */
	$("a[href^=http]").each(function(){
		if(this.href.indexOf(location.hostname) == -1) {
			$(this).attr('target', '_blank');
		}
	});


});

function isNotIE() {
  try {
      return Array.prototype.slice.call(document.forms, 0) instanceof Array;
  } catch (e) {
      return false;
  }
}
