
function test() {
	alert('test');

}

/* R E S I Z E
-------------------------------------------- */

function stylesheetToggle() {
	if($('body').width() < 950) {
    	$('<link rel="stylesheet" href="http://www.10ksheep.com/test/mwsa2/wp-content/themes/mwca_custom/wide.css" type="text/css" media="screen" charset="utf-8"/>')
        .appendTo('head');
    	} else {
      	$('link[href="http://www.10ksheep.com/test/mwsa2/wp-content/themes/mwca_custom/wide.css"]').remove();
    } 
}

/* T O P  O F  P A G E
-------------------------------------------- */

function top_of_page(){
  $('a.top_of_page').click(function(){
    $.scrollTo(0 ,'slow');
    return false;
  });
}

/* E Q U A L  H I E G H T
-------------------------------------------- */

function equalHeight(group) {
   tallest = 0;
   group.each(function() {
      thisHeight = $(this).height();
      if(thisHeight > tallest) {
         tallest = thisHeight;
      }
   });
   group.height(tallest);
}


/* T A B  U N I T
-------------------------------------------- */

function volunteerTabUnit() {

	//When page loads...
	$("#tab_container div").hide(); //Hide all content
	$(".tab_nav li:first").addClass("current").show(); //Activate first tab
	$("#tab_container div:first").show(); //Show first tab content

	//On Click Event
	$(".tab_nav li").click(function() {

		$(".tab_nav li").removeClass("current"); //Remove any "active" class
		$(this).addClass("current"); //Add "active" class to selected tab
		$("#tab_container div").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
}


/*		H E R O  R O T A T I O N
================================================*/

var tabs = [];
var ind = 0;
var inter;
	
function change(stringref){
	$('.hero:not(#' + stringref + ')').hide();
		
	//show proper tab, catch IE6 bug
	if ($.browser.msie && $.browser.version.substr(0,3) == "6.0")
		$('.hero#' + stringref).show();
		else 
		$('.hero#' + stringref).fadeIn('slow');
		//clear highlight from previous tab title
		$('#bd-navigation li a:not(#' + stringref + 't)').removeClass('select');
		//highlight currenttab title
		$('#bd-navigation li a[href=#' + stringref + ']').addClass('select');
}

function next(){
	//call change to display next tab
	change(tabs[ind++]);
	//if it's the last tab, clear the index
	if(ind >= tabs.length)
		ind = 0;
}


/* H E R O  T A B  R O T A T I O N
-------------------------------------------- */

function hero(){
	//store all tabs in array
	$(".hero").map(function(){
		tabs[ind++] = $(this).attr("id");
	})
	//set index to next element to fade
	ind = 1;
	//initialize tabs, display the current tab
	$(".hero:not(:first)").hide();
	$(".hero:first").show();
	//highlight the current tab title
	$('#' + tabs[0] + 't').addClass('select');
	//handler for clicking on tabs
	$("#bd-navigation li a").click(function(){
	
		//if tab is clicked, stop rotating 
		clearInterval(inter);
		//store reference to clicked tab
		stringref = $(this).attr("href").split('#')[1];
		//display referenced tab
		change(stringref);
		return false;
	});
	//start rotating tabs
	inter = setInterval("next()", 8000);
}

/* C O N T A C T  P U S H
-------------------------------------------- */

function contactPush(){
  // hide all the content panes when the page loads
  $( '#contact_div' ).hide();
  
  // uncomment the next line if you'd like the first pane to be visible by default
  // $('#bio > div:first').show();
  
  $('.menu-item-13').click(function() {
    $('#contact_div').animate({'height':'toggle'}, 'slow');
	$('#mastHead').toggleClass('mastHead_height');
  });
}

