$(document).ready(function(){
    $("#tabs").tabs();
    $(".required-focus").tooltip({
        // place tooltip on the right edge 
        position: "center right",     
        // a little tweaking of the position 
        offset: [0, 0],     
        // use the built-in fadeIn/fadeOut effect 
        effect: "fade",     
        // custom opacity setting 
        opacity: 1,     
        // use this single tooltip element 
        tip: '#tooltip'     
    });
    if ($.browser.msie) {
        $(".items li a").css("background", "none");
        $(".items li a").append('<img class="arrow" src="/design/em_plain_site/images/arrow02.gif" alt="" />');
    }
    $(".search input.form-text").focus(function(){
      $(this).attr('value', ''); 
    });
    $(".search input.form-text").autocomplete('/' + $('ul.lang li.active a').text() + '/ajax/autocomplete', {
        minChars : 3,
        width: 160,
        max : 5
    });
    //$(".search-box #category-1").mouseleave(function(event) { event.stopPropagation(); });
    
    $('.search').hover(function() {
        $('.search-box').show(); 
    }, function() {
        $('.search-box').hide();
        $('.search-small').removeClass('search-small-hover');
    });
    
    $('.search-box select').mouseout(function(e) {
        $('.search-small').addClass('search-small-hover');
        e.preventDefault();
        e.stopPropagation();
        return false;
    });
});
