$(document).ready( function() {
	
	initTabs();
	
	//INTRANET
	if($('#bgTopIntranet').length > 0){
		
		//HINTERGRUNDFARBE BODY
		$("body").addClass("intranet");
		
		//HINTERGRUNDFARBE LINKS NAVIGATION
		$("#containerMenu").css( { "border-left" : "5px solid #009cde" } );
		
		//<LI>
		$("#primNav").addClass("intranet");
		
		lastLi = $("body.intranet #containerMenu li.lev2:last");
		lastLi.addClass("intranetNavLiLast");

		$("li.lev1").each(function(i){
			if(i==1){
				$( this ).css( { "border-top" : "0" } );
			}
		});
		
		/*
		$('#primNav li.lev1').each( function() {
			if($('a', this).text().toLowerCase() == "intranet"){
				//der Intranet lev1 <li> Node
			}
		});
		*/
	}
	// INTRANET ENDE
});

// TABS
function initTabs(){
    //TABS
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content

    //On Click Event
    $("ul.tabs li").click(function() {

            $("ul.tabs li").removeClass("active"); //Remove any "active" class
            $(this).addClass("active"); //Add "active" class to selected tab
            $(".tab_content").hide(); //Hide all tab content

            var activeTab = $(this).find("a").attr("rel"); //Find the href attribute value to identify the active tab + content
            $(activeTab).show(); //Fade in the active ID content
            return false;
    });
}
