// We add the "invoke"-Method to Arrays
Array.implement({
    
    invoke: function(fn, args){
        var result = [];
        
        for (var i = 0, l = this.length; i < l; i++){
            if(this[i] && this[i][fn])
                result.push(args ? this[i][fn].pass(args, this[i])() : this[i][fn]());
        }
        return result;
    }
    
});



window.addEvent('domready', function(){
    
	
	var els = $$('div.element');
    var myArray = [
        new Fx.Tween(els[0]),
    ];

    var els2 = $$('div.element2');
    var myArray2 = [
        new Fx.Tween(els2[0]),
    ];
    
    var i = false;
    
    $('id36').addEvent('mouseover', function(e){
        e.stop();
        
        i = !i;
        myArray.invoke('start', ['height', i ? '140px' : '140px']);
        myArray2.invoke('start', ['height', i ? '0px' : '0px']);
    });
    $('id37').addEvent('mouseover', function(e){
        e.stop();
        
	    //var Hoehe2 = "<?echo $menuehoeheX2.' px';?>";
		
		i = !i;
        myArray.invoke('start', ['height', i ? '0px' : '0px']);
        myArray2.invoke('start', ['height', i ? '152px' : '152px']);
        //myArray2.invoke('start', ['height', i ? Hoehe2 : Hoehe2]);
    });
    $('id35').addEvent('mouseover', function(e){
        e.stop();
        
        i = !i;
        myArray.invoke('start', ['height', i ? '0px' : '0px']);
        myArray2.invoke('start', ['height', i ? '0px' : '0px']);
    });
    $('id38').addEvent('mouseover', function(e){
        e.stop();

        i = !i;
        myArray.invoke('start', ['height', i ? '0px' : '0px']);
        myArray2.invoke('start', ['height', i ? '0px' : '0px']);
    });
});
