// JavaScript Document

var ajax_load = "<img src='img/loading.gif' alt='loading...' style='margin-left:320px'/>";
var content1 = "sets/home.html";
var content2 = "sets/kulissen.html";
var content3 = "sets/lebenslauf.html";
var content4 = "sets/kunden.html";
var content5 = "sets/galerie.html";
var content6 = "sets/impressum.html";
var globalActiveNav = 0;

$.ajaxSetup ({  
        cache: true  
    });

// content change(via ajax) and animations

function loadContent1() {
    if (globalActiveNav != 1) {
        $("#content").animate({
            opacity: 0.0
        }, 500, function () {
            $("#content").html(ajax_load).load(content1, null, function () {
                $("#content").animate({
                    opacity: 1.0
                }, 500);
            });
        });
        $("#nav2").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav3").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav4").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav5").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav6").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        globalActiveNav = 1;
    };
};
function loadContent2() {
    if (globalActiveNav != 2) {
        $("#content").animate({
            opacity: 0.0
        }, 500, function () {
            $("#content").html(ajax_load).load(content2, null, function () {
                $("#content").animate({
                    opacity: 1.0
                }, 500);
            });
        });
        $("#nav1").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav3").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav4").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav5").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav6").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        globalActiveNav = 2;
    };
};
function loadContent3() {
    if (globalActiveNav != 3) {
        $("#content").animate({
            opacity: 0.0
        }, 500, function () {
            $("#content").html(ajax_load).load(content3, null, function () {
                $("#content").animate({
                    opacity: 1.0
                }, 500);
            });
        });
        $("#nav1").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav2").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav4").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav5").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav6").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        globalActiveNav = 3;
    };
};
function loadContent4() {
    if (globalActiveNav != 4) {
        $("#content").animate({
            opacity: 0.0
        }, 500, function () {
            $("#content").html(ajax_load).load(content4, null, function () {
                $("#content").animate({
                    opacity: 1.0
                }, 500);
            });
        });
        $("#nav1").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav2").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav3").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav5").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav6").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        globalActiveNav = 4;
    };
};
function loadContent5() {
    if (globalActiveNav != 5) {
        $("#content").animate({
            opacity: 0.0
        }, 500, function () {
            $("#content").html(ajax_load).load(content5, null, function () {
                $("#content").animate({
                    opacity: 1.0
                }, 500);
            });
        });
        $("#nav1").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav2").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav3").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav4").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav6").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        globalActiveNav = 5;
    };
};
function loadContent6() {
    if (globalActiveNav != 6) {
        $("#content").animate({
            opacity: 0.0
        }, 500, function () {
            $("#content").html(ajax_load).load(content6, null, function () {
                $("#content").animate({
                    opacity: 1.0
                }, 500);
            });
        });
        $("#nav1").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav2").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav3").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav4").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        $("#nav5").animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
        globalActiveNav = 6;
    };
};

// navigation hover effects

function mouseover1() {
    if (globalActiveNav != 1) {
        $("#nav1").stop().animate({
            backgroundColor: "#6e801d",
            color: "#ff4b00"
        }, 300);
    };
};
function mouseover2() {
    if (globalActiveNav != 2) {
        $("#nav2").stop().animate({
            backgroundColor: "#6e801d",
            color: "#ff4b00"
        }, 300);
    };
};
function mouseover3() {
    if (globalActiveNav != 3) {
        $("#nav3").stop().animate({
            backgroundColor: "#6e801d",
            color: "#ff4b00"
        }, 300);
    };
};
function mouseover4() {
    if (globalActiveNav != 4) {
        $("#nav4").stop().animate({
            backgroundColor: "#6e801d",
            color: "#ff4b00"
        }, 300);
    };
};
function mouseover5() {
    if (globalActiveNav != 5) {
        $("#nav5").stop().animate({
            backgroundColor: "#6e801d",
            color: "#ff4b00"
        }, 300);
    };
};
function mouseover6() {
    if (globalActiveNav != 6) {
        $("#nav6").stop().animate({
            backgroundColor: "#6e801d",
            color: "#ff4b00"
        }, 300);
    };
};


function mouseout1() {
    if (globalActiveNav != 1) {
        $("#nav1").stop().animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
    };
};
function mouseout2() {
    if (globalActiveNav != 2) {
        $("#nav2").stop().animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
    };
};
function mouseout3() {
    if (globalActiveNav != 3) {
        $("#nav3").stop().animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
    };
};
function mouseout4() {
    if (globalActiveNav != 4) {
        $("#nav4").stop().animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
    };
};
function mouseout5() {
    if (globalActiveNav != 5) {
        $("#nav5").stop().animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
    };
};
function mouseout6() {
    if (globalActiveNav != 6) {
        $("#nav6").stop().animate({
            backgroundColor: "#cc9e58",
            color: "#434d45"
        }, 300);
    };
};
