$(document).ready(function(){
	$(document).pngFix(); 
	var linkHoverTrack = 'out';
	var menuHoverTrack = 'out';
	
	$('img[@src$=.png]').pngFix();
	
	$("a.nav_practice, ul.subnav_practice").hoverIntent({
		sensitivity: 3, 
		interval: 10,
		over: showSub, 
		timeout: 500, 
		out: hideSub
	});
	
	/* Slideout Menu */
	function showSub()
	{	if ( $(this).attr('class') == 'nav_practice')
		{	linkHoverTrack = 'over';	}
		if ( $(this).attr('class') == 'subnav_practice')
		{	menuHoverTrack = 'over';	}
		showHide();	}
	function hideSub()
	{	if ( $(this).attr('class') == 'nav_practice')
		{	linkHoverTrack = 'out';	}
		if ( $(this).attr('class') == 'subnav_practice')
		{	menuHoverTrack = 'out';		}
		showHide();	}
	function showHide()
	{	if ( linkHoverTrack == 'out' && menuHoverTrack == 'out' )
		{	$("ul.subnav_practice").animate({ width:'hide' }, 300 );	}
		if ( linkHoverTrack == 'over' || menuHoverTrack == 'over' )
		{	$("ul.subnav_practice").animate({ width:'show' }, 300 );	}
	}
	
	/* Sidebar fading images */
	$('.fade').innerfade({
		animationtype: 'fade',
		speed: 'slow',
		timeout: 5000,
		type: 'sequence',
		containerheight: $('.fade img').attr("height")+'px',
		runningclass: 'innerfade'
	});
});