+/*
+ This is a part of mkgallery.pl suite
+ http://www.average.org/mkgallery/
+
+ Uses mootools (1.2) http://www.mootools.net/
+ Uses slideshow http://www.phatfusion.net/slideshow/
+*/
+
+/*
+ Slideshow
+*/
+
+var showWindow = new Class({
+
+ getOptions: function(){
+ return {
+ zIndex: 2,
+ container: document.body,
+ onClick: $empty,
+ };
+ },
+
+ initialize: function(div,options){
+ this.setOptions(this.getOptions(), options);
+
+ this.options.container = $(this.options.container);
+
+ this.div = $(div);
+ this.div.setStyles({
+ position: 'absolute',
+ left: '0px',
+ top: '0px',
+ width: '100%',
+ zIndex: this.options.zIndex,
+ overflow: 'hidden',
+ display: 'none'
+ });
+ this.div.addEvent('click', function(){
+ this.options.onClick();
+ }.bind(this));
+
+ this.position();
+
+ window.addEvent('resize', this.position.bind(this));
+ window.addEvent('scroll', this.position.bind(this));
+ },
+
+ position: function(){
+ if(this.options.container == document.body){
+ var h = window.getHeight()+'px';
+ var s = window.getScrollTop()+'px';
+ this.div.setStyles({top: s, height: h});
+ }else{
+ var myCoords = this.options.container.getCoordinates();
+ this.div.setStyles({
+ top: myCoords.top+'px',
+ height: myCoords.height+'px',
+ left: myCoords.left+'px',
+ width: myCoords.width+'px'
+ });
+ }
+ },
+
+ show: function(){
+ this.div.setStyles({display: 'block'});
+ },
+
+ hide: function(){
+ this.div.setStyles({display: 'none'});
+ }
+});
+showWindow.implement(new Options);
+
+/* Make overlay window and start slideshow */
+function run_slideshow(startid) {
+ showwin.show();
+ show.stop();
+ if (startid < 0) {
+ show.play(0);
+ } else {
+ show.play(startid);
+ show.stop();