$(document).ready(function(){
	$("#header .intext").toggleVal();
	$("#nav li").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});
	$('a[@rel*=lightbox]').lightBox();

	$(".post-it .close").click(function(){
		$(this).parents(".post-it").animate({ opacity: 'hide' }, "slow");
                $.cookie("myPopup", "cancelled", { expires: 7 });
	});

	$(".anim #intro .teaser li")
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0 -90px)"}, {duration:500})
	})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:500})
	})

	$(".anim #intro .teaser li.bg1")
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0 -180px)"}, {duration:500})
	})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:500})
	})

        if ($.cookie("myPopup")!='cancelled') {
          $("#myPopup").show();
        }

        $('#calender .item').mouseover(function() {
          $(this).find('.prog').show();
          $(this).find('img').hide();
        });
        $('#calender .item').mouseout(function() {
          $(this).find('.prog').hide();
        });

	var biggestHeight = 0;
	$('#intro .section .standard').each(function(){
		if($(this).height() > biggestHeight){
			biggestHeight = $(this).height();
		}
	});


    function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
    }

    equalHeight(jQuery("#intro .section .relations"));

	  //$('#intro .section .regular').height(biggestHeight);	
	  //$('#intro .section .extended').height(122);	
	  //$('.landing #intro .section .extended').height(auto);
        $('.landing #intro .section .extended').css({height: 'auto'});
        $('#intro .section .relations.extended').css({height: 'auto'});
});
