/* last edit: 2011-12-21/BK */
$(document).ready(function()
{
	$(document)[0].oncontextmenu = function()
	{
		return false;
	}
	
	function posSkipToTopLink()
	{
		var windowHeight = $('body').height();
		var containerHeight = $('#main').height();
		var contentHeight = $('#content').height();
		var placeOverContent = 155;	
		if((containerHeight + 155) < windowHeight)
		{
			var newYPosition = contentHeight +  7;
			$('p#skipToTop').css({'position':'absolute','top':newYPosition,'bottom':'auto'});
		}
	}
	posSkipToTopLink();
	$(window).resize(function()
    {
    	posSkipToTopLink();
    });
	
	$('ul.subNavLevel4').css('display','none').prev().addClass('triggerForNavLevel4');
	$('a.triggerForNavLevel4').click(function()
	{
		$(this).next().slideToggle();
		return false;
	});
	

			// markieren aus url
			var myurl = document.URL;
			var pos= '';
			if(myurl.indexOf('#')) var pos= ''+myurl.slice(myurl.indexOf('#') + 1,myurl.length);
			
			if($("#subnavi_avokal a[href='#"+pos+"']"))	$("a[href='#"+pos+"']").parent().addClass('aktiv_avokal');
			if($("#subnavi_heller a[href='#"+pos+"']"))	$("a[href='#"+pos+"']").parent().addClass('aktiv_heller');

			$('#subnavi_avokal #subNavLevel3 li').each(
						function( intIndex ){
						 
						// Bind the onclick event to simply alert the
						// iteration index value.
						$( this ).bind (
											"click",
											function(){
												// alles rücksetzten
												$('#subNavLevel3 li').removeClass('aktiv_avokal');
												$(this).addClass('aktiv_avokal');
											}
										);
						 
						}
			);
			$('#subnavi_heller #subNavLevel3 li').each(
						function( intIndex ){
						 
						// Bind the onclick event to simply alert the
						// iteration index value.
						$( this ).bind (
											"click",
											function(){
												// alles rücksetzten
												$('#subNavLevel3 li').removeClass('aktiv_heller');
												$(this).addClass('aktiv_heller');
											}
										);
						 
						}
			);
			

	
	
});
