$(document).ready(function(){
	
	// ========================================= nav hover function ========================================= //
	
	$(function(){
		$(".primary-nav > li > a").hover( 
			function(){
				$(this).addClass("hover");
			},
			function(){
				$(this).removeClass("hover");
			});
	});
	
	// ========================================= module tabs ========================================= //
	//
	//
	//
	
	$(function(){
		var tabPrefix=			"container";
		var containerPrefix=	"containers";
		var splitToken=			":";
		
		$( "a[ id^= " + tabPrefix + " ]" ).click( function(){
			//set the tab's state
			$(this).parent().parent().find( "li > a" ).removeClass( "selected" );
			$(this).addClass( "selected" );
			
			//split the tab's id to find the target container
			var tokens=		$(this).attr("id").split( splitToken );
			
			//hide / show containers appropriately
			containerId = tokens[ tokens.length - 1 ];
			$("#" + containerPrefix).children( "div" ).hide();
			$("#" + containerPrefix).children( "div#" + containerId ).show();
		});
	});
	
	// ========================================= collapsible siblings ========================================= //
	//
	// if you want to create a collapsible nav, juxtapose two divs and assign the toggleClass selector
	// to the first one.
	//
	
	$(function(){
		var toggleClass=		"toggle_sibling";
		var animDelay=			200;
		
		$( "." + toggleClass ).click( function(){
			$(this).next().slideToggle( animDelay );
			$(this).toggleClass( "open" );
		});
	});
	
	// ========================================= corner rounding ========================================= //
	
	$(function(){
		$(".std-tl").corner("6px tl round");
		$(".std-top").corner("6px top round");
		$(".max-top").corner("12px top round");
		$(".std-round").corner("8px round");
		$(".max-round").corner("12px round");
	});
	
	// ========================================= misc init actions ========================================= //
	
	$(".hide-on-load").hide();

});