var $j = jQuery.noConflict();
$j(document).ready(function () {

/***************** FancyDropdown menu *************************/

//http://www.webdesigndev.com/web-development/create-the-fanciest-dropdown-menu-you-ever-saw
	$j('.dropdown').each(function () {
		$j(this).parent().eq(0).hoverIntent({
			timeout: 300, // time before dropdown menu disappear
			over: function () {
				var current = $j('.dropdown:eq(0)', this);
				var number_child = current.children().length;
				var dropdown_height = 32*number_child ;//32 is the "li" tags height
 				current.hide().css({width:"0px", height:"0px"}).animate({width:"140px", height: dropdown_height+"px"}, {speed: 500, easing: 'easeOutBack'});
				current.prev().css({"backgroundColor":"#cfbf95", "color":"#a42b2b"});
			},
			out: function () {
				var current = $j('.dropdown:eq(0)', this);
				current.fadeOut(200);
				current.prev().css({"backgroundColor":"transparent", "color":"#333"});
			}
		});
	});

    $j('ul ul a', '#bmenu').hover(
        function(){ $j(this).stop().animate({textIndent: 15}, 500); },
        function(){ $j(this).stop().animate({textIndent: 0}, {duration: 300, complete: function(){}}); }
    );


/************ HIDE TITLE ATTRIBUT ON THE MENU ******************/
	$j('#menu a').attr('title', '');
		
/**************** NIVOSLIDER SETTING ***************************/	
	$j('#slider img').attr('title', ''); // reset wp image title attribut to disable caption
    $j(window).load(function() {
        $j('#slider').nivoSlider({
			effect:'sliceDown', 
			pauseTime:5000,
			controlNav:false
		});
    });	
	
/**************** FIX IE 7 CSS last-child no support  ***************************/
	$j('#menu ul.dropdown li:last-child').addClass("dropdown_last_child");


});



