// JavaScript Document
var aktiveTab, lastAktiveTab;
var hoverTab, lastHoverTab;
var cut;

$(document).ready(function() {
	 	if (FirstPageLoad == "NEIN") 
         {     
      return false;
         }
	 	else {
//When page loads...
  $(".tabs_container").hide(); //Hide all content
	$("#HfD_Header > ul.tabs li:first").addClass("active").show(); //Activate first tab
//	$(".tabs_container:first").show(); //Show first tab content
  $(".tabs_container:first").show();
  aktiveTab = $("#HfD_Header > ul.tabs li:first").find("a").attr("href"); //Find the href attribute value to identify the active tab + content
  Cut = aktiveTab.search(/#/);
	lastAktiveTab = aktiveTab;
	lastHoverTab = aktiveTab;
	FirstPageLoad = "NEIN";
	return false;
 		     }
                          	});

$(function() {
    $("#HfD_Header > ul.tabs li").hover(function() {
	 	$(".tabs_container").hide(); //Hide all content
		$("#HfD_Header > ul.tabs li").removeClass("hover"); //Remove any "hover" class
    $(lastAktiveTab.substring(Cut) +".tabs_container").fadeOut(); //Fade in the active ID content   
		$(this).addClass("hover"); //Add "active" class to selected tab	  
		hoverTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
    $(hoverTab.substring(Cut)+ ".tabs_container").fadeIn();  
    $(hoverTab.substring(Cut)+ ".tabs_container").show();  
		lastHoverTab  = hoverTab;
	                                              return false;
                                                 	});           
 		
	
	 $("#HfD_Header > div.resetAll").hover(function() {	  
	 	if (lastHoverTab == lastAktiveTab) 
         {
      return false;
         }
	 	else {
       $("#HfD_Header > ul.tabs li").removeClass("hover"); //Remove any "hover" class
       $(lastHoverTab.substring(Cut) +".tabs_container").fadeOut(); //Fade in the active ID content   
	  	 $(lastAktiveTab.substring(Cut)+ ".tabs_container").fadeIn(); //Fade in the active ID content   
       $(lastAktiveTab.substring(Cut)+ ".tabs_container").show(); 
       lastHoverTab = lastAktiveTab; 
		  return false;
		                                      }
		                                      return false;
                                                    	});
                                                    	
	  $("#HfD_Header > div.panes").hover(function() {
	 	if (lastHoverTab == lastAktiveTab) 
	 	     {
      return false;
         }
	 	else {
  	   $("#HfD_Header > ul.tabs li").removeClass("hover"); //Remove any "hover" class
       $(lastHoverTab.substring(Cut) +".tabs_container").fadeOut(); //Fade in the active ID content   
		   $(lastAktiveTab.substring(Cut)+ ".tabs_container").fadeIn(); //Fade in the active ID content   
       $(lastAktiveTab.substring(Cut)+ ".tabs_container").show;  
       lastHoverTab = lastAktiveTab;
		  return false;
		                                      }
		                                      return false;
                                              	});


	//On Click Event
  	$("#HfD_Header > ul.tabs li").click(function() {
		$(".tabs_container").hide(); //Hide all content
		$("#HfD_Header > ul.tabs li").removeClass("active"); //Remove any "active" class
		$("#HfD_Header > ul.tabs li").removeClass("hover"); //Remove any "hover" class
		$(this).addClass("active"); //Add "active" class to selected tab
		activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		lastAktiveTab = activeTab;
	  $(lastAktiveTab.substring(Cut)+ ".tabs_container").fadeIn(); //Fade in the active ID content     
    $(lastAktiveTab.substring(Cut)+ ".tabs_container").show();  
		lastHoverTab = lastAktiveTab;
	                                            return false;
                                                 	});
				return false;
            });


 $(function() {
     $.fn.fancyzoom.defaultsOptions.imgDir='http://www.hf-dusslingen.de/fileadmin/template/main/images/Menu1Level/Slide/';
     $("img.HfD_Ih").fancyzoom();
     return false;
                });

 $(function() {
     $.fn.fancyzoom.defaultsOptions.imgDir='http://www.hf-dusslingen.de/fileadmin/template/main/images/Menu1Level/Slide/';
     $("img.HfD_Iv").fancyzoom();
     return false;
                });





