function in_array (needle, haystack, argStrict) {
    var key = '', strict = !!argStrict;
    if (strict) {
        for (key in haystack) {
            if (haystack[key] === needle) {
                return true;
            }
        }
    } else {
        for (key in haystack) {
            if (haystack[key] == needle) {
                return true;
            }
        }
    }
    return false;
}

function Lightbox() {

    var that = this;
    
    this.element = $('<div id="lightbox"></div>');
    this.header = $('<div class="header"><img src="/images/site/lightbox-figuren.png" class="decoration" /></div>');
    this.content = $('<div class="content" id="lightbox-content"></div>');
    this.title = $('<h1 id="lightbox-title"></h1>');
    this.close = $('<a href="#" id="lightbox-close"></a>');
    this.header.prepend(this.title).append(this.close);
    this.element.append(this.header).append(this.content);    

    this.show = function(h) {
        var height = h || 741;
        $("body").append(that.element);
        $("#wrapper, #header, #footer").fadeOut(1000, function() {
            that.element.animate({
                width: 1039,
                height: height,
                opacity: 1}, 1000, "swing", function() {
                    that.header.animate({
                        top: 20}, 1000, "swing", function() {
                            //if (that.setScrollerWidth) that.setScrollerWidth();
                            
                            that.close.click(function() {
                                that.hide();
                                return false;
                            });
                                                       
                            if (that.videoscrollcontainer) {
                                
                                that.videoscrollcontainer.mousemove(function(e) {
                                    
                                    var y =$(this).offset().top - e.pageY;
                                    
                                    if (y > -113) {
                                        if (that.scrollable) {
                                            var x = e.pageX - $(this).offset().left;
                                            var width = $(this).outerWidth();
                                            var fullwidth = that.videoscroller.outerWidth();
                                            
                                            var multiplier = (1 - ((width - x) / width)) * (fullwidth - width);
                                            
                                        } else {
                                            multiplier = 0;
                                        }                                        
                                    }
                                    that.videoscroller.css("marginLeft", -multiplier);
                                });                                
                            }
                        });
                    }
                );
            }
        );
    }

    this.hide = function() {
        that.header.animate({
            top: 153}, 1000, "swing", function() {
                that.element.animate({
                    width: 0,
                    height: 0,
                    opacity: 0}, 1000, function() {
                        that.element.remove();
                        $("#wrapper, #header, #footer").fadeIn(1000);
                    }
                );
            }
        )
    }
}

function checkBoekingsFrame(e) {
    try {
        var loc = window.frames.zoekenboek.location.href;
        if (loc == "about:blank") {
            boeking.hideNow();
        }
    } catch(e) {
        
    }
}

var BoekingsLightbox = function() {

    var that = this;

    Lightbox.call(this);

    var w = 1039;
    var h = 731;

        //src='http://www.virtueelboeken.nl/index.asp?u=2191&type=zoekenboek&stylesheet=http://test.sprookjescamping.nl/css/zoekenboek.css&taal=' \

    this.iframe = $("<iframe \
        src='http://www.virtueelboeken.nl/index.asp?u=2191&type=zoekenboek&stylesheet=http://test.sprookjescamping.nl/css/zoekenboek.css&taal=' \
        frameborder='0' \
        scrolling='no' \
        width='" + w + "' \
        height='" + h + "' \
        name='zoekenboek' \
        onload='checkBoekingsFrame()' \
    ></iframe>");

    this.iframe.css({
        marginLeft: -3,
        marginTop: -3
    });

    this.content.append(this.iframe);

    this.setText = function(txt) {
        this.title.text(txt.title);
        this.close.text(txt.close);
    }

    this.show = function(h) {
        var height = h || 741;
        $("body").append(that.element);
        $("#wrapper, #header, #footer").fadeOut(1000, function() {
            that.element.animate({
                width: 1039,
                height: height,
                opacity: 1}, 1000, "swing", function() {
                    that.header.animate({
                        top: 20}, 1000, "swing", function() {
                            that.close.click(function() {
                                that.hide();
                                return false;
                            });
                        })
                    }
                );
            }
        );
    }

    this.hide = function() {
        
        that.iframe.hide();
        $('#enquete a').die('click');
        
        $('div#enquete').remove();
        
        var enquete = $('<div id="enquete"></div>'),
            backlink = $("<a title='terug naar de site' href='#'>Terug naar de site</a>"),
            verderlink = $("<a title='verder met boeken' href='#'>Verder met boeken</a>").click(function() {
                enquete.remove();
                that.iframe.show();
            }),
            list = $('<ul></ul>');
            
        $('#enquete a').live('click', that.vote);
        
        enquete.append("U wilt uw reservering afbreken. Wilt u zo vriendelijke zijn om de volgende vraag te beantwoorden zodat wij in de toekomst nog beter aan uw wensen kunnen voldoen!<h2>Ik breek de reservering af omdat:</h2>");    
        
        list.append("<li><a title='geen plaats meer' href='#'>Er geen plaats meer vrij is</a></li>");
        list.append("<li><a title='te duur' href='#'>Ik het te duur vind</a></li>");
        list.append("<li><a title='snap het boekingsprogramma niet' href='#'>Ik het boekingsprogramma niet zo goed snap</a></li>");
        list.append("<li><a title='wil nu nog geen beslissing nemen' href='#'>Ik nu nog geen beslissing wil nemen</a></li>");
        
        //list.append(verderlink);
        //list.append(backlink)
        
        enquete.append(list).append(verderlink).append(backlink);
        
        that.content.append(enquete);
        
        //that.iframe[0].contentWindow.location.href = 'about:blank';
    }
    
    this.vote = function() {
        $.ajax({
            url: '/enquete.php',
            data: { 'title': $(this).attr('title') }
        });
        if ($(this).attr('title') != 'verder met boeken') that.hideNow();
    }

    this.hideNow = function() {
        that.header.animate({
            top: 153}, 1000, "swing", function() {
                that.element.animate({
                    width: 0,
                    height: 0,
                    opacity: 0}, 1000, function() {
                        that.element.remove();
                        $("#wrapper, #header, #footer").fadeIn(1000);
                    }
                );
            }
        );            
    }


}

BoekingsLightbox.prototype = new Lightbox();
BoekingsLightbox.prototype.constructor = BoekingsLightbox;

var PanoramaLightbox = function() {

    var that = this;

    Lightbox.call(this);

    var w = 687;
    var h = 458;

    this.iframe = $("<iframe \
        src='' \
        frameborder='0' \
        scrolling='no' \
        width='" + w + "' \
        height='" + h + "' \
        name='panorama' \
    ></iframe>");

    this.iframe.css({
        margin: 10,
        marginLeft: -320,
        position: 'relative',
        left: '50%'
    });

    this.content.append(this.iframe);

    this.setText = function(txt) {
        this.title.text(txt.title);
        this.close.text(txt.close);
    }

    this.setPicture = function(src) {
        this.iframe.attr('src', src);
    }

}

PanoramaLightbox.prototype = new Lightbox();
PanoramaLightbox.prototype.constructor = PanoramaLightbox;

var PlattegrondLightbox = function() {

    var that = this;

    Lightbox.call(this);

    var w = 1014;
    var h = 711;

    this.iframe = $("<iframe \
        src='http://www.sprookjesfiles.nl/imap/index.html' \
        frameborder='0' \
        scrolling='no' \
        width='" + w + "' \
        height='" + h + "' \
        name='panorama' \
    ></iframe>");

    this.iframe.css({
        margin: 10,
        marginLeft: -510,
        position: 'relative',
        left: '50%'
    });

    this.setText = function(txt) {
        this.title.text(txt.title);
        this.close.text(txt.close);
    }

    this.content.append(this.iframe);
}

PlattegrondLightbox.prototype = new Lightbox();
PlattegrondLightbox.prototype.constructor = PlattegrondLightbox;

var MediaLightbox = function() {

    var that = this;

    Lightbox.call(this);

    this.init = false;

    this.lightboxheader = $("<div id='lightboxheader'></div>");
    this.videoscrollcontainer = $("<div id='scrollcontainer'></div>");
    this.videoscroller = $("<ul id='videoscroller'></ul>");
    this.info = $("<div class='info'></div>");
    this.videocatlbl = $("<span></span>");
    this.videocat = $("<span class='cat' id='videocat'></span>");
    this.buttons = $("<div class='buttons'></div>");
    this.pagebuttons = $("<div class='pagebuttons'></div>");
    this.catback = $("<a href='#' id='catback'></a>");
    this.nextvideocat = $("<a href='#' id='nextvideocat'></a>");
    this.prevvideocat = $("<a href='#' id='prevvideocat'></a>");
    this.nextpage = $("<a href='#' id='nextpage'></a>");
    this.prevpage = $("<a href='#' id='prevpage'></a>");
    this.arrowleft = $('<a href="#" id="scrollarrow-left" class="scrollarrow"><img src="/images/site/pijl-links.png" /></a>')
    this.arrowright = $('<a href="#" id="scrollarrow-right" class="scrollarrow"><img src="/images/site/pijl-rechts.png" /></a>');

    this.pageindex = 0;
    this.itemsperpage = 20;
    this.items = 0;
    this.pages = 0;
    this.txt = null;

    this.openCat = 0;

    this.videoscrollcontainer.append(this.videoscroller);
    this.lightboxheader.append(this.arrowleft).append(this.arrowright);
    this.lightboxheader.append(this.videoscrollcontainer);
    this.info.append(this.videocatlbl).append(this.videocat);
    this.buttons.append(this.catback).append(this.nextvideocat).append(this.prevvideocat);
    this.pagebuttons.append(this.nextpage).append(this.prevpage);
    this.scrollable = false;

    this.setScrollerWidth = function() {
            //$("ul#scroller > li.active").each(function() {
                var thiswidth = 0;
                that.videoscroller.children("li").each(function() {
                    thiswidth += 140;
                });
                if (thiswidth > that.videoscroller.outerWidth()) {
                    that.arrowleft.show();
                    that.arrowright.show();
                    that.videoscroller.width(thiswidth);
                    that.scrollable = true;

                } else {
                    that.arrowleft.hide();
                    that.arrowright.hide();
                    that.scrollable = false;
                }
            //});
        }
    
    this.setText = function(txt) {
        this.txt = txt;
        this.videocatlbl.text(txt.catlbl);
        this.catback.text(txt.catback);
        this.title.text(txt.title);
        this.close.text(txt.close);
        this.nextvideocat.text(txt.catnext);
        this.prevvideocat.text(txt.catprev);
        this.nextpage.text(txt.pagenext);
        this.prevpage.text(txt.pageprev);
    }

    this.clearText = function() {
        that.title.text("");
        that.close.text("");
        that.content.html("");
    }

    this.showVideoCat = function() {
        this.ytiframe.attr('src', '');
        this.ytcontainer.hide();
        if (this.slideshowbutton) {
            this.slideshowbutton.hide();
        }
        this.videoscroller.children("li").children("ul.active").show();
        this.videoscroller.children("li").children("ul").children("li").removeClass('active');
        this.nextvideocat.show().unbind();
        this.prevvideocat.show().unbind();
        this.catback.hide();
        this.nextvideocat.click(function() {
            that.nextVideoCat(true);
            return false;
        });
        this.prevvideocat.click(function() {
            that.nextVideoCat(false);
            return false;
        });
        this.nextvideocat.text(this.txt.catnext);
        this.prevvideocat.text(this.txt.catprev);
    }

    this.switchVideoCat = function(target) {
        var index = $("ul#videoscroller > li").index($(target).parent());
        //$("ul#videoscroller > li > ul").hide().removeClass('active');
        //$($("ul#videoscroller > li")[index]).children("ul").show().addClass('active');
        //$("#videocat").text($(target).children("span").text());

        that.gotoCat(index);
    }

    this.gotoCat = function(index) {

        var active = that.videoscroller.children("li").children("ul.active").parent();
        var li = that.videoscroller.children("li");

        li.children("ul").hide().removeClass('active');
        $(li[index]).children("ul").show().addClass('active');
        
        var selected = $(li[index]).children("ul.active");
        var bigimages = selected.find("li > a");
               
        bigimages.each(function() {
            var image =  new Image();
            image.src = $(this).attr('rel');
        });

        that.videocat.text($(li[index]).children("a").children("span").text());

        var newActive = that.videoscroller.children("li").children("ul.active").parent();
        that.pageindex = 1;
        var items = newActive.children('ul');
        that.items = items.children('li').length;
        that.pages = Math.ceil(parseInt(that.items) / parseInt(that.itemsperpage));

        if (that.pages > 1) {
            that.pagebuttons.show();
            this.nextpage.unbind();
            this.prevpage.unbind();
            that.nextpage.click(function() {
                that.nextPage();
                return false;
            });

            that.prevpage.click(function() {
                that.prevPage();
                return false;
            });
//            items.children('li:gt(' + that.itemsperpage - 1 + ')').hide();
            that.gotoPage(that.pageindex);
        } else {
            that.pagebuttons.hide();
        }

        //that.videocat.text(active.children("a").children("span").text());

    }

    this.nextPage = function() {
        if (that.pageindex < that.pages) {
            that.pageindex++;
        } else {
            that.pageindex = 1;
        }
        that.gotoPage(that.pageindex);
    }

    this.prevPage = function() {
            if (that.pageindex > 1) {
                that.pageindex--;
            } else {
                that.pageindex = that.pages;
            }
            that.gotoPage(that.pageindex);
    }

    this.gotoPage = function(index) {

        var items = $("ul.active");
        var goTo = parseInt(parseInt(index - 1) * parseInt(that.itemsperpage - 1));
        var start = (index - 1) * (that.itemsperpage);
        var end = start + that.itemsperpage;
        items.children('li:lt(' + start + ')').hide();
        items.children('li:lt(' + end + '):gt(' + start + ')').show();
        items.children('li::eq(' + start + ')').show();
        items.children('li:gt(' + end + ')').hide();
        items.children('li::eq(' + end + ')').hide();
    }

    this.firstVideoActive = function() {
        //this.videoscroller.children("li:first").children("ul").addClass("active");
        //this.videocat.text(this.videoscroller.children("li:first").children("a").children("span").text());
        that.gotoCat(that.openCat);
    }

    this.nextVideoCat = function(next) {
        var active = that.videoscroller.children("li").children("ul.active").parent();
        var li = that.videoscroller.children("li");
        var index = li.index(active);
        if (next) {
            if (index < li.length - 1) {
                index++;
            } else {
                index = 0;
            }
        } else {
            if (index > 0) {
                index--;
            } else {
                index = li.length - 1;
            }
        }
        that.gotoCat(index);
        //li.children("ul").hide().removeClass('active');
        //$(li[index]).children("ul").show().addClass('active');
        //that.videocat.text(active.children("a").children("span").text());
    }
}

MediaLightbox.prototype = new Lightbox();
MediaLightbox.prototype.constructor = MediaLightbox;

var VideoLightbox = function() {

    var that = this;

    MediaLightbox.call(this);

   
    this.categories = ['restaurant', 'sanitair', 'zwemmen', 'camping', 'theater', 'verhuur', 'activiteiten', 'van alles'];
    this.cats = [];

    this.ytlink = $('<a href="http://www.youtube.com/sprookjescamping34" target="_blank" class="youtube-link"><img src="/images/site/youtube-link.png" /></a>');
    //this.ytiframe = $('<iframe id="yt-big" name="ytplayer-big" type="text/html" width="638" height="391" src="" frameborder="0"></iframe>');
    this.ytiframe = $('<div id="yt-big"></div>');
    this.ytcontainer = $('<div class="videoplayer" id="yt-big-container"></div>')
    this.ytcontainer.append(this.ytlink).append(this.ytiframe);

    this.nextVideo = function() {
        function nextVideo(next) {
            //var index = $("ul#videoscroller > li > ul.active > li").index($("ul#videoscroller > li > ul.active > li.active"));
            var active = videoscroller.children("li").children("ul.active").children("li");
            var activeli = videoscroller.children("li").children("ul.active").children("li.active");
            var index = active.index(activeli)
            if (next) {
                if (index < active.length - 1) {
                    index++;
                } else {
                    index = 0;
                }
            } else {
                if (index > 0) {
                    index--;
                } else {
                    index = active.length - 1;
                }
            }
            activeli.removeClass('active');
            active[index].addClass('active');
            var id = activeli.children('a').attr('rel');
            this.loadVideo('http://www.youtube.com/v/' + id + '?autoplay=1&color1=0x552b81&color2=0x9963d4&fs=1');
        }
    }

    this.loadVideo = function(link) {
        that.ytiframe.html(" ");
        that.ytiframe.html('<object width="638" height="391"><param name="movie" value="' + link + '"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="' + link + '?color1=0x552b81&color2=0x9963d4&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="638" height="391"></embed></object>');
    }

    this.showVideoPlayer = function() {
        that.videoscroller.children("li").children("ul").hide();
        that.ytcontainer.show();
        that.nextvideocat.hide();
        that.prevvideocat.hide();
        that.catback.show();
        that.pagebuttons.hide();
        that.nextvideocat.text(that.txt.next);
        that.prevvideocat.text(that.txt.prev);
    }

    $.getJSON('http://gdata.youtube.com/feeds/users/sprookjescamping34/uploads?alt=json-in-script&callback=?', function(data) {

        $.each(data.feed.entry, function(i, item) {

            var video = item['id']['$t'];
            var keywords = item['media$group']['media$keywords']['$t'].toLowerCase().split(", ");
            var categorized = false;
            for (key in keywords) {
                if (in_array(keywords[key], that.categories)) {
                    if (!that.cats[keywords[key]]) that.cats[keywords[key]] = [];
                    that.cats[keywords[key]].push(item);
                    categorized = true;
                }
            }
            video = video.replace('http://gdata.youtube.com/feeds/videos/','');
            item.id = video;
            if (!categorized) {
                if (!that.cats['van alles']) that.cats['van alles'] = [];
                that.cats['van alles'].push(item);
            }
        });
        for(key in that.cats) {
            var li = $("<li></li>");
            var lilink = $("<a href='#'><img src='" + that.cats[key][0]['media$group']['media$thumbnail'][0]['url'] + "' width='100' height='75' /><span>" + key + "</span></a>");
            lilink.click(function() {
                that.showVideoCat();
                that.switchVideoCat(this);
                return false;
            });
            li.append(lilink);
            var ul = $("<ul class='videocat'></ul>");
            li.append(ul);
            for (entry in that.cats[key]) {
                var video = $("<li></li>")
                var videolink = $("<a href='http://www.youtube.com/v/" + that.cats[key][entry].id + "?color1=0x552b81&color2=0x9963d4&fs=1' target='ytplayer-big'><img src='" + that.cats[key][entry]['media$group']['media$thumbnail'][3]['url'] + "' width='140' /></a>");
                videolink.click(function() {
                    that.showVideoPlayer();
                    that.loadVideo($(this).attr('href'));
                    return false;
                });
                ul.append(video.append(videolink));
            }
            that.videoscroller.append(li);
            that.setScrollerWidth();
        }

        that.content.append(that.ytcontainer.hide());
        that.content.append(that.lightboxheader);
        that.content.append(that.info);
        that.content.append(that.buttons);
        that.catback.click(function() {
            that.showVideoCat();
            return false;
        });
        that.showVideoCat();
        that.firstVideoActive();
   });
}

VideoLightbox.prototype = new MediaLightbox();
VideoLightbox.prototype.constructor = VideoLightbox;

var FotoLightbox = function() {
    
    var that = this, slideshow;

    MediaLightbox.call(this);

    this.ytdesc = $('<div id="image-description"></div>');
    this.ytiframe = $('<img src="" id="image-player-big" height="458" />');
    this.ytcontainer = $('<div class="imageplayer" id="yt-big-container"></div>');
    this.slideshowbutton = $("<a href='#' id='slideshowbutton' style='display: block;'></a>");
    
    this.buttons.append(this.slideshowbutton);
    this.slideshowbutton.hide();
    this.slideshowbutton.text("Slideshow starten");
    
                that.content.append(that.ytcontainer.hide());
                that.content.append(that.lightboxheader);
                that.content.append(that.info);
                that.content.append(that.buttons);
                that.content.append(that.pagebuttons);
       
    this.slideshowbutton.click(function() {
        if (!slideshow) {
            that.slideshowbutton.text("Slideshow stoppen");
            $("#nextvideocat, #prevvideocat").hide();
            slideshow = setInterval(function() {
                that.nextImage(true);
                }, 5000);            
        } else {
            that.slideshowbutton.text("Slideshow starten");
            $("#nextvideocat, #prevvideocat").show();
            clearInterval(slideshow);
            slideshow = null;
        }
        return false;
    });
    
    this.ytcontainer.append(this.ytiframe).append(this.ytdesc);

    this.showImagePlayer = function() {
        this.slideshowbutton.show();
        $('#image-player-big').load(function() {
            $(this).fadeIn();
        });
        $("ul#videoscroller > li > ul").hide();
        $("#yt-big-container").show();
        $("#nextvideocat, #prevvideocat").unbind();
        $("#catback").show();
        $("#nextvideocat").click(function() {
            that.nextImage(true);
            return false;
        });
        $("#prevvideocat").click(function() {
            that.nextImage(false);
            return false;
        });
        that.pagebuttons.hide();
        //that.nextvideocat.text(that.txt.next);
        //that.prevvideocat.text(that.txt.prev);
        that.nextvideocat.text("Volgende foto");
        that.prevvideocat.text("Vorige foto");
    }

    this.nextImage = function(next) {
        var index = $("ul#videoscroller > li > ul.active > li").index($("ul#videoscroller > li > ul.active > li.active"));
        if (next) {
            if (index < $("ul#videoscroller > li > ul.active > li").length - 1) {
                index++;
            } else {
                index = 0;
            }
        } else {
            if (index > 0) {
                 index--;
            } else {
                index = $("ul#videoscroller > li > ul.active > li").length - 1;
            }
        }
        $("ul#videoscroller > li > ul.active > li.active").removeClass('active');
        $($("ul#videoscroller > li > ul.active > li")[index]).addClass('active');
        var id = $("ul#videoscroller > li > ul.active > li.active").children('a').attr('rel');
        $("#image-player-big").fadeOut(500, function() {
            $(this).attr('src', id);
        });
//        $("#image-player-big").attr('src', id);
        $("#image-description").html($("ul#videoscroller > li > ul.active > li.active").children('a').children('img').attr('description').replace(/\n/g,'<br />'));
    }

    this.open = function(index) {
        this.openCat = index;
        //$("ul#videoscroller > li > ul").hide().removeClass('active');
        //$($("ul#videoscroller > li")[index]).children("ul").show().addClass('active');
        //$("#videocat").text($("ul#videoscroller > li > ul.active").parent().children("a").children("span").text());
    }
    
    this.init = function() {
                that.setScrollerWidth();
                that.catback.click(function() {
                    that.showVideoCat();
                    return false;
                });
                that.showVideoCat();
                that.videoscroller.children("li").children("a").click(function() {
                    that.showVideoCat();
                    that.switchVideoCat(this);
                    return false;
                });
                that.firstVideoActive();        
    }

    this.countitems = 0;
    this.counti  =0;

    $.getJSON('http://picasaweb.google.com/data/feed/api/user/statistieken@sprookjescamping.nl?alt=json-in-script&access=public&start-index=1&callback=?', function(data) {

        that.countitems = data.feed.entry.length;

        $.each(data.feed.entry, function(i, item) {

            var li = $("<li><a href='#'></a></li>");
            var rel = item.link[0].href;;
            var img = $('<img />').attr('alt', item.title.$t);
            var span = $("<span></span>").text(item.title.$t);

            li.children("a").append(img);
            li.children("a").append(span);
            var ul = $("<ul class='videocat'></ul>");

            $.getJSON(rel + "&access=public&start-index=1&callback=?", function(data) {
                that.counti++;
                img.attr('src', data.feed.entry[0]['media$group']['media$thumbnail'][0]['url']);
                $.each(data.feed.entry, function(i, item) {
                    var thumbnail = $('<li></li>');
                    var link = $('<a style="width: 170px; text-align: center;" href="#" rel="' + item['media$group']['media$content'][0]['url'] + '"><img description="' + item['media$group']['media$description']['$t'] + '" src="' + item['media$group']['media$thumbnail'][1]['url'] + '" height="108" /></a>');
                    link.click(function() {
                        that.ytiframe.attr('src', $(this).attr('rel'));
                        that.ytdesc.html($(this).children('img').attr('description').replace(/\n/g,'<br />'));
                        that.showImagePlayer();
                        return false;
                    })
                    ul.append(thumbnail.append(link));
                });
                li.append(ul);
                that.videoscroller.append(li);
                if (that.counti == that.countitems) {
                    that.init();
                }

            });


        });

    });

}

FotoLightbox.prototype = new MediaLightbox();
FotoLightbox.prototype.constructor = FotoLightbox;
