$(document).ready(function() {
    caro();
    if( $('#slides') ) {
        slidess(false);
    }
    tweetsup();
});

function caro()
{
    $('#carousel1').CloudCarousel({
        xPos: 240,
        yPos: 64,
        buttonLeft: $("#left-but"),
        buttonRight: $("#right-but"),
        altBox: $("#alt-text"),
        reflHeight: '64'
    });

}


function tweetsup() {
    $("#twitternews").tweet({
        join_text: "auto",
        username: "marcshake",
        avatar_size: 48,
        count: 4,
        auto_join_text_default: "schrub ich,",
        auto_join_text_ed: "Ich",
        auto_join_text_ing: "Ich war",
        auto_join_text_reply: "Meine Antwort",
        auto_join_text_url: "Guck mal:",
        loading_text: "loading tweets..."
    });


}


function slidess(invert)
{
    if(invert)
    {
        $('#slides').animate({
            backgroundPosition:0+'px'
        },15500);
        invert=false;
    }
    else
    {
        invert=true;
        $('#slides').animate({
            backgroundPosition:2160+'px'
        },15500);
    }
		
    t = window.setTimeout('slidess('+invert+')',15500);
		
}

