$(document).ready(function(){
	$('#nav li').has('ul').addClass("submenu");
	
	var config = {    
     sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)    
     interval: 0, // number = milliseconds for onMouseOver polling interval    
     over: addingClass, // function = onMouseOver callback (REQUIRED)    
     timeout: 300, // number = milliseconds delay before onMouseOut    
     out: removingClass // function = onMouseOut callback (REQUIRED)    
	};
	
	$('#nav .submenu').hoverIntent( config );

	if($("#sidebar .widget_yd_rp h2").length < 1) {
		$("#sidebar .widget_yd_rp").prepend('<h2>CFI Blog | Latest News</h2>');
	}

	$("#sidebar .widget_yd_rp h2").append(' <a href="http://christianfamilyinstitute.com/feed/"><img src="/counseling/wp-content/themes/CFI/images/rss.png" alt="RSS Feed"/></a>');	

	$("#sidebar .yd_rp_excerpt a").before(" ");	
	
	$('#sidebar .yd_rp_widget h4').each(function(index) {
    var content =  $("a",this).html();
		temp = content.split(': ');
		$(this).before('<span class="yd_rp_date">'+temp[0]+'</span>');
		$("a",this).html(temp[1]);
  });
	
	$("#sidebar").append('<div class="bottom"></div>');
	
	//give header image nice corners
	$('#header_image').append('<div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div>');
	
});

jQuery.preLoadImages("/counseling/wp-content/themes/CFI/images/nav_submenu_over.png","/counseling/wp-content/themes/CFI/images/nav_dropdown_bkgnd.png");


function addingClass(){  $(this).addClass("hovered");}
function removingClass(){ $(this).removeClass("hovered");}


