function megaHoverOver(){
	$(this).find(".sub").stop().fadeTo(0, 1).show();
	$(this).find(".iesixfix").stop().css({'display' : 'block'});
		
    //Calculate width of all ul's
    (function($) { 
	    jQuery.fn.calcSubWidth = function() {
		    rowWidth = 0;
		    //Calculate row
		    $(this).find("ul").each(function() {	
		        var ulWidth = $(this).width();			
		    	if ($(this).css('padding-left') != undefined) { // Include left padding if it exists
                    ulWidth += parseInt($(this).css('padding-left').replace('px',''));
                }
                if ($(this).css('padding-right') != undefined) { // Include right padding if it exists
                    ulWidth += parseInt($(this).css('padding-right').replace('px',''));
                }	
			    rowWidth += ulWidth;
		    });	
			rowWidth = rowWidth + 10;
	    };
    })(jQuery); 
	
    $(this).calcSubWidth();
    
    //Set Width
    $(this).find(".sub,.iesixfix").css({'width' : rowWidth});
	
	if (rowWidth == 10)
	{
		$(this).find(".iesixfix").css({'width' : (rowWidth - 10)});
	}
    
    if ($(this).find(".sub").css('padding-left') != undefined) {
        rowWidth += parseInt($(this).find(".sub").css('padding-left').replace('px',''));
    }
    if ($(this).find(".sub").css('padding-right') != undefined) {
        rowWidth += parseInt($(this).find(".sub").css('padding-right').replace('px',''));
    }
    
    // Reposition .sub if it would go over the edge of the nav
    var subSpace = $(this).position().left + rowWidth;
  
	var navTotalWidth = $(this).parent().width(); // Get the total nav width from the parent (#topnav)
  
    if (subSpace > navTotalWidth) {
        $(this).find(".sub,.iesixfix").css({'left' : navTotalWidth - subSpace - (15 - edgeOffset)});
    }
    
    // Set .edge position
    if ($(this).find(".sub").css('left') != undefined) {
		
    }
}

function megaHoverOut(){ 
  $(this).find(".sub").stop().fadeTo(0, 0, function() {
      $(this).hide(); 
  });
  $(this).find(".iesixfix").css({'display' : 'none'});
}
