function brand_icons_mouseover(element) {
    $('.product-hover').hide();
    $($(element).attr('href')).show();
}

$(document).ready(function(){

    $('.menuitem:first-child').css('padding-top', '15px');
    $('.menuitem:last-child').css('padding-bottom', '15px');

    $('img[src$=png],#mainnav,.menublock').ifixpng();

    $('#search-dropdowns select').change(function(){
        if($(this).val()) {
            $(this).parents('form:eq(0)').submit();
        }
    });

    $('.menublock').each(function(){
        var orig_mouseover = this.onmouseover;
        var orig_mouseout = this.onmouseout;

        this.onmouseout = function(){};
        this.onmouseover = function(){};

        $(this).bind('mouseleave', function(){
            orig_mouseout();
        }).bind('mouseenter', function(){
            orig_mouseover();
        });
    });

    // Product Map Hover
    (function(){
        $('.product-hover').bind('mouseleave', function(){
            $(this).hide();
        });

        $('#brand-icons').bind('mouseleave', function(){
            $('.product-hover').hide();
        });

    })();

    // Slideshow
    (function(){
        var images = $('#slideshow img');
        var index = 0;
        var speed = 'slow';
        if(images.length > 1) {
            setInterval( function(){
                   images.eq(index).fadeOut(speed);
                   index = (++index % images.length);
                   images.eq(index).fadeIn(speed);
            } , slideshow_timer);
        }
    })();
});
