jQuery.noConflict();

jQuery(document).ready(function(){

	//init search value
	jQuery('input[type="text"]#search-biere , input[type="text"]#sidebar-search-biere').focus(function() {
		jQuery(this).css({'color':'#000000'});
	    if (this.value == this.defaultValue){ 
	    	this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	jQuery('input[type="text"]#search-biere , input[type="text"]#sidebar-search-biere').blur(function() {
	    if (jQuery.trim(this.value) == ''){
	    	this.value = (this.defaultValue ? this.defaultValue : '');
	    	jQuery(this).css({'color':'#666666'});
		}
	});


	// main menu
	jQuery("#menu-body ul li").hover(function() {
		jQuery(this).find('a').addClass('over');
		jQuery('ul:first',this).stop().animate({opacity: 1}, 'fast').css('visibility', 'visible');
	},function() {
		jQuery(this).find('a').removeClass('over');
		jQuery('ul:first',this).stop().animate({opacity: 0}, 'slow').css('visibility', 'hidden');
	});
	
	//custom last item ul
	jQuery("#menu-body ul li.last-item").hover(function() {
		largeur=jQuery(this).width();
		val=242-largeur;
		jQuery(this).find('ul').css({left: "-"+val+"px"});
	}); 
		
	// main menu - capitalize first letter
	jQuery("#menu-body ul li a").each(function() {
		var text = jQuery(this).html();
		var first = jQuery('<span>'+text.charAt(0)+'</span>');
		jQuery(this).html(text.substring(1)).prepend(first);
	});
	
	//actus
	jQuery('#actus').cycle({ 
    fx:     'scrollLeft', 
    timeout: 6000, 
    delay:  -2000 
  });

    
});
