document.write('<style type="text/css">body{display:none}</style>');
jQuery(function ($) {
    $('body').css('display', 'block');
    $("#auswahl").animate({
        opacity: 1.0
    },
    500);
});

function blockError() {
    return true;
}

window.onerror = blockError;

$(document).ready(function () {
    $(".sub_nav").hide();
    $(".sub_nav2").hide();
    $(".sub_nav3").hide();
    $(".sub_nav4").hide();

    $("#welcome_message").css({
        opacity: 0.0
    });
    $("#auswahl").css({
        opacity: 0.0
    });

    $(".slideshow").click(function () {
        $("#welcome_message").animate({
            opacity: 0.0
        },
        900);
    });

    $(".close_div").click(function () {
        $("#welcome_message").animate({
            opacity: 0.0
        },
        900);
    });


    $("body").click(function () {
        $("#welcome_message").animate({
            opacity: 0.0
        },
        900);
    });




    $("img").animate({
        opacity: 1.0
    },
    300);

    $(".current_projekt_title").click(function () {
      
      
      
       if ($("#impressum").is(".active")) {
                $(".sub_nav2").animate({
                    opacity: 0.0,
                    height: '0px',
                    width: '0px',
                    top: "-10px"
                },
                900);
                $("#impressum").removeClass("active");
                $("#rgt_2").animate({
                    opacity: 0.0
                },
                200);
                $("#lft_2").animate({
                    opacity: 0.0
                },
                200);
            }

      
        if ($(this).is(".active")) {
            $(".sub_nav").animate({height: "toggle",opacity: 0.0 }, 900);
            $(".current_projekt_title .ecke").animate({opacity: 1.0 },900);
            $("#ecke_switch").animate({opacity: 0.0 },900);
            $(".current_projekt_title").removeClass("active");
            $("#rgt_2").animate({ opacity: 0.0},200);
            $("#lft_2").animate({opacity: 0.0},200);

        }

        else {
            $(".current_projekt_title").toggleClass("active");
            $(".sub_nav").animate({
                height: "toggle",
                opacity: 1.0
            },
            900);
             $(".current_projekt_title .ecke").animate({opacity: 0.0 },1100);
             $("#ecke_switch").animate({opacity: 1.0 },900);


            $("#welcome_message").animate({
                opacity: 0.0
            },
            900);
            $("#rgt_2").animate({
                opacity: 1.0
            },
            2000);
            $("#lft_2").animate({
                opacity: 1.0
            },
            2000);

            if ($("#kontakt").is(".active")) {
                $(".sub_nav3").animate({
                    opacity: 0.0,
                    height: '0px',
                    width: '0px',
                    top: "-10px"
                },
                900);
                $("#kontakt").removeClass("active");
            }

            if ($("#freunde").is(".active")) {
                $(".sub_nav4").animate({
                    opacity: 0.0,
                    height: '0px',
                    width: '0px',
                    top: "-10px"
                },
                900);
                $("#freunde").removeClass("active");
            }

           
        }
    });

    $("#impressum").click(function () {
        if ($(this).is(".active")) {
            $("#impressum").removeClass("active");
            $(".sub_nav2").animate({
                opacity: 0.0,
                height: '0px',
                width: '0px',
                top: "-10px"
            },
            900);
        }

        else {
            $("#impressum").toggleClass("active").css('zIndex', 100000);
            $(".sub_nav2").animate({ opacity: 1.0, height: '190px',width: '375px',top: "-181px"},
            900);
            $("#welcome_message").animate({
                opacity: 0.0
            },
            900);

            if ($(".current_projekt_title").is(".active")) {
                $(".sub_nav").animate({
                    height: "toggle",
                    opacity: 0.0
                },
                900);
                
              $(".current_projekt_title .ecke").animate({opacity: 1.0 },1100);
             $("#ecke_switch").animate({opacity: 0.0 },900);

                
                $(".current_projekt_title").removeClass("active");
                $("#rgt_2").animate({
                    opacity: 0.0
                },
                200);
                $("#lft_2").animate({
                    opacity: 0.0
                },
                200);
            }

            if ($("#freunde").is(".active")) {
                $(".sub_nav4").animate({
                    opacity: 0.0,
                    height: '0px',
                    width: '0px',
                    top: "-10px"
                },
                900);
                $("#freunde").removeClass("active");
            }

            if ($("#kontakt").is(".active")) {
                $(".sub_nav3").animate({
                    opacity: 0.0,
                    height: '0px',
                    width: '0px',
                    top: "-10px"
                },
                900);
                $("#kontakt").removeClass("active");
            }

        }
    });

    $("#kontakt").click(function () {
        if ($(this).is(".active")) {
            $(".sub_nav3").animate({
                opacity: 0.0,
                height: '0px',
                width: '100px',
                top: "-10px"
            },
            900);
            $("#kontakt").removeClass("active");
        }

        else {
            $("#kontakt").toggleClass("active");
            $(".sub_nav3").animate({
                opacity: 1.0,
                height: '250px',
                width: '340px',
                top: "-241px"
            },
            900);
            $(".sub_nav3").toggleClass("active");
            /*            $(".sub_nav2").animate({  opacity: 0.0, height: '0px', width: '0px', top: "-10px"}, 900 );     */
            $("#impressum").removeClass("active");
            $("#welcome_message").animate({
                opacity: 0.0
            },
            900);
            $("#auswahl").animate({
                opacity: 0.0
            },
            900);
            
                          $(".current_projekt_title .ecke").animate({opacity: 1.0 },1100);
             $("#ecke_switch").animate({opacity: 0.0 },900);

            

            if ($(".current_projekt_title").is(".active")) {
                $(".sub_nav").animate({
                    height: "toggle",
                    opacity: 0.0
                },
                900);
                $(".current_projekt_title").removeClass("active");
                $("#rgt_2").animate({
                    opacity: 0.0
                },
                200);
                $("#lft_2").animate({
                    opacity: 0.0
                },
                200);
            }

            if ($("#freunde").is(".active")) {
                $(".sub_nav4").animate({
                    opacity: 0.0,
                    height: '0px',
                    width: '0px',
                    top: "-10px"
                },
                900);
                $("#freunde").removeClass("active");
            }

            if ($("#impressum").is(".active")) {
                $(".sub_nav2").animate({
                    opacity: 0.0,
                    height: '0px',
                    width: '0px',
                    top: "-10px"
                },
                900);
                $("#impressum").removeClass("active");
            }

        }

    });

    $('.sub_nav #thumbs ul.thumbs li').css('opacity', onMouseOutOpacity).hover(
    function () {
        $(this).not('.selected').fadeTo('fast', 1.0);
    },
    function () {
        $(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
    });

    $("#freunde").click(function () {
        if ($(this).is(".active")) {
            $(".sub_nav4").animate({
                opacity: 0.0,
                height: '0px',
                width: '100px',
                top: "-10px"
            },
            900);
            $("#freunde").removeClass("active");
        }

        else {
            $("#freunde").toggleClass("active");
            $(".sub_nav4").animate({
                opacity: 1.0,
                height: '270px',
                width: '250px',
                top: "-261px"
            },
            900);
            $(".sub_nav4").toggleClass("active");
            /*            $(".sub_nav2").animate({  opacity: 0.0, height: '0px', width: '0px', top: "-10px"}, 900 );     */
            $("#impressum").removeClass("active");
            $("#welcome_message").animate({
                opacity: 0.0
            },
            900);
            $("#auswahl").animate({
                opacity: 0.0
            },
            900);
              $(".current_projekt_title .ecke").animate({opacity: 1.0 },1100);
             $("#ecke_switch").animate({opacity: 0.0 },900);


            if ($(".current_projekt_title").is(".active")) {
                $(".sub_nav").animate({
                    height: "toggle",
                    opacity: 0.0
                },
                900);
                $(".current_projekt_title").removeClass("active");
                $("#rgt_2").animate({
                    opacity: 0.0
                },
                200);
                $("#lft_2").animate({
                    opacity: 0.0
                },
                200);
            }

            if ($("#impressum").is(".active")) {
                $(".sub_nav2").animate({
                    opacity: 0.0,
                    height: '0px',
                    width: '0px',
                    top: "-10px"
                },
                900);
                $("#impressum").removeClass("active");
            }

        }

    });

    if ($("#kontakt").is(".active")) {
        $(".sub_nav3").animate({
            opacity: 0.0,
            height: '0px',
            width: '0px',
            top: "-10px"
        },
        900);
        $("#kontakt").removeClass("active");
    }

    $('.sub_nav #thumbs ul.thumbs li').css('opacity', onMouseOutOpacity).hover(
    function () {
        $(this).not('.selected').fadeTo('fast', 1.0);
    },
    function () {
        $(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
    });

});
