// Ticker Scrollgeschwindigkeit in ms für 500px
var iTickerSpeed = 3000;




var oScrollTicker = function(oTicker, iWidth) {
    var iL = parseInt($(oTicker).css('left').substr(0, $(oTicker).css('left').length - 2));
    
    if (-1 * iL > iWidth) {
        oTicker.css('left', (oTicker.parent().width() + 50) + 'px');
        iL = oTicker.parent().width() + 50;
    }
    
    oTicker.animate({ left: iL - 500 }, iTickerSpeed, 'linear', function() { oScrollTicker(oTicker, iWidth); });
}


$(function() {
    $('#home_head p').each(function() {
        var iW = $(this).width();
        var oT = $(this);
        
        oT.css('left', (oT.parent().width() + 50) + 'px');
        
        oScrollTicker(oT, iW);
    });
    
    
    
    
    $('a.slider').click(function() {
        if ($(this).prev('span:visible').length) {
            $(this).prev('span').slideUp();
            $(this).text('mehr>>');
        }
        else {
            $(this).prev('span').slideDown();
            $(this).text('<<weniger');
        }
    });
});
