$(document).ready(function(){

// -------------------------------------------------------------------------------------------
// Adds current date to copyright in footer
// -------------------------------------------------------------------------------------------

$("#year").text( (new Date).getFullYear() );

// -------------------------------------------------------------------------------------------
// Scroll to top
// -------------------------------------------------------------------------------------------

var blue_css = { background: '#E5F6FE',	color: '#4D9FBF', border: '2px solid #ADD9ED' }
var green_css = { background: '#CDE6AC', color: '#58792E', border: '2px solid #A9DB66' }
var red_css = { background: '#f28279', color: '#9C2F2F', border: '2px solid #CE6F6F' }
var dark_css = { background: '#404040',	color: '#f3f3f3', border: '2px solid #303030' }
var light_css = { background: '#f1f1f1', color: '#454545', border: '2px solid #E2E2E2' }
var cream_css = { background: '#F0DE7D', color: '#A27D35', border: '2px solid #F9E98E' } 
var taup_css = { background: '#E8E6E3', color: '#928b81', border: '2px solid #D7D3D0' }
		
/*---Creates the scroll to top link---*/
$('body').prepend('<a href="javascript:;" id="toTop">^ Scroll to Top</a>');
	$('#toTop').css({ 
		width: '85px',
		'font-size': '9px',
		padding: '5px',
		position: 'fixed',
		bottom: '10px',
		right: '10px',
		cursor: 'pointer',
		'text-align': 'center',
		'text-decoration': 'none'
		//color: '#666',
		//background: '#f1f1f1',
		//border: '1px solid #ccc'
});
$('#toTop').css(dark_css)
			
/*---Starts the scroll to top function that uses the link above. This must come after the link is created above.---*/
$(function() {
	$("#toTop").scrollToTop({speed:800});
});
	
// -------------------------------------------------------------------------------------------
// Adds a focus class to the parent element so you can see what field you are on
// -------------------------------------------------------------------------------------------
			
$(".content input").focus(function() {
	$(this).parent().addClass("curFocus")
});
	$(".content input").blur(function() {
	$(this).parent().removeClass("curFocus")
});
	
// -------------------------------------------------------------------------------------------
// Makes links to the following file types open in new windows
// -------------------------------------------------------------------------------------------

$("a[href*=.pdf]").attr("target", "_blank");
$("a[href*=.doc]").attr("target", "_blank");  
$("a[href*=.xls]").attr("target", "_blank");  
$("a[href*=.ppt]").attr("target", "_blank"); 
$("a[href*=.pps]").attr("target", "_blank"); 

// -------------------------------------------------------------------------------------------
// Tabs 
// -------------------------------------------------------------------------------------------

$(".tabs h6").each(function() {
	$(this).nextUntil("h6").wrapAll('<div class="tabbody" />');
	});
$(".tabs").accessibleTabs({
	tabhead: 'h6',
	fx:"fadeIn",
	tabbody:'.tabbody'
});

	
});
