/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
 
$(function() {
	
	$("q").prepend("&ldquo;").append("&rdquo;");
	$("q q").prepend("&lsquo;").append("&rsquo;");
	// Add classes to input pseudotypes
	$("input[type='text'], input[type='password']").addClass("text");
	$("input[type='button'], input[type='submit'], input[type='checkbox'], input[type='image'], input[type='radio'], input[type='reset'], button").addClass("nontext");
	$("input[type='button'], input[type='submit'], input[type='reset'], button").addClass("button");
	
	// todo - this needs to be dynamic
	//$('.assertion dl.concept').prepend('<span class="concept_type CATerm concept">CONCEPT</span>');
	
	/*** Definition hover effect ***/
	
	// Wrap the definition up in a bunch of containers, these containers add the "shadow" to the definition
	$(".assertion dd").wrap("<div class='definition'><div class='blShadow'><div class='shadowbox'><div class='textContent'></div></div></div></div>").css("opacity",0);
	
	// Hide the definition
	$(".assertion .definition").hide();
	
	// Assign the variables for our animation
	var overFn = function () { 
		$(this).next('.assertion .definition').slideDown( 500, "easeInOutQuad" );
		$(".assertion dd").animate({opacity:1});
	};			
	var outFn = function () { 
		$(".assertion dd").animate({opacity:0});
		$('.assertion .definition').slideUp( 300, "easeInOutQuad" );
	};
	
	// Activate the hover animation using hoverIntent to keep the animations from activating too often
	//$(".assertion dt").hoverIntent({over: overFn, sensitivity: 3, interval: 150, out: outFn,});
	$(".assertion dt").hoverIntent({over: overFn, sensitivity: 3, interval: 150, out: outFn}); // updated: removed trailing comma
		
});


/*
$(function() {
	
	// Wrap the definition up in a bunch of containers, these containers add the "shadow" to the definition
	$(".navmenu dd").wrap("<div class='dblock'><div class='navblShadow'><div class='navshadowbox'><div class='navContent'></div></div></div></div>").css("opacity",0);
	
	// Hide the definition
	$(".navmenu .dblock").hide();
	
	// Assign the variables for our animation
	var overFnav = function () { 
		$(this).next('.navmenu .dblock').slideDown( 300, "easeInOutQuad" );
		$(".navmenu dd").animate({opacity:1});
	};			
	var outFnav = function () { 
		$(".navmenu dd").animate({opacity:0});
		$('.navmenu .dblock').slideUp( 10000, "easeInOutQuad" );
	};
	
	// Activate the hover animation using hoverIntent to keep the animations from activating too often
	$(".navmenu dt").hoverIntent({over: overFnav, sensitivity: 3, interval: 150, out: outFnav});
		
});
*/
