$(document).ready(function() {
						   
	// Bilder preloaden .....						   
	$('.navImg').preload({
		find: '.gif',
		replace: '_f2.gif'
	});

	// ZUERST aktuellen Hauptnavipunkt aktiv setzen
	if ($(mainNavID).length>0) {
		$(mainNavID).removeClass("navImg");

		$(mainNavID).attr("src",$(mainNavID).attr("src").split(".gif")[0]+"_f2.gif");
	}

	// DANN Mouseover/out für Buttons binden .....
	$('.navImg').mouseover(function() {
		$(this).attr("src",$(this).attr("src").split(".gif")[0]+"_f2.gif");
	});
	$('.navImg').mouseout(function() {
		$(this).attr("src",$(this).attr("src").split("_f2.gif")[0]+".gif");
	});

	// Auf der Home die Teaser nach unten fahren...
	$("#divTeaserSlider").animate({
		"top" : "360",
		"height": "100"
	},1000);

	// Und das Mouseover/Out für rauf-/runterfahren initialisieren
	$("#divTeaserSlider").mouseover(function() {
		$("#divTeaserSlider").stop().animate({
			"top" : "160",
			"height": "300"
		},300);
	});

	$("#divTeaserSlider").mouseout(function() {
		$("#divTeaserSlider").stop().animate({
			"top" : "360",
			"height": "100"
		},300);
	});

	// Klappmechanismus Newsheader initialisieren...
	$(".newsHeader").click(function() {
		$(this).next().slideToggle();
	});
/*
	$(".newsHeader").mouseover(function() {
		$(this).css("background-color","#eeeeee");
	});

	$(".newsHeader").mouseout(function() {
		$(this).css("background-color","#ffffff");
	});
*/
    $("#ulTabHeader").tabs();


	// Zum Schluss noch die IE6-Komptatibilität herstellen
//	$(document).pngFix();

    $('.lightbox').lightBox({txtImage:'Bild' , txtOf:'von'});

    $(document).click(function() {$("#divSubnavProdukte").hide(); });

    $('.ui-tabs-nav').bind('tabsselect', function(event, ui) {
      $("#divDownloads").hide();
    });
    $('.ui-tabs-nav').bind('tabsload', function(event, ui) {

        if(ui.index==3) {
        	$(".newsHeader").click(function() {
        		$(this).next().slideToggle();
        	});

   /*     	$(".newsHeader").mouseover(function() {
        		$(this).css("background-color","#eeeeee");
        	});

        	$(".newsHeader").mouseout(function() {
        		$(this).css("background-color","#ffffff");
        	});
*/
            $(".lightboxDessins").lightBox({txtImage:'Bild' , txtOf:'von'});
        }
    });
});



function showSubnavProduct() {
    $("#divSubnavProdukte").show();
}

function hideSubnavProduct() {
    $("#divSubnavProdukte").hide();
}

function showDownloads() {
    $("#divDownloads").toggle();
}

function hideDownloads() {
    $("#divDownloads").hide();
}

function showLoginMask() {
    $("#divLoginForm").animate({"top":"-1px"},500);
}

function hideLoginForm() {
   $("#divRegForm").hide();
     $("#divLoginForm").css("height","");
   $("#divLoginForm").animate({"top":"-132px"},500);
}

function showRegForm() {
   $("#divLoginForm").css("height","350px");
   $("#divRegForm").show();
}