/*
 * function to set the footer on the end of the browser window
 */
function setFooter(offSet) {
	var windowHeight= $(window).height();
	if (windowHeight>0) {
		
		var contentHeight = 0;
		var headerHeight = $('#header').height();
		var footerHeight = $('#footer').height();
		
		if($('#content').height() != null )
			contentHeight = $('#content').height();
		else if($('#contentStart').height() != null)
			contentHeight = $('#contentStart').height();
		else if($('#helperPage').height() != null)
			contentHeight = $('#helperPage').height();
		
		//alert('content: '+contentHeight+' - header: '+headerHeight+' - footer: '+footerHeight);
		if (windowHeight-(contentHeight+footerHeight+headerHeight+offSet)>=0) {
			$('#footer').css('position', 'absolute');
			//hier +1 da FF das Fenster vergrößert hatte beim anklicken der Footernavigation
			$('#footer').css('top', windowHeight-(footerHeight+1) );
			$('#footer').css('left', '0');
		}
	}
}

/*
 * function to hide the typo when the typo goes over the content 
 */
function setTypo() {
	var windowWidth= $(window).width();
	if (windowWidth>0) {
		
		var footerWidth = 0;
		var typoWidth = $('#typo').width();
		
		$('#typo').css('width', typoWidth);
		
		$('#footerNavi').children().each(function(index) {
			footerWidth += $(this).width()+2;
		});
		
		footerWidth = footerWidth + $('#language').width();
		
		if (windowWidth-(footerWidth+typoWidth)>=0) {
			$('#typo').show();
		} else {
			$('#typo').hide();
		}
	}
}

/*
 * function to hide content elements to bring the backgroundimage in focus
 */
function hideContent(){
	// hide elements
	$('#typo').hide();
	$('#typo').addClass('displayNone');
	$('#footer').hide();
	$('.addthis_toolbox').hide();
	$('.secondNaviContainer').hide();
	$('#container').hide();
	$('#container2row').hide();
	$('#container3row').hide();
	$('.search').hide();
	
	//show element
	$('#loginContent').css('display', 'block');
}

/*
 * function to show content elements
 */
function showContent(){
	// hide element
	$('#loginContent').css('display', 'none');
	
	// show elements 
	$('#typo').show();
	$('#typo').removeClass('displayNone');
	$('#footer').show();
	$('.addthis_toolbox').show();
	$('.secondNaviContainer').show();
	$('#container').show();
	$('#container2row').show();
	$('#container3row').show();
	$('.search').show();
}

/*
 *  function to clear the searchbox field
 */ 
function clearValue(feld,formname) {
	document.forms[formname].elements[feld].value = "";
	return true;
}
