window.addEvent('domready', function(){

var slidecontent = $$('.slidecontent');
var togslide = $$('.toggle');

	slidecontent.each(
	function(el, i){

		var slider = new Fx.Slide(el);
		slider.hide();
		//var myEffects = new Fx.Styles(el, {duration: 1000, transition: Fx.Transitions.linear});

		togslide[i].addEvent('click', function(){
			slider.toggle();
			togslide[i].toggleClass('toggle_act');
		});
});

if($('borosfuehrungen_form')){
var borosfuehrungen_form = $('borosfuehrungen_form');
var borosfuehrungen_select = $('borosfuehrungen_select');
var formactionurl = borosfuehrungen_form.action;
borosfuehrungen_form.action = formactionurl + '&type=111';
                               
var daycontainer = $('ajaxcontainer'); 
var fadeFx = new Fx.Style(daycontainer, 'opacity', {duration: 500, wait: false} );

function ajaxrequest() {
    this.send({
        update: daycontainer,
        onComplete: function() {
            fadeFx.start(1);
            showtips();        
        }
    });    
}


borosfuehrungen_form.addEvent('submit', function(e) {
    Tips2 = null;
    fadeFx.start(0);
    new Event(e).stop();
	ajaxrequest.delay(500, $('borosfuehrungen_form'));
});

borosfuehrungen_select.addEvent('change', function(e) {
    Tips2 = null;
    fadeFx.start(0);
    new Event(e).stop();
    ajaxrequest.delay(500, $('borosfuehrungen_form'));
});



function showtips() {
    var Tips2 = new Tips($$('.blockrow'), {
        initialize:function(){
            this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 300, wait: false}).set(0);
        },
        onShow: function(toolTip) {
            this.fx.start(1);
        },
        onHide: function(toolTip) {
            this.fx.start(0);
        }
    });
}
}

});

