/**
* Contains the initial configurations of the site.
*/

jQuery.noConflict();

jQuery(document).ready(function() {

	/**
	 * Mega DropDown menu
	 */
	//On Hover Over - Mega DropDowwn
	function megaHoverOver() {
		jQuery(this).find(".submenu-div").stop().fadeTo('fast', 1).show();
		jQuery(this).addClass("submenu_active");
	}
	
	//On Hover Out - Mega DropDowwn
	function megaHoverOut() {
		jQuery(this).removeClass("submenu_active");
		jQuery(this).find(".submenu-div").stop().fadeTo('fast', 0, function() { //Fade to 0 opactiy
			jQuery(this).hide();  //after fading, hide it
		});
	}
	
	var config = {
		sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
		interval: 100, // number = milliseconds for onMouseOver polling interval
		over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
		timeout: 100, // number = milliseconds delay before onMouseOut
		out: megaHoverOut // function = onMouseOut callback (REQUIRED)
	};
	
	jQuery(".menu-nav li .submenu-div").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
	jQuery(".menu-nav li").hoverIntent(config); //Trigger Hover intent with custom configurations
	

	jQuery('.scroll-pane').jScrollPane({scrollbarWidth:4, dragMinHeight:50, dragMaxHeight:50, scrollbarMargin:20});

});
