// JavaScript Document

$(document).ready(function() {	
	


	$('#bild_hdr img').hide();
	
	var sidebar_h = $('#primary').height(); 
	var container_h = $('#container').height(); 

	if (sidebar_h > container_h ) {
		$('#container').css('min-height', sidebar_h);
	} if ( container_h > sidebar_h ) {
		$('#primary').css('min-height', container_h);
	}
	
	/*	
	if ( hoehe_1 > hoehe_2) {
		// console.log('ASDFG');
		$('.widget-area').height(hoehe_1);
	} else {
		// console.log('GFDSA');
		$('#container').height(hoehe_2);
	} */
	
	
	/* $('.menu ul li.page_item a ').each( function(){
			var bttn_width = (215 - $(this).width()) / 2;
			$(this).next('.children').css('left','-'+bttn_width+'px');			
	}); */
	
	// $('.menu ul ul').append('<li class="sub_last"></li>');
	


     $('#to_top').click(function(){
	     $('html, body').animate({scrollTop:0}, 200);
     });



			$('#sitemap').stop().animate({'opacity': '0'}, 300);
			$('#sitemap').hide();


			$('#sitemaphoverbutton').mouseenter(
			  function () {	$('#sitemap').stop().animate({'opacity': '1'}, 300) 
			  $('#sitemap').show();
			  }
			);		
			
			  $('#sitemaphvr').mouseleave(
			  function () {	$('#sitemap').stop().animate({'opacity': '0'}, 300) 
			   $('#sitemap').hide();
			  }
			);	

/* FANCY NAVI 
$('#access ul').css('display','block');

$('.children').animate({
    opacity: 0  }, 1, function() {
    // Animation complete.
  });

	$('.page_item a ').mouseenter( function(){
			var bttn_width = (215 - $(this).width()) / 2;
			$(this).next('.children').css('left','-'+bttn_width+'px');			
		}).hover(function(){
			$(this).next('.children').stop().animate({opacity: 1 }, 300, function() { // After Animation
		}) }, function() {
			if(	$('.children').hasClass('active_sub') ) {
			$(this).next('.children').removeClass('active_sub').stop().animate({opacity: 0 }, 300, function() { // After Animation
				});	
			} else {
	
			};
		});
	
	$('.children').mouseenter( function(){
			$(this).addClass('active_sub');
		}).mouseleave(function (){
			$(this).stop().animate({opacity: 0 }, 300, function() { // After Animation
		}); 
		});
 */

});
