/*   */

// Global Variables
var whereami="";
var start = "";
var last = "sachlicheBeratung";
var lastP = "heinzdarius";

function writeCSS(){
    document.write('<style type="text/css">');
    //
    if (start == "home") {
        document.write('#headmenue  {display:none;}'); 
        document.write('#homebox    {display:none;}');
        document.write('#footer     {display:none;}');
    } else {
        document.write('#starkePartner, #sinnvolleNetzwerke { display:none; }'); 
    }
    document.write('</style>');
}



function putin(what,ajax) {
if (browser=="ie5") {
    alert("Sie benutzen Internetexplorer 5, bitte benutzten Sie zur korrekten Funktion der Webseite Internet Explorer 6 oder Firefox");

} 
else {
    if (what != whereami) {
        // Navigation
        $("#a_" + whereami).removeClass("active");
        $("#a_" + what).addClass("active");

        whereami = what;
        
        $("#footer").fadeOut('fast');
        $("#maintext").fadeOut('fast',function(){
            if (what!="Kanzlei") { $("#subnavi").fadeOut('fast'); }
            $("#maintext").load("content/" + what + ".php?ajax=ajax",0,function(){
                $("#maintext").fadeIn('slow');
                $("#footer").fadeIn('slow');
                if (what == "Kanzlei") {
                    changeKanzlei('sachlicheBeratung');
                    last = "sachlicheBeratung";
                    $("#subnavi").fadeIn(3000);
                }
            });
        });
    }
  }
}

function changeKanzlei(what) {
    if (last != what) {
        $("#a_" + what).addClass('active');
        $("#a_" + last).removeClass('active');
        $("#" + last).fadeOut('slow',function() {
            $("#" + what).fadeIn('slow', function() {
            	$("#" + what).css('border-bottom', '1px solid #fff');
            });
            $("#" + last).css('border-bottom', 'none');
        });
    last = what;    
    }
}
function showPartner(what) {
    if (lastP != what) {
        $("#" + lastP).slideUp('slow').each(function() {
            $("#" + what).slideDown('slow');
        });
    lastP = what;
    } else {
        $("#" + what).slideDown('slow');
    }
}


function dohome () {
    if (start == "home") {
        $("#homebox").fadeIn(2000, function () {
            $("#headmenue").fadeIn(3000);
            $("#footer").fadeIn(6000);
        });
    }
}

