/**
 * @author dave.rodriguez@hansoninc.com
 */

var DropShadowPopup = {
	init: function() {
		$(".popup").each(
			function() {
				// Wrap the content in a popup table
				var tmp = $(this).html();
				var start = "<table class='popup-wrapper'><tr><td class='popup-tl'></td><td class='popup-t'></td><td class='popup-tr'></tr><tr><td class='popup-l'></td><td class='popup-content'>";
				var end = "</td><td class='popup-r'></td></tr><tr><td class='popup-bl'></td><td class='popup-b'></td><td class='popup-br'></td></tr></table>";
				var newHTML = start + tmp + end;
				$(this).html(newHTML);
				
				$(this).css({display:'none'}, 0);
			}
		);
		
		$("#audiencenav li a").hoverIntent(
			function() {
				var yPos = -($(".popup", this).height()) + 40;
				$(".popup", this).css({display: 'block', opacity: 0, top: yPos + 'px'}).animate({
					opacity: 1,
					top: "-=20px"
					}, 300, 'swing'
				);
			}, function() {
				$(".popup", this).animate({
					opacity: 0,
					top: "-=20px"
					}, 300, 'swing', function() { $(this).css({display: 'none'}); }
				);
			}
		);
	}
}
