jQuery(document).ready(function($) {	
	var maxHeight = 0;
	
	$('.az_listing_row').each(function(){
		$('.az_listing_name', $(this)).each(function(key, value){
			if($(value).outerHeight() > maxHeight) maxHeight = jQuery(value).outerHeight();
		});
		$('.az_listing_name', $(this)).height(maxHeight);
		maxHeight = 0;
	});
	
	var config = {
		 sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
		 interval: 50, // number = milliseconds for onMouseOver polling interval
		 over: function(e){
            $(this).children('a').addClass('hover');
			/*if ( $('.az_subcategories',this) )
				if ( $(this).offset().left + $('.az_subcategories', this).width() > $(window).width() )
					$('.az_subcategories',this).css('left',$(this).offset().left - $('.az_subcategories', this).width() + $(this).width() );*/
			$('.az_subcategories', this).show();
		}, // function = onMouseOver callback (REQUIRED)
		 timeout: 200, // number = milliseconds delay before onMouseOut
		 out: function(e){
            $(this).children('a').removeClass('hover');
			$('.az_subcategories', this).hide();
		} // function = onMouseOut callback (REQUIRED)
	};

	$("#az_main_menu li").hoverIntent( config );
});
