var g_interval=null;var g_current=4;var g_strip=null;var g_preview=null;var g_init=false;function initProjektorbox(){if(!document.getElementById||!document.getElementsByTagName){return}g_preview=document.getElementById("projektorbox_preview");g_strip=document.getElementById("projektorbox_strip");startInterval();g_init=true;setActivePreview(0);for(i=0;i<5;i++){shadow=getShadowById(i);shadow.myOpacity=0.5;setOpacity(shadow)}}function startInterval(){stopInterval();g_interval=window.setInterval("handleInterval()",5000)}function stopInterval(){if(g_interval){window.clearInterval(g_interval)}}function handleInterval(){var a=g_strip.getElementsByTagName("span");next=(a[g_current+1]?g_current+1:0);setActivePreview(next)}function handleMouseOver(a){stopInterval();setActivePreview(a)}function setActivePreview(a){shadowThumb(a);switchOver(g_current,a);g_current=a}function shadowThumb(b){if(g_init){var a=g_strip.getElementsByTagName("span");for(i=0;i<a.length;i++){var c=a[i].getElementsByTagName("img")[1];if(b==i){c.style.display="block"}else{c.style.display="none"}}}}function switchOver(b,a){from=getPreviewById(b);to=getPreviewById(a);from.style.display="none";to.style.display="block"}function allOtherPreviewsInBackground(){for(i=0;i<5;i++){if(i!=g_current){var a=getPreviewById(i);a.style.display="none";a.myOpacity=0}}}function setOpacity(a){if(a.myOpacity>0.99){a.myOpacity=0.99;return}a.style.opacity=a.myOpacity;a.style.MozOpacity=a.myOpacity;a.style.filter="alpha(opacity="+(a.myOpacity*100)+")"}function getPreviewById(a){if(g_init){return g_preview.getElementsByTagName("div")[a]}}function getThumbnailById(a){if(g_init){return g_strip.getElementsByTagName("span")[a].getElementsByTagName("img")[0]}}function getShadowById(a){if(g_init){return g_strip.getElementsByTagName("span")[a].getElementsByTagName("img")[1]}};
