
var statements = new Array();
statements.push("Ich will meine Grenzen erfahren...");
statements.push("Nur wer sich hohe Ziele setzt, wird etwas erreichen.");
statements.push("Ich verspüre unglaubliche Freude an dem was ich tue.")
statements.push("Laufen, das ist meine Leidenschaft.");
statements.push("...meinen Traum von Olympia leben zu können.");


var last = 0;
function randomStatement() {
	var i = Math.floor(Math.random()*statements.length);
	if(i == last) {
		i = (i + 1) % statements.length;
	}
	last = i;
	return statements[i];
}
function randomTop() {
	 return Math.floor(Math.random()*70);
}
function randomRight() {
	 return 200 + Math.floor(Math.random()*350);
}

$.fn.wait = function(time, type) {
    time = time || 1000;
    type = type || "fx";
    return this.queue(type, function() {
        var self = this;
        setTimeout(function() {
            $(self).dequeue();
        }, time);
    });
};

function showStatement() {
	$("#logo")
		.html("<p id=\"statement\">&bdquo;" + randomStatement() + "&rdquo;</p>")
		.find("p#statement")
			.css("margin-right", randomRight())
			.css("padding-top", randomTop())
			.hide()
			.fadeIn(2000)
			.wait(5000)
			.fadeOut(2000, showStatement);
}

$(document).ready(function() {
	showStatement();
	/*
	$("#logo").append("<p id=\"statement\">&bdquo;" + statement + "&rdquo;</p>");
	$("p#statement").hide();
	$("p#statement").fadeIn(2000);
	*/
});

