/*generated file--do not edit*/var SBPGallery=(function(){var G=this,W=this.window,D=document,H=D.documentElement,B,MSIE
/*@cc_on = @_jscript_version @*/
,map={},hasFlash,nextLink,previousLink,aboutLink,fullscreenLink,slideshowLink,slideshowPlayText="\u25ba Slideshow",slideshowPauseText="Pause slideshow",slideshowResumeText="\u25ba Resume slideshow",viewportWidth,viewportHeight,photo,intrinsicWidth,intrinsicHeight,copy,hasGUI=true,isFadingIn,isFadingOut,loading,menu,menuBG,previewContainer,previewToolbar,preview,previewBG,thumbBar,thumbs,active,img,imgPreloader,replace,timer,hasSlideShow=false,slideShowIndex=0,slideShowLength,slideShowQueue,selected,scrollBar,overlay,aboutPage,aboutPageClose,aboutPageContent,aboutPageHeight;function delegate(e){var img=YAHOO.util.Event.getTarget(e);if("IMG"==img.nodeName.toUpperCase()){var a=img.parentNode.parentNode.getElementsByTagName("A");if(!selected||(selected!=a[0].href)){if(hasSlideShow){slideShowReset(true)}slideshowLink.style.visibility="hidden";hasFlash&&(fullscreenLink.style.visibility="hidden");aboutLink.style.visibility="hidden";setImage(img.parentNode)}YAHOO.util.Event.preventDefault(e)}}function slideShowNext(){setImage(map[map.list[slideShowIndex++]].image,slideShowDelay)}function slideShowDelay(){slideShowQueue=W.setTimeout(((slideShowIndex<slideShowLength)?slideShowNext:slideShowReset),SBP_GALLERY_SLIDESHOW_DELAY)}function slideShowPause(){W.clearTimeout(slideShowQueue);hasSlideShow=false;slideshowLink.removeChild(slideshowLink.firstChild);slideshowLink.replaceChild(D.createTextNode(slideshowResumeText),slideshowLink.firstChild);slideshowLink.onclick=slideShowContinue;return false}function slideShowContinue(){W.clearTimeout(slideShowQueue);hasSlideShow=true;slideShowSetPauseLink();setImage(map[map.list[slideShowIndex++]].image,slideShowDelay);slideshowLink.onclick=slideShowPause;return false}function slideShowReset(cancel){W.clearTimeout(slideShowQueue);slideShowQueue=null;hasSlideShow=false;slideShowIndex=0;slideshowLink.removeChild(slideshowLink.firstChild);slideshowLink.replaceChild(D.createTextNode(slideshowPlayText),slideshowLink.firstChild);slideshowLink.onclick=slideShow;!cancel&&setImage(map[map.list[0]].image);if(!hasGUI){showGUI()}return false}function slideShowSetPauseLink(){var pause=D.createElement("SPAN");pause.className="gallery-pause";slideshowLink.replaceChild(D.createTextNode(slideshowPauseText),slideshowLink.firstChild);slideshowLink.insertBefore(pause,slideshowLink.firstChild);slideshowLink.onclick=slideShowPause}function slideShow(){hasSlideShow=true;slideShowSetPauseLink();if(map[selected].index===0){slideShowIndex++;slideShowQueue=W.setTimeout(function(){setImage(map[map.list[slideShowIndex++]].image,slideShowDelay)},(SBP_GALLERY_SLIDESHOW_DELAY+SBP_GALLERY_MOUSEOUT_DELAY))}else{setImage(map[map.list[slideShowIndex++]].image,slideShowDelay)}return false}var getFlash=("number"==typeof MSIE)?function(flash){return W[flash]}:function(flash){return D[flash]};function flashIn(){if(hasSlideShow){slideShowPause()}timer&&W.clearTimeout(timer);YAHOO.util.Event.removeListener(D,"mousemove",mouseListener);YAHOO.util.Event.removeListener(D,"click",mouseListener)}function flashOut(){YAHOO.util.Event.addListener(D,"mousemove",mouseListener);YAHOO.util.Event.addListener(D,"click",mouseListener);W.focus&&W.focus()}function setSiblingLinks(){if(hasSlideShow&&!hasGUI){previousLink.style.visibility=nextLink.style.visibility="hidden";return}var id=map[selected],index=id.index;if(index>0){previousLink.style.visibility="";previousLink.href=map.list[index-1]}else{previousLink.style.visibility="hidden";previousLink.href="#"}if(index<(map.list.length-1)){nextLink.style.visibility="";nextLink.href=map.list[index+1]}else{nextLink.style.visibility="hidden";nextLink.href="#"}}function setAboutPageLink(){var a=map[selected].image.parentNode.getElementsByTagName("A");if(a[1]){aboutLink.href=a[1].href;aboutLink.style.visibility=""}else{aboutLink.href="#";aboutLink.style.visibility="hidden"}}function setImageSize(){var top,left,factor,style=img.style,imageRatio=intrinsicWidth/intrinsicHeight,screenRatio=viewportWidth/viewportHeight;if(((intrinsicWidth>intrinsicHeight)&&(imageRatio>screenRatio))||((intrinsicWidth<intrinsicHeight)&&(imageRatio>screenRatio))){factor=(viewportWidth/intrinsicWidth);img.width=viewportWidth;img.height=(intrinsicHeight*factor);top=((viewportHeight-img.height)/2);left=0}else{factor=(viewportHeight/intrinsicHeight);img.width=(intrinsicWidth*factor);img.height=viewportHeight;top=0;left=((viewportWidth-img.width)/2)}style.position="absolute";style.top=top+"px";style.left=left+"px"}function setImage(a,callBack){var style,href=a.href;if(!active){img=D.createElement("IMG");copy.parentNode.replaceChild(img,copy);YAHOO.util.Event.addListener(D,"mousemove",mouseListener);YAHOO.util.Event.addListener(D,"click",mouseListener);loading.style.display="";active=true}else{replace=img;img=D.createElement("IMG");replace.parentNode.replaceChild(img,replace)}style=img.style;style.visibility="hidden";style.zIndex="2";hasFlash&&getFlash("fullscreen-swf").fullscreenImage(href);if(selected){map[selected].image.className=""}selected=href;map[selected].image.className="selected";imgPreloader=new Image();imgPreloader.onload=function(){intrinsicWidth=this.width;intrinsicHeight=this.height;img.src=this.src;setImageSize();style.visibility=slideshowLink.style.visibility="";hasFlash&&(fullscreenLink.style.visibility="");setSiblingLinks();setAboutPageLink();callBack&&callBack()};imgPreloader.src=href}function setSiblingImage(){if(hasSlideShow){slideShowReset(true)}setImage(this);return false}function setViewportSize(){viewportWidth=H.clientWidth;viewportHeight=H.clientHeight}function resizeHandler(){if(H.clientWidth!=viewportWidth){thumbBar.style.left="0";scrollBar.parentNode.removeChild(scrollBar);setScrollBar()}setViewportSize();aboutPageHeight=(viewportHeight-130-previewContainer.offsetHeight);aboutPage.style.height=aboutPageHeight+"px";aboutPageContent.style.height=(aboutPageHeight-20)+"px";overlay&&(overlay.style.height=aboutPageHeight+"px");menuBG&&(menuBG.style.width=menu.offsetWidth+"px");previewBG&&(previewBG.style.width=previewContainer.offsetWidth+"px");if(img){setImageSize()}if(loading){loading.style.top=((viewportHeight-32)/2)+"px";loading.style.left=((viewportWidth-32)/2)+"px"}}function mouseListener(){timer&&W.clearTimeout(timer);!hasGUI&&showGUI();timer=W.setTimeout(hideGUI,SBP_GALLERY_MOUSEOUT_DELAY)}function showButtons(){var index=map[selected].index;if(index>0){previousLink.style.visibility=""}if(index<(map.list.length-1)){nextLink.style.visibility=""}slideshowLink.style.visibility="";aboutLink&&(aboutLink.style.visibility="");hasFlash&&(fullscreenLink.style.visibility="")}function hideButtons(){var index=map[selected].index;if(index>0){previousLink.style.visibility="hidden"}if(index<(map.list.length-1)){nextLink.style.visibility="hidden"}slideshowLink.style.visibility="hidden";aboutLink&&(aboutLink.style.visibility="hidden");hasFlash&&(fullscreenLink.style.visibility="hidden")}function getFrames(start,end,duration,ease){var frames=[],i,j;!duration&&(duration=100);!ease&&(ease=YAHOO.util.Easing.easeNone);for(i=0,j=0;i<=duration;i+=20,j++){frames[j]="-"+Math.round(ease(i,start,(end-start),duration))+"px"}return frames}function showGUI(){var menuStyle=menu.style,previewStyle=previewContainer.style,easing=YAHOO.util.Easing.easeOutStrong,menuFrames=getFrames(menu.offsetHeight,0,300,easing),previewFrames=getFrames(previewContainer.offsetHeight,0,300,easing),i=0,l=menuFrames.length,t;if(isFadingIn){return}isFadingIn=true;hasGUI=true;setSiblingLinks();t=W.setInterval(function(){if(i<l){menuStyle.top=menuFrames[i];previewStyle.bottom=previewFrames[i]}else{isFadingIn=false;W.clearInterval(t)}i++},20)}function hideGUI(){var menuStyle=menu.style,previewStyle=previewContainer.style,easing=YAHOO.util.Easing.easeInStrong,menuFrames=getFrames(0,menu.offsetHeight,300,easing),previewFrames=getFrames(0,previewContainer.offsetHeight,300,easing),i=0,l=menuFrames.length;if(isFadingOut){return}isFadingOut=true;previousLink.style.visibility=nextLink.style.visibility="hidden";var t=W.setInterval(function(){if(i<l){menuStyle.top=menuFrames[i];previewStyle.bottom=previewFrames[i]}else{hasGUI=false;isFadingOut=false;W.clearInterval(t)}i++},20)}function createOverlay(callbackAppend,callbackRemove,context){var anim;timer&&W.clearTimeout(timer);YAHOO.util.Event.removeListener(D,"mousemove",mouseListener);YAHOO.util.Event.removeListener(D,"click",mouseListener);if(hasSlideShow){slideShowPause();hasSlideShow=true}overlay=D.createElement("DIV");anim=new YAHOO.util.Anim(overlay,{opacity:{to:0.8}},0.5);anim.onComplete.subscribe(function(){callbackAppend&&callbackAppend(context);aboutPageClose.onclick=overlay.onclick=function(){anim=new YAHOO.util.Anim(overlay,{opacity:{to:0}},0.5);anim.onComplete.subscribe(function(){showButtons();menuBG.style.zIndex=previewBG.style.zIndex="";aboutPageClose.onclick=null;B.removeChild(overlay);overlay=null;YAHOO.util.Event.addListener(D,"mousemove",mouseListener);YAHOO.util.Event.addListener(D,"click",mouseListener)});callbackRemove&&callbackRemove();anim.animate();return false}});overlay.className="gallery-overlay";YAHOO.util.Dom.setStyle(overlay,"opacity","0");overlay.style.height=aboutPageHeight+"px";B.appendChild(overlay);menuBG.style.zIndex=previewBG.style.zIndex="100";hideButtons();anim.animate();return false}function createAboutPage(){aboutPage=D.createElement("DIV");aboutPage.className="gallery-aboutpage";aboutPage.style.display="none";aboutPage.style.height=aboutPageHeight+"px";aboutPageClose=D.createElement("A");aboutPageClose.appendChild(D.createTextNode("close"));aboutPageClose.href="#";aboutPageClose.className="overlay-close";aboutPageClose.onclick=hideAboutPage;aboutPage.appendChild(aboutPageClose);aboutPageContent=D.createElement("DIV");aboutPageContent.style.height=(aboutPageHeight-20)+"px";aboutPageContent.style.marginTop="20px";aboutPageContent.className="gallery-aboutpage-content";aboutPage.appendChild(aboutPageContent);B.appendChild(aboutPage)}function showAboutPage(context){var callback={success:function(request){if("undefined"!=typeof request.responseText){aboutPageContent.innerHTML=request.responseText;aboutPage.style.display=""}},failure:function(){}};var request=YAHOO.util.Connect.asyncRequest("GET",context.href+"?view=xhr&gallery",callback);return false}function hideAboutPage(){aboutPage.style.display="none";aboutPageContent.innerHTML="";return false}function setFullscreenButton(){var flashVersion=swfobject.getFlashPlayerVersion(),flashButton,flashID="fullscreen-swf";if(flashVersion.major>8){hasFlash=true;fullscreenLink=D.createElement("SPAN");fullscreenLink.appendChild(D.createTextNode("Fullscreen"));fullscreenLink.className="gallery-fullscreen";fullscreenLink.style.visibility="hidden";previewToolbar.appendChild(fullscreenLink);flashButton=D.createElement("SPAN");flashButton.id="fullscreen-swf";previewToolbar.appendChild(flashButton);swfobject.embedSWF("/wp-content/themes/schubergphilis/swf/fullscreen.swf",flashID,"90","25","9.0.115",false,false,{menu:"false",quality:"high",allowFullScreen:"true",allowNetworking:"all",allowScriptAccess:"always",wMode:"transparent"})}}function setScrollBar(){var scrollBarHandle,slider,thumbBarWidth=thumbBar.offsetWidth,thumbBarStyle,effectiveScrollArea,effectiveScrollWidth,scrollRatio;scrollBar=D.createElement("DIV");scrollBar.className="gallery-scrollbar";scrollBarHandle=D.createElement("DIV");scrollBar.appendChild(scrollBarHandle);preview.appendChild(scrollBar);if(thumbBarWidth<=viewportWidth){scrollBarHandle.style.display="none"}else{scrollBarHandle.style.display="";effectiveScrollWidth=(viewportWidth-scrollBarHandle.offsetWidth);slider=YAHOO.widget.Slider.getHorizSlider(scrollBar,scrollBarHandle,0,effectiveScrollWidth);thumbBarStyle=thumbBar.style;effectiveScrollArea=thumbBarWidth-viewportWidth;scrollRatio=effectiveScrollArea/effectiveScrollWidth;slider.subscribe("change",function(offset){thumbBarStyle.left=["-"+Math.round(offset*scrollRatio)+"px"].join("")})}}function init(){var l;if((menu=D.getElementById("headerContainer"))&&(copy=D.getElementById("gallery-copy"))&&(preview=D.getElementById("gallery-preview"))&&(thumbBar=preview.firstChild)&&(thumbs=preview.getElementsByTagName("LI"))){B=D.body;l=thumbs.length;previewContainer=preview.parentNode;setViewportSize();loading=D.createElement("div");loading.className="loading";loading.style.top=((viewportHeight-32)/2)+"px";loading.style.left=((viewportWidth-32)/2)+"px";loading.style.display="none";B.appendChild(loading);menuBG=D.createElement("DIV");menuBG.style.backgroundColor="#000";menuBG.style.position="absolute";menuBG.style.left="0";menuBG.style.width=menu.offsetWidth+"px";menuBG.style.height=menu.offsetHeight+"px";YAHOO.util.Dom.setStyle(menuBG,"opacity",0.8);menu.insertBefore(menuBG,menu.firstChild);nextLink=D.createElement("A");nextLink.appendChild(D.createTextNode("next"));nextLink.href="#";nextLink.className="gallery-next";nextLink.style.visibility="hidden";nextLink.onclick=setSiblingImage;B.appendChild(nextLink);previousLink=D.createElement("A");previousLink.appendChild(D.createTextNode("previous"));previousLink.href="#";previousLink.className="gallery-previous";previousLink.style.visibility="hidden";previousLink.onclick=setSiblingImage;B.appendChild(previousLink);previewToolbar=D.createElement("DIV");previewToolbar.className="gallery-toolbar";slideshowLink=D.createElement("A");slideshowLink.appendChild(D.createTextNode(slideshowPlayText));slideshowLink.href="#";slideshowLink.className="gallery-slideshow";slideshowLink.style.visibility="hidden";slideshowLink.onclick=slideShow;previewToolbar.appendChild(slideshowLink);setFullscreenButton();aboutLink=D.createElement("A");aboutLink.appendChild(D.createTextNode("About"));aboutLink.href="#";aboutLink.className="gallery-about";aboutLink.style.visibility="hidden";aboutLink.onclick=function(){!overlay&&createOverlay(showAboutPage,hideAboutPage,this);return false};previewToolbar.appendChild(aboutLink);previewContainer.insertBefore(previewToolbar,previewContainer.firstChild);previewBG=D.createElement("DIV");previewBG.style.backgroundColor="#000";previewBG.style.position="absolute";previewBG.style.top="0";previewBG.style.left="0";previewBG.style.zIndex="3";previewBG.style.width=previewContainer.offsetWidth+"px";previewBG.style.height=previewContainer.offsetHeight+"px";thumbBar.style.width=((l*(128+12))+0)+"px";YAHOO.util.Dom.setStyle(previewBG,"opacity",0.8);previewContainer.insertBefore(previewBG,previewContainer.firstChild);setScrollBar();aboutPageHeight=(viewportHeight-130-previewContainer.offsetHeight);createAboutPage();YAHOO.util.Event.addListener(W,"load",function(){YAHOO.util.Event.addListener(W,"resize",resizeHandler)});YAHOO.util.Event.addListener(preview,"click",delegate);map.list=[];for(var i=0,t,j=0,a,id,name,uri;i<l;i++){t=thumbs[i];a=t.getElementsByTagName("A");if(a.length){name=null;uri=null;id=a[0].href;a[0].firstChild.title="";map.list[map.list.length]=id;if(a[1]){if(3==a[1].previousSibling.nodeType){a[1].parentNode.removeChild(a[1].previousSibling)}a[1].style.display="none";name=a[1].firstChild.nodeValue;uri=a[1].href}map[id]={image:a[0],index:j++,photographerName:name,photographerURI:uri}}}slideShowLength=map.list.length}}return{flashIn:flashIn,flashOut:flashOut,init:init}})();
