$(document).ready(function() {		
    
    // Clear search bar on click and add/remove class
    var defaultValue = $('.widget-container #s').val();
    $('.widget-container #s').click(function(){
        $('.widget-container #s').removeClass("blur");
        if(this.value == defaultValue){
            $('.widget-container #s').val("");
        }
        return false;
    });
    $('.widget-container #s').blur(function(){
        $('.widget-container #s').addClass("blur");
        if(this.value == ""){
            $('#s').val(defaultValue);
        }
    });    
    
    // Center Menu and define hover action
    var maxWidth = $('.menu-header').width();    
    var menuWidth = $('#menu-top_navigation').width();  
    var newMarginLeft = (maxWidth/2)-(menuWidth/2);
    
    $('#menu-top_navigation').css('margin-left', newMarginLeft+'px'); 
    
    $('#menu-top_navigation li').hover(
        function () {
            $(this).addClass('hover');
        }, 
        function () {
            $(this).removeClass('hover');
        }
    ); 
	
});
