window.addEvent('domready', function(){

  var bodyElement = $(document.body);
  var sizeW = bodyElement.getSize();


  // First we create a Fx.Morph instance which we will use to move the contact box
  var schalter = $('contactPopupTrigger');
  var target = $('contactPopup');
  var fx = new Fx.Morph(target, {
    duration: 700,
    link: 'chain'
  });

  // If you click the '@', the contact box should come up
  schalter.addEvent('click', function(event){
    event.stop();
    if (target.getStyle("height")=="0px"){
      fx.options.transition = Fx.Transitions.Bounce.easeOut;
      fx.start({
      height: [250]
      });
    }
    else{
      fx.options.transition = Fx.Transitions.Bounce.easeOut;
      fx.start({
      height: [0]
      });
    }
  });

});
