/* * EpLightBox */ var arrImages_; var iCurrentImage_; var iIntervall_ = 3000; var iFrameWidth_ = 20; var iFrameHeight_ = 20; var iControlHeigth_ = 30; var gsImageID_ = "epLBImage"; var bStop_ = true; var iMinWidth_ = 200; var oWaitImage_; var bImagesLoaded = false; /** * Array mit Images aufbauen */ function initImageList() { var i; var oImages = document.getElementsByTagName("a"); arrImages_ = new Array(); iCurrentImage_ = 0; for (i=0; i 0) { var oImageContainer = document.getElementById("image-container"); oImageContainer.style.display = "block"; if(parseInt(window.innerHeight) > 0) oImageContainer.style.height = parseInt(window.innerHeight)+"px"; if(parseInt(document.body.scrollHeight) > 0) oImageContainer.style.height = parseInt(document.body.scrollHeight)+"px"; oImageContainer.style.top = "0px"; goImage = new Image(); iCurrentImage_ = 0; for(var i=0; i window.innerWidth) { iImageWidth = window.innerWidth - 60; goImage.height = goImage.height * iImageWidth / goImage.width; goImage.width = iImageWidth; } var iImageHeight = parseInt(goImage.height); if(iImageHeight > window.innerHeight) { iImageHeight = window.innerHeight - 60; goImage.width = goImage.width * iImageHeight / goImage.height; goImage.height = iImageHeight; } if(iImageWidth < iMinWidth_) { iImageWidth = iMinWidth_; } var oImageFrame = document.getElementById("image-frame"); oImageFrame.style.display = "none"; oImageFrame.style.width = (iImageWidth+2*iFrameWidth_)+"px"; oImageFrame.style.height = (iImageHeight+2*iFrameHeight_+iControlHeigth_)+"px"; var iLeft = (parseInt(window.innerWidth) - 20 - parseInt(oImageFrame.style.width)) / 2; var iTop = (parseInt(window.innerHeight) - 40 - parseInt(oImageFrame.style.height)) / 2 - iControlHeigth_/2; if(iTop < 0) { iTop = 0; } if(iLeft < 0) { iLeft = 0; } oImageFrame.style.left = iLeft +"px"; oImageFrame.style.top = (iTop + getscrolltop())+"px"; oImageArea.style.width = iImageWidth+"px"; oImageArea.style.height = iImageHeight+"px"; iLeft = iFrameWidth_; iTop = iFrameHeight_; oImageArea.style.left = iLeft +"px"; oImageArea.style.top = iTop +"px"; var oOldImage = document.getElementById(gsImageID_); if(oOldImage != null) { hideDefaultButtons(); hidePlayingButtons(); oImageArea.removeChild(oOldImage); } goImage.id = gsImageID_; oImageArea.appendChild(goImage); if(bStop_) $j( "#image-area" ).fadeIn( 400, function() { showDefaultButtons(); }); else $j( "#image-area" ).fadeIn( 400, function() { showPlayingButtons(); }); } function hideDefaultButtons() { var oDefaultButtons = document.getElementById("default-buttons"); oDefaultButtons.style.top = iFrameHeight_+"px"; oDefaultButtons.style.display = "none"; } function showDefaultButtons() { hidePlayingButtons(); var oImageArea = document.getElementById("image-area"); var oDefaultButtons = document.getElementById("default-buttons"); oDefaultButtons.style.top = (iFrameHeight_+parseInt(oImageArea.style.height))+"px"; oDefaultButtons.style.display = "block"; } function hidePlayingButtons() { var oPlayingButtons = document.getElementById("playing-buttons"); oPlayingButtons.style.top = iFrameHeight_+"px"; oPlayingButtons.style.display = "none"; } function showPlayingButtons() { hideDefaultButtons(); var oPlayingButtons = document.getElementById("playing-buttons"); var oImageArea = document.getElementById("image-area"); oPlayingButtons.style.top = (iFrameHeight_+parseInt(oImageArea.style.height))+"px"; oPlayingButtons.style.display = "block"; } function setButtonState() { if(document.useraction.intervall.options[0].selected) { iIntervall_ = 3; document.useraction1.intervall1.selectedIndex = 0; } else if(document.useraction.intervall.options[1].selected) { iIntervall_ = 5; document.useraction1.intervall1.selectedIndex = 1; } else if(document.useraction.intervall.options[2].selected) { iIntervall_ = 10; document.useraction1.intervall1.selectedIndex = 2; } else if(document.useraction.intervall.options[3].selected) { iIntervall_ = 20; document.useraction1.intervall1.selectedIndex = 3; } else if(document.useraction.intervall.options[4].selected) { iIntervall_ = 30; document.useraction1.intervall1.selectedIndex = 4; } iIntervall_ *= 1000; bStop_ = false; } function intervallChanged() { var iNewIntervall = 5; if(document.useraction1.intervall1.options[0].selected) { document.useraction.intervall.selectedIndex = 0; iNewIntervall = 3; } else if(document.useraction1.intervall1.options[1].selected) { document.useraction.intervall.selectedIndex = 1; iNewIntervall = 5; } else if(document.useraction1.intervall1.options[2].selected) { document.useraction.intervall.selectedIndex = 2; iNewIntervall = 10; } else if(document.useraction1.intervall1.options[3].selected) { document.useraction.intervall.selectedIndex = 3; iNewIntervall = 20; } else if(document.useraction1.intervall1.options[4].selected) { document.useraction.intervall.selectedIndex = 4; iNewIntervall = 30; } iIntervall_ = iNewIntervall*1000; } function play() { showPlayingButtons(); loadNextImage(); window.setTimeout("continuePlay()", iIntervall_) } function continuePlay() { if(!bStop_) play(); } function stop() { bStop_ = true; showDefaultButtons(); } function closeLB() { bStop_ = true; hideDefaultButtons(); hidePlayingButtons(); var oImageArea = document.getElementById("image-area"); oImageArea.style.display = "none"; var oImageContainer = document.getElementById("image-container"); oImageContainer.style.display = "none"; var oImageFrame = document.getElementById("image-frame"); oImageFrame.style.display = "none"; return false; } function getCurrentDocumentID() { return document.getElementById("docid").firstChild.nodeValue; } function loadNextImage() { iCurrentImage_ = iCurrentImage_ + 1; if(iCurrentImage_ >= arrImages_.length) iCurrentImage_ = 0; goImage = new Image(); goImage.src = arrImages_[iCurrentImage_].href; loadLBImage(); } function loadPrevImage() { iCurrentImage_ = iCurrentImage_ - 1; if(iCurrentImage_ < 0) iCurrentImage_ = arrImages_.length-1; goImage = new Image(); goImage.src = arrImages_[iCurrentImage_].href; loadLBImage(); } function Appear() { $j( '#image-area' ).fadeIn( 600 ); } function getscrolltop() { var y = 0; if (typeof(window.pageYOffset) != "undefined") y = window.pageYOffset; else { var obj = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ? window.document.documentElement : window.document.body || null; y = obj.scrollTop; } return y; } function setscrolltop(y) { window.scrollBy(0, y); return false; }