$(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();
    
    
    $(".scrollable").scrollable({
            circular: true,
            speed: 1600
            })
            .autoscroll({
            interval: 4000		
        });
        
    $('.referenz-details a').each(function()
    {
        $(this).html('weiterlesen');
    }
    );    
    
});

// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
	log.history = log.history || [];   // store logs to an array for reference
	log.history.push(arguments);
	if(this.console){
		console.log( Array.prototype.slice.call(arguments) );
	}
};


