function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

$(document).ready(function() {
	equalHeight($(".column"));
});




$(document).ready(function(){ 
$('#container').addClass('balken').css('height', $(document).height());
$('#footer').addClass('balken').css('top', $(document).height());
});






function fix_outerwrap_bug() { 
  $('#container').addClass('balken').css('height', $(document).height());
  $('#footer').addClass('balken').css('top', $(document).height());
}   



$(function($) { 
  fix_outerwrap_bug(); 
});


$(window).resize(function() { fix_outerwrap_bug(); });



//Tooltips aufrufen
$(document).ready(function(){

$('#nav a.navilink').tooltip({
	track: true,
	delay: 0,
	showURL: false,
	showBody: " - ",
	fade: 250
});

});




function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});






//Lightbox aktivieren
$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.80, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
		callback: function(){}
	});
});



$(document).ready(function(){

var src_img = $("#header img").attr("src");

$("input#logout").mouseover(function(){
$("#header img").attr("src","fileadmin/template/images/headeroff.jpg");
});

$("input#logout").mouseout(function(){
$("#header img").attr("src",src_img);
});

$("input#logout").click(function(){
logout_box();
setTimeout("window.location.href='http://ksc.pixelhasen.de/index.php?id=38&logintype=logout'", 3000);
return false;
});

});



function logout_box() {
$.nyroModalManual({
    type: "ajax",
    url: "index.php?id=74&type=101",
    width: 500,
    height: 400
  });
}
