/**************************************************************************/
/******************************* functions.js *****************************/
/**************************************************************************/




/**************************************************************************/
/* Show / Hide Top Navigation */
	
	function showMenu(){	
	
		if($j('#ContentTopNavigation').is(':hidden')) {
		
			$j('#ContentTopNavigation').slideDown();	
			
			$j('#ContentTopNavigation').mouseleave(function() {				
				$j('#ContentTopNavigation').slideUp('');	
			});		
			
		}
		
	}
	


/**************************************************************/
// Set Content Height wen Content zu klein


	function setContentHeight(){
			
		var iAbstand = 655;
		
		
		var oContent = $j('#idContentElement');
		var oContentTop = $j('#idContentElementTop');
		var oContentBottom = $j('#idContentElementBottom');
		
		
		// Höhe auf Auto setzen
		oContent.css('height','auto');
		
		var iContentHeightCurrent = oContent.height() + oContentTop.height() + oContentBottom.height();
		
		
		// Wenn in ContentBottom Box Inhalt
		if( $j(oContentBottom).children().length > 0 )
		{
			iAbstand = iAbstand + oContentBottom.height();
			iContentHeightCurrent = oContent.height() + oContentTop.height();
		}
		
		
		// Browser Height ermitteln
		var iBrowserHeight = $j(window).height();	
		
		var iContentHeight = iBrowserHeight - iAbstand;
		
		
		
		// Wenn Content < wie verfügbare Browser höhe dan höhe von Content Setzen
		if ( iContentHeightCurrent < iContentHeight ) {			
			
			// Höhe des Contents Anpassen
			oContent.css('height', iContentHeight+'px' )
		}
		
		
	}




/**************************************************************************/
/* Contact Adress  */

	function showContact( oObject, sHeadline, sName, sTelefon, sMail, sImage ){	
	
		oObject = $j(oObject);
	
		if ( !oObject.hasClass('active') ){
	
			// alle Links zurücksetzen
			$j('#contactTextTable a').each(function(index) {
				$j(this).removeClass('active');
			});
		
			// Link setzen
			oObject.addClass('active');
		
			
			// Text Austauschen
				$j('#contactContent').fadeOut(500,'linear',function(){
														   
					// Texte Austauschen
						$j('#contactHeadline').html(sHeadline);
						$j('#contactName').html(sName);
						$j('#contactTelefon').html(sTelefon);
						
						var sHtmlMail = ""
						
						if (sMail != ""){
							var sHtmlMail = '<a href="mailto:'+ sMail +'">'+ sMail +'</a>';								
						}			
						
						$j('#contactEmail').html(sHtmlMail);
						
					// Text Einblenden
						$j('#contactContent').delay(200).fadeIn(500);
				
				});
								
			
			// Image Austauschen			
				$j('#contactImage').fadeOut(500,'linear',function(){
				
					var sHtmlImage = 'fileadmin/images/visuals/'+ sImage +'';
					$j('#contactImage').attr('src',sHtmlImage);	
					
					$j('#contactImage').delay(200).fadeIn(500);
				
				});
			
		}
	}
	
	
/**************************************************************************/	
