/**
 * Versteckt den INhalt hinter dem Teaser
 */
function hideContent () {
    $("body .links, body .rechts").css({"display" : "none"});
    $("#footer").css({"display" : "none"});
    $(".hr").css({"display" : "none"});
}

/**
 * Zeigt den Teaser an und gibt ihm die noetige Klasse
 */
function showTeaser () {
    $("#teaser").addClass("teaserstyle");
    $("#teaser").css({"display" : "block"});
}

/**
 * Zeigt den INhalt der Startseite direkt an
 */
function showContent () {
    $("#teaser").css({"display" : "none"});
    $("body .links, body .rechts").css({"display" : "block"});
    $("#footer").css({"display" : "block"});
    $(".hr").css({"display" : "block"});
}

/**
 * Zeigt nacheinander die Elemente der Startseite an, blendet den Teaser vorher aus
 */
function fadeContent() {
    $("#teaser").fadeOut("slow");
    window.setTimeout('$("body .links:first").fadeIn("slow")', 500);
    window.setTimeout('$("body .rechts:first").fadeIn("slow")', 1000);
    window.setTimeout('$(".hr").fadeIn("slow")', 1200);
    window.setTimeout('$("body .links:eq(1)").fadeIn("slow")', 1500);
    window.setTimeout('$("body .rechts:eq(1)").fadeIn("slow")', 2000);
    window.setTimeout('$("#footer").fadeIn("slow")', 2000);
}

$(document).ready(function(){
    $("a").focus(function () {$(this).blur();});
    
    /* Focus on inputs and textareas */
    $(":text,.textfeld,textarea").focus( function() {
        $(this).css({"background-color": "#d6d5ef"});
    });
    $(":text,.textfeld,textarea").blur( function() {
        $(this).css({"background-color": "#FFFFFF"});
    });
    
    /* Teaser */
    if($("body").hasClass("teaser") && $("#teaser").hasClass("verstecken")) {
        // Auf Startseite -> Teaser anzeigen
        hideContent();
        showTeaser();
        window.setTimeout("fadeContent()", 5000);
    }

});