
function ShowPicture(e, o) {
    a = new YAHOO.widget.Panel("zoom", {
        modal:true,
        close:false,
        draggable:false,
        underlay:"none",
        constraintoviewport:true,
        effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5}
    });
    var img = document.createElement('img');
    img.src = o.url;
    img.width = o.width;
    img.height = o.height;
    a.setBody(img);
    a.render(document.body);
    a.center();
    a.show();
    YAHOO.util.Event.on(img, "click", function() {
        a.hide();
    });
    a.hideEvent.subscribe(function() {
        a.destroy();
    });
}

function ShowMorePictures(mod_id, images) {
    var oModule = new YAHOO.widget.Module(mod_id, {
        visible: false
    }); 
    YAHOO.util.Event.addListener("show_pict", "click", function() {
        if (!this.constructed) {
            for (i=0; i<images.length; i++) {
                var o = images[i];
                var img = document.createElement('img');
                img.src = o.icon;
                YAHOO.util.Event.on(img, 'click', ShowPicture, {url:o.src, width:o.width, height:o.height});
                this.appendToBody(img);
            }
            this.render();
            this.constructed = true;
        }
        if (this.visible) {
            this.hide();
            this.visible = false;
        } else {
            this.show();
            this.visible = true;
        }
    }, oModule, true);
}

