$.noConflict();

function mycarousel_initCallback(carousel)
{
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};

jQuery(document).ready(function($) {

	$("#bannersHome").jcarousel({
		auto: 5,
		scroll: 1,
		wrap: 'circular',
		initCallback: mycarousel_initCallback
	});

	//----------------------------------------------------------------------------------

	/**
	 * Mega DropDown menu
	 */
	//On Hover Over - Mega DropDowwn
	function megaHoverOver() {
		$(this).find(".submenu").stop().fadeTo('fast', 1).show();
		$(this).addClass("link_active");
	}

	//On Hover Out - Mega DropDowwn
	function megaHoverOut() {
		$(this).removeClass("link_active");
		$(this).find(".submenu").stop().fadeTo('fast', 0, function() { //Fade to 0 opactiy
			$(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: 200, // number = milliseconds delay before onMouseOut
		out: megaHoverOut // function = onMouseOut callback (REQUIRED)
	};

	$(".submenu").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
	$("#menu-nav ul li").hoverIntent(config); //Trigger Hover intent with custom configurations


	//----------------------------------------------------------------------------------

	/**
	 * prettyPhoto
	 */
	$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'facebook', slideshow:8000, autoplay_slideshow:false});

});

Cufon.replace('.calibri_bold_italic', { fontFamily: 'Calibri Bold Italic', hover: true });
Cufon.replace('.calibri_italic', { fontFamily: 'Calibri Italic', hover: true });
Cufon.replace('.calibri_bold', { fontFamily: 'Calibri Bold', hover: true });
Cufon.replace('.calibri', { fontFamily: 'Calibri', hover: true });
