//attach event with code to find the term and make a layer
function createJargon() {
	$('a.dejargonator').hoverIntent(function(e) {
											
		if($('.dj-layer').length <= 0) {
			var dt = $(this).attr('rel'); //get the name from the rel attribute in the html
			if(dejargonatorGlossary[dt]) { //make sure name is in array
				var dd =  dejargonatorGlossary[dt]; //get the value
				var dejargonatorDiv = '<div class="dj-layer"><div class="top">&nbsp;</div><div class="mid">'+dd+'</div>';
				var left = e.pageX - 29;
				if (left + 299 > document.body.clientWidth) {
					dejargonatorDiv = dejargonatorDiv + '<div class="btm2">&nbsp;</div></div>';
					left = e.pageX - 270;
				} else {
					dejargonatorDiv = dejargonatorDiv + '<div class="btm">&nbsp;</div></div>';
				}
				$(dejargonatorDiv).mouseleave(function() {
						$('.dj-layer')
						.stop(true, true)
						.fadeOut('fast', function() {
							$(this).remove();
						});
				})
				.appendTo($('body'))
				.css({
					cursor:'help',
					position:'absolute',
					left:(left),
					top:(e.pageY - $('.dj-layer').height() + (navigator.userAgent.indexOf('MSIE') > -1 ? 10 : 3))
				})
				.stop(true, true)
				.fadeIn(250);
			}

		}
		
	},function(){return false})
}

$(window).resize(function() {
	$('.dj-layer').stop(true, true).remove();
});