// created 2008-06-10 by Ulrich Petri & Christoph Kepper
window.addEvent("domready", function() {
       
        /**
        * Assigns ReMooz behavior to all anchors with the .remooz class
        */
        if (ReMooz) {
            //ReMooz.initialize();
            ReMooz.assign(".remooz", {
                centered: true,
                origin: 'img',
                'cutOut': false, // don't hide the original
                'opacityResize': 0.4 // opaque resize
            });
        }
        //ReMooz.assign();

        /**
        * Or assign ReMooz "by hand"
        */
        $$('#imgzoom a').each(function(element) {
            var el = $$('.headers')[0];
            // Constructor, takes the element and options as arguments
            new ReMooz(element, {
                'origin': 'img', //origin: element.getElement('img') // Take the image inside as origin for the zooming element
                'shadow': 'onOpenEnd', // fx is faster because shadow appears after resize animation
                'resizeFactor': 0.8, // resize to maximum 80% of screen size
                'cutOut': false, // don't hide the original
                'opacityResize': 0.1, // opaque resize
                'dragging': false, // disable dragging
                'centered': true, // resize to center of the screen, not relative to the source element
                'onOpen': function() {
                    var dim = el.getSize();
                    el.setStyle('height', dim.y);
                    el.getElements(".sIFR-replaced").setStyle('display', 'none');
                },
                'onCloseEnd': function() {
                    el.setStyle('height', 'auto');
                    el.getElements(".sIFR-replaced").setStyle('display', 'block');
                }
            });

        });

    });

