$(document).ready(function() {	 

$("#divNoJavaScript").hide();

root = "http://sukopp.jmb-design.com/wp-content/themes/kettlebell/";
	

	
	$('#divContentSliderContent').show();
		
	$('#divContentSlider').toggle(function() {
			$('#divContentSliderContent').slideToggle('fast');
			$('.sliderAction').css('background-image','url(' +root+ 'images/pfeil_bottom.png)');
			$('.sliderAction').html('einblenden');
	}, function(){
			$('#divContentSliderContent').slideToggle('fast');
			$('.sliderAction').css('background-image','url(' +root+ 'images/pfeil_top.png)');
			$('.sliderAction').html('ausblenden');
	});	


	$('.faqs h2').toggle(function() {
		$(this).next().slideDown('fast');
		$(this).css('background-image','url(' +root+ 'images/arrow-up.gif)');

	}, function() {
		$(this).next().slideUp('fast');
		$(this).css('background-image','url(' +root+ 'images/arrow-down.gif)');
	}).next().hide();
	
	$('.faqClose').click(function(){
		$(this).parent().parent().slideUp('fast');
		$(this).parent().parent().next('h2').css('border','1px solid red');
		$(this).parent().parent().parent().find('h2').css('background-image','url(' +root+ 'images/arrow-down.gif)');		
	});
	
	$("div.seminarRow:nth-child(odd)").css("background-color", "#e7e7e7");
  	$("div.seminarRow:nth-child(even)").css("background-color", "#fff");	


function openFAQ(what) {
 		$('#divContent h4 a[name="'+what+'"]').parent().next('div').toggle();
 		$('#divContent h4 a[name="'+what+'"]').parent().css('background-image','url(' +root+ 'images/show-more-details-on.gif)');
		$('#divContent h4 a[name="'+what+'"]').parent().toggleClass('clickFAQ');
}


	$('.seminarHeight').syncHeight();
	
	


	

});

(function($) {
        $.fn.syncHeight = function(config) {
                var defaults = {
                        updateOnResize: false   // re-sync element heights after a browser resize event (useful in flexible layouts)
                };
                var options = $.extend(defaults, config);
                
                var e = this;
                
                var max = 0;
                var browser_id = 0;
                var property = [
                        // To avoid content overflow in synchronised boxes on font scaling, we 
                        // use 'min-height' property for modern browsers ...
                        ['min-height','0px'],
                        // and 'height' property for Internet Explorer.
                        ['height','1%']
                ];

                // check for IE6 ...
                if($.browser.msie && $.browser.version < 7){
                        browser_id = 1;
                }
                
                // get maximum element height ...
                $(this).each(function() {
                        // fallback to auto height before height check ...
                        $(this).css(property[browser_id][0],property[browser_id][1]);
                        var val=$(this).height();
                        if(val > max){
                           max = val;
                        }
                });
                
                // set synchronized element height ...
                $(this).each(function() {
                        $(this).css(property[browser_id][0],max+'px');
                });
                
                // optional sync refresh on resize event ...
                if (options.updateOnResize == true) {
                        $(window).resize(function(){ 
                                $(e).syncHeight();
                        });
                }
                return this;
        };      
})(jQuery);
