function fotoalbum(div) { this.url = "/_gui/_ components/_ anzeige/fotoalbum/xFotoalbum.asp"; this.div = div; this.divStatus = gEL("fotoAlbumStatus"); this.pp = 0; this.gallery=false; var g = div.getAttribute("gallery"); if(g==1) this.gallery = true; } fotoalbum.prototype.init = function() { if(this.lvFotoalbum) this.lvFotoalbum.load("lade Alben .."); this.initZoom(); this.initThumbs(); } fotoalbum.prototype.initThumbs = function() { if(this.gallery) { var div = this.div; }else{ var div = gEL("fotoAlbumPix"); } var tbl = gEL2(div,"tblThumbs",true); if(!tbl) return; var typ = tbl.getAttribute("typ"); var spans = tbl.getElementsByTagName("span"); this.path = "/cgi-bin/"+web.webname+"/images/fotoalbum/"; this.pix = new Array(); this.capt = new Array(); var obj = this; var ze=0; for(i=0;i < spans.length;i++) { var span = spans[i]; var picID = span.getAttribute("picID"); if(picID) { var capt = span.getAttribute("capt"); var z = capt.split("\n"); this.pix.push(picID); this.capt.push(capt); span.ze = ze; span.onclick = function() { obj.picModal(this.ze); } ze=ze+1; } } var divPix = gEL("fotoAlbumPix"); if(divPix) { if(!divPix.innerHTML=="") { this.status2("lade Bilder vor .."); this.preLoad(); } } } fotoalbum.prototype.lvFotoalbum_Click = function(tag,selItem) { this.pp = 0; var albumID = tag; this.status2(web.sandclock+" Album '"+selItem[1]+"' wird geladen .."); setVisible("fotoAlbumPix",false); var data = "web%3d.html"+web.webname+"&album="+albumID; xmlhttp(this.url,data,this.doneload,"",this); } fotoalbum.prototype.doneload = function(ret) { //dodebug(ret); var obj = this; setContent("fotoAlbumPix",ret); setVisible("fotoAlbumPix",true); this.initThumbs(); } fotoalbum.prototype.hover = function(td,cod) { var cl = "galleryThumb"; if(cod==true) var cl = "galleryThumbHover"; td.className = cl; } fotoalbum.prototype.picModal = function(ndx) { this.initNavi(); this.ndx=ndx; showOverlay(); zorder0("picZoomStatus"); centerObj("picZoomStatus"); setVisible("picZoomStatus",true); var big = this.path + this.pix[ndx]+".jpg"; this.pic.src = big; var capt = this.capt[ndx]; setContent("picZoomNaviCapt",capt); var posi = this.getSprache("Bild")+" "+parseInt(ndx+1) + "/"+this.capt.length; setContent("tblNaviPos",posi); } fotoalbum.prototype.initZoom = function() { createOverlayDiv(); this.pic = gEL("picBigNavi"); this.pic.onload = function() { var frm = gEL("picZoomNavi"); setVisible("picZoomStatus",false); zorder0("picZoomNavi",99999); centerObj("picZoomNavi"); setVisible(frm,true); } } fotoalbum.prototype.initNavi = function() { var obj = this; var tblNavi = gEL("tblNavi"); var li = gEL2(tblNavi,"links"); var re = gEL2(tblNavi,"rechts"); li.onclick = function() {obj.skipPic(-1)}; re.onclick = function() {obj.skipPic(1)}; } fotoalbum.prototype.skipPic = function(no) { var nu = this.ndx+no; if(nu<0) nu = this.capt.length-1; if(nu>this.capt.length-1) nu = 0; this.picModal(nu); } fotoalbum.prototype.status2 = function(txt) { var vis = false; if(getWert(txt)!=="") { var vis = true; txt = web.sandclock + " "+txt } setVisible(this.divStatus,vis); setContent(this.divStatus,txt); } fotoalbum.prototype.preLoad = function() { if(this.pp==this.pix.length-1) { this.status2(""); return; } var obj = this; var pic = new Image(); pic.onload = function() { obj.status2("geladen: "+obj.pp+"/"+obj.pix.length) obj.pp = obj.pp+1; obj.preLoad(); } var src = this.path + this.pix[this.pp]+".jpg"; pic.src = src; } fotoalbum.prototype.getSprache = function(tx) { switch(web.lang) { case "d": return tx; break; case "cz": switch(tx) { case "Bild": return "Obrázek"; break; } break; } }