﻿function Galery(){
    var self = this;
    this.photos=new Array();
    this.photoslink=new Array();
    this.tooltip=new Array();
    this.which=0;
    this.preloadedimages=new Array();
    //Hier wird entschieden ob die Bilder verlinkt sind oder nicht (1=verlinkt)
    var linkornot=1;

   Galery.prototype.addImage = function (path) {
        this.photos.push(path);
        this.preloadedimages.push(new Image());
        this.preloadedimages[this.photos.length-1].src=this.photos[this.photos.length-1];
    }    

    Galery.prototype.backward = function (galery,big_image_src){
        if (this.which>0){
            this.which--;
            document.getElementById(galery).src=this.photos[this.which];
            document.getElementById(big_image_src).src=this.photos[this.which];
        }
    }
    
    Galery.prototype.forward = function (galery,big_image_src){
        if (this.which<this.photos.length-1){
            this.which++;
            document.getElementById(galery).src=this.photos[this.which];
            document.getElementById(big_image_src).src=this.photos[this.which];
        }
    }
    
    Galery.prototype.switch_content = function (big_image_src,big_image,specs){
        document.getElementById(big_image_src).src=this.photos[this.which];
        document.getElementById(big_image).style.display = "";
        document.getElementById(specs).style.display = "none";
    }

     Galery.prototype.switch_back = function (big_image_src,big_image,specs){
        document.getElementById(big_image_src).src=this.photos[this.which];
        document.getElementById(big_image).style.display = "none";
        document.getElementById(specs).style.display = "";
    }

    Galery.prototype.showPrev = function (){
        Tip('<img src=\'' + this.photos[this.which] + '\' width=\'400\' height=\'320\'>', WIDTH, 400, BGCOLOR, '#ffffff', BGCOLOR, '#af111d', FONTCOLOR, '#ffffff', FONTSIZE, '12px', BORDERCOLOR, '#a9a9a9')
    }

    Galery.prototype.hidePrev = function (galery){
        UnTip()
    }
}
