Drupal.behaviors.dr_general_hover = function(context){			

var mag_hover =  {
			  over: mag_cat_hover,
			  timeout: 1000,
			  out: mag_cat_hide
			};
				
$('.mag-cat img').hoverIntent(mag_hover);

var mag_hover_inner = {
					over: mag_cat_hover_inner,
					timeout: 500,
					out: mag_cat_hide_inner
			};

			$('.mag_popout').hoverIntent(mag_hover_inner);
					       
}

function mag_cat_hide(e){
var target = $(this).parents('.mag-cat').find('.mag_popout');
         if(!$(this).parents('.mag-cat').find('.mag_popout').hasClass('open')){
    		$(this).parents('.mag-cat').find('.mag_popout').hide();
         }
     }
function mag_cat_hover_inner(e){
		$(this).addClass('open');
     }
function mag_cat_hide_inner(e){
		$(this).removeClass('open');
		$(this).hide();
     }
function mag_cat_hover(e){
			$(this).parents('#mag-body1, .node').find('.mag_popout.initial_open, .mag_popout.open').css('display','none').removeClass('open').removeClass('initial_open');
	    	  $(this).parents('.mag-cat').find('.mag_popout')
			    .css("z-index", 999999)
				//.css("margin-top", "-50px")
				//.css("left",(e.pageX) + "px")
				.css('min-width','300px')
				.css('position', 'absolute')
				.css("display", 'block').
				addClass('initial_open');
				
	     }
