$(document).ready( function() {

    var textArray = [
        '&laquo;<em>Ich</em> designe Websites.&raquo;',
        '&laquo;<em>Ich</em> zeichne Logos.&raquo;',
        '&laquo;<em>Ich</em> erstelle Kommuniktationskonzepte.&raquo;',
        '&laquo;<em>Ich</em> liebe Minimalismus.&raquo;',
        '&laquo;<em>Ich</em> spiele mit jQuery.&raquo;',
        '&laquo;<em>Ich</em> liebe webOS.&raquo;',
        '&laquo;<em>Ich</em> liebe Photoshop.&raquo;',
        '&laquo;<em>Ich</em> blogge.&raquo;',
        '&laquo;<em>Ich</em> bin Student.&raquo;',
		'&laquo;Ich <em>liebe</em> meine Freundin.&raquo;',
        '&laquo;<em>Ich</em> bin ein Webentwickler aus Deutschland.&raquo;'
    ];
    $('#text-content').loadText( textArray, 10000 ); // ( array, interval )
});
// custom jquery plugin loadText()
$.fn.loadText = function( textArray, interval ) {
    return this.each( function() {
        var obj = $(this);
        obj.fadeOut( 'slow', function() {
            obj.empty().html( random_array( textArray ) );
            obj.fadeIn( 'slow' );
        });
        timeOut = setTimeout( function(){ obj.loadText( textArray, interval )}, interval );
    });
}
//public function
function random_array( aArray ) {
    var rand = Math.floor( Math.random() * aArray.length + aArray.length );
    var randArray = aArray[ rand - aArray.length ];
    return randArray;
}
