$(document).ready(function() {
    $('#theme').cycle({ slideExpr: 'span.slideshowimage' });

    // Suchfeld leeren
    $('#search-input').focus(function () {
        $(this).attr('value','');
    });

    function center(toCenterParent,toCenterChild) {
        $(toCenterParent).each(function(){
            span = $(this).find(toCenterChild);
            height = span.height();
            margin = '-' + Math.round(height/2) + 'px';
            var cssProp = {
                position: 'relative',
                top: '50%',
                marginTop: margin,
                display: 'block'
            };
            span.css(cssProp);
        });
    }
    center('.companies-row li','span');
    
    var maxHeight = 0;
    $('#netzwerkpartner .csc-textpic-image img').each(function(){
        height = $(this).height();
        if(maxHeight < height )
        {
            maxHeight = height;
        }
    });

    $('#netzwerkpartner .csc-textpic-image img').each(function(){
        posTop = Math.round((maxHeight - $(this).height())/2);
        var cssProp = {
            position: 'relative',
            top: posTop + 'px'
        };
        $(this).css(cssProp);
    });    
    
    $('.tx-billitonemployeesearch-pi5 > ul').tabs();
    
});