$(document).ready(function(){

var config = {    
     sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
     interval: 150, // number = milliseconds for onMouseOver polling interval    
     over: fadeInSubMenu, // function = onMouseOver callback (REQUIRED)    
     timeout: 400, // number = milliseconds delay before onMouseOut    
     out: fadeOutSubMenu // function = onMouseOut callback (REQUIRED)    
};

$(".navi_top").hoverIntent( config )


});

function fadeInSubMenu(){  

    var that = $(this);
    that.children(".sub_menu").fadeIn('fast');
        
    if (that.hasClass("green")) {    
        
        that.children(".dropdownArrow").addClass("green");
    }
    if (that.hasClass("blue")) {
        
        that.children(".dropdownArrow").addClass("blue");
    }
    if (that.hasClass("gray")) {
        
        that.children(".dropdownArrow").addClass("gray");
    }
}

function fadeOutSubMenu(){ 

    var that = $(this);
    that.children(".sub_menu").fadeOut('fast');
    that.children(".dropdownArrow").removeClass("blue").removeClass("green").removeClass("gray");
}

