(function($){

	/*
		
		Font Replacements

	*/
	
	// Cufon.replace('h1,h2,h3', { textShadow: '0 1px 0 #000000' });
	// 
	// Cufon.replace('#nav li a',{
	// 	textShadow: '0 1px 1px #2a5d7f',
	// 	hover: true
	// });
	// 
	// Cufon.replace('#nav li.active a,#nav li.current-menu-item a,#nav li.current-page-ancestor a,#nav li.current_page_parent a', {
	// 	textShadow: '0 1px 0 #ace0ff'
	// });
	// 	
	// // Cufon.replace('#nav .sub-menu a', {
	// // 	textShadow: '0 1px 0 red',
	// // 	hover: true
	// // });
	// 
	// Cufon.replace('#footer_nav a',{
	// 	textShadow: '0 1px 1px #2a5d7f'
	// });
	// 
	// //Home Page
	// 
	// Cufon.replace('.home_section h2',{
	// 	textShadow: '0 1px 0 rgba(255,255,255,.35)'
	// });
	// 
	// //Inside Pages
	// Cufon.replace('#page_tag h1', { textShadow: '0 1px 0 #000000' });
	// Cufon.replace('#page_tag h2', { textShadow: '0 1px 0 #fff' });
	// Cufon.replace('#related_pages h3', { textShadow: '0 1px 0 #ade365' });
	// Cufon.replace('.side_news h3, #side_volunteers h3', { textShadow: '0 1px 0 #64bcf0' });
	// 
	// //Posts
	// 
	// Cufon.replace('.title h2', { textShadow: '0 0 0 white' });
	// Cufon.replace('.post_date p', { textShadow: '0 1px 0 white' });
	// Cufon.replace('#content .post_date p.date', { textShadow: '0 1px 0 #868686' });
	// 

	/*

		Fix some li's

	*/
	
	$('#footer_nav li:last').addClass('last');

	/*
		
		Input text

	*/

	$('input[type=text]').each(function(i, el){
		
		var original = $(el).val();
		
		$(el).focus(function(){
			
			if($(this).val() == original){
				
				$(this).val('');
				
			}
			
		}).blur(function(){
			
			if($(this).val() == ''){
				
				$(this).val(original);
				
			}
			
		});
		
	});
	
	/*
		
		Nav Hover

	*/
	
	$('#nav a').mouseenter(function(){
		
		$(this).addClass('hover');
		
	});
	
	$('#nav li').mouseleave(function(){
		
		$(this).find('a').removeClass('hover');
		Cufon.refresh();
		
	});

	/*

		Slider(s)

	*/
	
	if(('#slider').length){

		/*
			
			Add some id's to the images

		*/
		
		$('#slider img').each(function(i, el){
						
			var alt = $(el).attr('alt');
									
			$(el).attr('title', '#' + alt);
			//$(el).id = 'slider_html_' + i;
			
		});
		
		/*
			
			Get the slider going

		*/
		
		$('#slider').nivoSlider({
	        effect: 'fade',
	        slices: 15,
	        animSpeed: 500,
	        pauseTime: 5000,
			directionNavHide: false,
	        captionOpacity: 0.8
	    });

		/*

			We need to set the width of the next/prev box to make it
			fit how the design wants it to fit

		*/
		
		$('.nivo-directionNav').width(($('.nivo-controlNav').width()) + 40);
	
	}
	
	/*
	
		Zebra the tables
	
	*/
	
	$('table tr:odd').addClass('alt');
	$('table tr.top td:odd').addClass('alt');

})(this.jQuery);
