$(document).ready(function() {

	// the line below fixes the tinymce save issue with wp 3.01. Forces the <p/> to be removed around images on the staff bio pages.
	$("#post-75 p a img").parent().unwrap();
	$("#post-265 p a img").parent().unwrap();	

	//handles the welcome buckets on the homepage
	$('ul li:first-child').not(':only-child').addClass('first-child'); 
	$('ul li:last-child').not(':only-child').addClass('last-child'); 	
//	$("ul li:last-child").css("border-bottom","100px solid #b5b5b5");
	
	// adds class to p tag on the homepage sidebar.
	$('.home_news ul li p').addClass('news_home_description');
	$('.narrow_col ul li p').addClass('news_home_description');	

	// fixes issue with staff images appearing on the sidebar
	$('.narrow_col ul li a img').remove();		

	$('.feature_buckets')

	if($('.cat-News').length){
		console.log('cat-News exists');
		$('.cat-News').parent().parent().find('.menu ul li.page-item-248').addClass('current_page_item');		
	}
	if($('.cat-Calendar').length){
		console.log('.cat-Calendar exists');
		$('.cat-Calendar').parent().parent().find('.menu ul li.page-item-18').addClass('current_page_item');
	}
	
	if($('.cat-Education').length){
		console.log('.cat-Education exists');
		$('.cat-Education').parent().parent().find('.menu ul li.page-item-6').addClass('current_page_item');
	}	
	
	// this is for the sidebar line on the narrow col
	var entryHeight = $('.main_content_container').height();
	var sideColHeight = $('.narrow_col').height();
	if(entryHeight > sideColHeight){
		var addTosideBar = entryHeight - 20; //offset from the padding at the top of the page for the narrowCol.
		$('.narrow_col').css('height',addTosideBar);
	}


	
	// subnavigation script
	// if( $('ul.menu li ul.children',this).value != 0 ){
	// 	$(this).parent().parent().addClass('parent-link-active');
	// }
	// 
	// $('.menu li',this).delay(800).hover(  
	//         function () {  
	//             //show its submenu  
	//             $('ul', this).delay(400).slideDown(400);  
	//         },   
	//         function () {  
	//             //hide its submenu  
	//             $('ul', this).delay(400).slideUp(400);           
	//         }  
	//     );

}); // end docReady


