﻿var HeaderClickUserControlsVisible=true;var PhotoOptionsPanelVisible=false;var ImageSetInterval=0;var ImageSetIntervalValue=160;var ImageObject=null;var QuicklyPauseTheSlideShow=false;var ImageNewURL=new Array(2);var ImageNewURLIndex=0;var ImageNewURLSize="XXX";var ImageDivHeight=0;var ImageDivWidth=0;var ImageDivChange=false;var BackGroundColorSetIndex=0;var BackgroundColorSet=new Array(9);BackgroundColorSet[0]="#000000";BackgroundColorSet[1]="#3D0011";BackgroundColorSet[2]="#002809";BackgroundColorSet[3]="#01172E";BackgroundColorSet[4]="#24001D";BackgroundColorSet[5]="#0A011D";BackgroundColorSet[6]="#002B40";BackgroundColorSet[7]="#002927";BackgroundColorSet[8]="#252525";var BodyMatchColorSet=new Array(9);BodyMatchColorSet[0]="#0000ff";BodyMatchColorSet[1]="#ff0000";BodyMatchColorSet[2]="#00ff00";BodyMatchColorSet[3]="#0000ff";BodyMatchColorSet[4]="#ff0000";BodyMatchColorSet[5]="#ff0000";BodyMatchColorSet[6]="#00ff00";BodyMatchColorSet[7]="#00ff00";BodyMatchColorSet[8]="#0000ff";var AlbumPhotoTitleColorSet=new Array(9);AlbumPhotoTitleColorSet[0]="#ffffff";AlbumPhotoTitleColorSet[1]="#000000";AlbumPhotoTitleColorSet[2]="#000000";AlbumPhotoTitleColorSet[3]="#ffffff";AlbumPhotoTitleColorSet[4]="#000000";AlbumPhotoTitleColorSet[5]="#000000";AlbumPhotoTitleColorSet[6]="#000000";AlbumPhotoTitleColorSet[7]="#000000";AlbumPhotoTitleColorSet[8]="#ffffff";var IrisTransition=false;var ApplyIrisOut=false;var ApplyIrisIn=false;var BlindsTransition=false;var BlindsRandom=false;var FadeTransition=false;var ImageFadeIn=false;var ImageFadeOut=false;var ImageFadeCount=0;var IrisXFormType=new Array(6);IrisXFormType[0]="circle";IrisXFormType[1]="star";IrisXFormType[2]="diamond";IrisXFormType[3]="cross";IrisXFormType[4]="plus";IrisXFormType[5]="square";var BlindsXFormType=new Array(4);BlindsXFormType[0]="left";BlindsXFormType[1]="right";BlindsXFormType[2]="up";BlindsXFormType[3]="down";var AlbumDetailSet=null;var AlbumCount=0;var AlbumIndex= -1;var AlbumShuffleArray=null;var GoToNextAlbum=false;var AlbumMasterButton;var AlbumButtonSet=new Array(25);var CurrentAlbumTitle=null;var AlbumPhotoDetailSet;var AlbumPhotoCount=0;var AlbumPhotoIndex= -1;var AlbumPhotoShuffleArraynull;var BusyGettingAlbumPhotosFromTheServer=false;var AlbumRandomPlaybackMode=true;var currentServerURI=null;var currentServerIndex= -1;var currentServerCount= -1;var photoDatabaseServers=null;var GetPhotoDBaseServerListXHR=CreateXmlHttpRequestObject();var AlbumDetailsXHR=CreateXmlHttpRequestObject();var AlbumPhotoDetailsXHR=CreateXmlHttpRequestObject();function GetPhotoDBaseServerURIList(){if(GetPhotoDBaseServerListXHR){currentServerCount= -1;var WebSite=location.pathname;var endChar=WebSite.lastIndexOf("/");WebSite=WebSite.substring(0,endChar+1);var currentHostURL="http://"+location.host+WebSite+"wsLinqAlbumPhotoDetailsService.asmx/GetPhotoDBaseServerURIListProxy";try{GetPhotoDBaseServerListXHR.open("POST",currentHostURL,true);}catch(e){writeDebug("Error in GetPhotoDBaseServerURIList ["+e.name+"]: "+e.message,true);return;}try{GetPhotoDBaseServerListXHR.onreadystatechange=onGetPhotoDBaseServerURIListComplete;GetPhotoDBaseServerListXHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");GetPhotoDBaseServerListXHR.send();}catch(e){writeDebug("Error in GetPhotoDBaseServerURIList ["+e.name+"]: "+e.message,true);}}};function onGetPhotoDBaseServerURIListComplete(){try{if(GetPhotoDBaseServerListXHR.readyState==READYSTATE_COMPLETE){if(GetPhotoDBaseServerListXHR.status==HTTPSTATUS_OK){var JSONResponse=GetPhotoDBaseServerListXHR.responseText;photoDatabaseServers=Sys.Serialization.JavaScriptSerializer.deserialize(JSONResponse);if(photoDatabaseServers!=null){currentServerCount=photoDatabaseServers.length;$get("PhotoServerURIList").options.length=0;for(var i=0;i<currentServerCount;i++){$get("PhotoServerURIList").options[i]=new Option(photoDatabaseServers[i],i);}currentServerIndex=0;GetFullDatabaseAlbumList();GoToNextAlbum=true;}}else{var Bugs=GetPhotoDBaseServerListXHR.responseText;writeDebug("Error in onGetPhotoDBaseServerURIListComplete! "+Bugs,true);}}}catch(e){writeDebug("Error in onGetPhotoDBaseServerURIListComplete ["+e.name+"]: "+e.message,true);}};function GetFullDatabaseAlbumList(){if(AlbumDetailsXHR){AlbumCount=0;disableAllPhotoAlbumButtons();var WebSite=location.pathname;var endChar=WebSite.lastIndexOf("/");WebSite=WebSite.substring(0,endChar+1);var currentHostURL="http://"+location.host+WebSite+"wsLinqAlbumPhotoDetailsService.asmx/GetAlbumDetailsFilteredXD";try{AlbumDetailsXHR.open("POST",currentHostURL,true);}catch(e){enableAllPhotoAlbumButtons();writeDebug("Error in GetFullDatabaseAlbumList ["+e.name+"]: "+e.message,true);return;}try{AlbumDetailsXHR.onreadystatechange=onFullDatabaseAlbumListComplete;AlbumDetailsXHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(currentServerIndex== -1){var xhrRequestData="IsPublic="+true;xhrRequestData+="&targetServer=local";AlbumDetailsXHR.send(xhrRequestData);}else{var xhrRequestData="IsPublic="+true;xhrRequestData+="&targetServer="+photoDatabaseServers[currentServerIndex];AlbumDetailsXHR.send(xhrRequestData);}}catch(e){enableAllPhotoAlbumButtons();writeDebug("Error in GetFullDatabaseAlbumList ["+e.name+"]: "+e.message,true);}}};function onFullDatabaseAlbumListComplete(){try{if(AlbumDetailsXHR.readyState==READYSTATE_COMPLETE){if(AlbumDetailsXHR.status==HTTPSTATUS_OK){var JSONResponse=AlbumDetailsXHR.responseText;AlbumDetailSet=Sys.Serialization.JavaScriptSerializer.deserialize(JSONResponse);if(AlbumDetailSet!=null){AlbumCount=AlbumDetailSet.length;AlbumIndex= -1;AlbumShuffleArray=new Array(AlbumCount);for(var i=0;i<AlbumCount;i++){AlbumShuffleArray[i]=i;}AlbumShuffleArray.shuffle();DropDownChildSetButtonSetup();enableAllPhotoAlbumButtons();}}else{enableAllPhotoAlbumButtons();var Bugs=AlbumDetailsXHR.responseText;writeDebug("Error in onFullDatabaseAlbumListComplete! "+Bugs,true);}}}catch(e){enableAllPhotoAlbumButtons();writeDebug("Error in onFullDatabaseAlbumListComplete ["+e.name+"]: "+e.message,true);}};function GetAlbumPhotoDetails(albumTitle){CurrentAlbumTitle=albumTitle;$get("albumphotoTitleID").innerHTML="Please wait...";$get("albumphotoStoryID").innerHTML="Please wait...";if(AlbumPhotoDetailsXHR){AlbumPhotoCount=0;disableAllPhotoAlbumButtons();BusyGettingAlbumPhotosFromTheServer=true;var WebSite=location.pathname;var endChar=WebSite.lastIndexOf("/");WebSite=WebSite.substring(0,endChar+1);var currentHostURL="http://"+location.host+WebSite+"wsLinqAlbumPhotoDetailsService.asmx/GetAlbumPhotoDetailsXD";try{AlbumPhotoDetailsXHR.open("POST",currentHostURL,true);}catch(e){enableAllPhotoAlbumButtons();BusyGettingAlbumPhotosFromTheServer=false;writeDebug("Error in GetAlbumPhotoDetails ["+e.name+"]: "+e.message,true);return;}try{AlbumPhotoDetailsXHR.onreadystatechange=onAlbumPhotoDetailsComplete;AlbumPhotoDetailsXHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(currentServerIndex== -1){var xhrRequestData="AlbumTitle="+albumTitle;xhrRequestData+="&targetServer=local";AlbumPhotoDetailsXHR.send(xhrRequestData);}else{var xhrRequestData="AlbumTitle="+albumTitle;xhrRequestData+="&targetServer="+photoDatabaseServers[currentServerIndex];AlbumPhotoDetailsXHR.send(xhrRequestData);}}catch(e){enableAllPhotoAlbumButtons();BusyGettingAlbumPhotosFromTheServer=false;writeDebug("Error in GetAlbumPhotoDetails ["+e.name+"]: "+e.message,true);}}};function onAlbumPhotoDetailsComplete(){try{if(AlbumPhotoDetailsXHR.readyState==READYSTATE_COMPLETE){if(AlbumPhotoDetailsXHR.status==HTTPSTATUS_OK){var JSONResponse=AlbumPhotoDetailsXHR.responseText;AlbumPhotoDetailSet=Sys.Serialization.JavaScriptSerializer.deserialize(JSONResponse);if(AlbumPhotoDetailSet!=null){AlbumPhotoCount=AlbumPhotoDetailSet.length;AlbumPhotoIndex= -1;ImageSetInterval=500;AlbumMasterButton.innerHTML=CurrentAlbumTitle;AlbumMasterButton.style.color="880000";AlbumMasterButton.style.textAlign="center";AlbumPhotoShuffleArray=new Array(AlbumPhotoCount);for(var i=0;i<AlbumPhotoCount;i++){AlbumPhotoShuffleArray[i]=i;}AlbumPhotoShuffleArray.shuffle();BusyGettingAlbumPhotosFromTheServer=false;enableAllPhotoAlbumButtons();}}else{enableAllPhotoAlbumButtons();BusyGettingAlbumPhotosFromTheServer=false;var Bugs=AlbumPhotoDetailsXHR.responseText;writeDebug("Error in onAlbumPhotoDetailsComplete! "+Bugs,true);}}}catch(e){enableAllPhotoAlbumButtons();BusyGettingAlbumPhotosFromTheServer=false;writeDebug("Error in onAlbumPhotoDetailsComplete ["+e.name+"]: "+e.message,true);}};function DropDownSetUpLinkage(ParentID,ChildContainerID,dropPosition){var objControl=$get(ParentID);var objChildSet=$get(ChildContainerID);objControl["parentIndex"]=objControl.id;objControl["childIndex"]=objChildSet.id;objChildSet["parentIndex"]=objControl.id;objChildSet["childIndex"]=objChildSet.id;objChildSet["positionIndex"]=dropPosition;objChildSet.style.position="absolute";objChildSet.style.visibility="hidden";objControl.onclick=DropDownTopClick;objChildSet.onmouseover=DropDownSetShow;objChildSet.onmouseout=DropDownSetHide;};function DropDownShowChildContainer(ParentID,ChildContainerID){var objControl=$get(ParentID);var objChildSet=$get(ChildContainerID);var top=(objChildSet["positionIndex"]=="y")?objControl.offsetHeight-2:0;var left=(objChildSet["positionIndex"]=="x")?objControl.offsetWidth-2:0;for(;objControl;objControl=objControl.offsetParent){top+=objControl.offsetTop;left+=objControl.offsetLeft;}objChildSet.style.position="absolute";objChildSet.style.top=top+'px';objChildSet.style.left=left+'px';objChildSet.style.visibility="visible";};function DropDownSetShow(){var objControl=$get(this["parentIndex"]);var objChildSet=$get(this["childIndex"]);DropDownShowChildContainer(objControl.id,objChildSet.id);if(objChildSet["timeoutIndex"]!=null){clearTimeout(objChildSet["timeoutIndex"]);}};function DropDownSetHide(){var objChildSet=$get(this["childIndex"]);objChildSet["timeoutIndex"]=setTimeout("$get('"+objChildSet.id+"').style.visibility='hidden';",333);};function DropDownSetHideFromButton(objButton){var objChildSet=$get(objButton.parentNode["childIndex"]);objChildSet["timeoutIndex"]=setTimeout("$get('"+objChildSet.id+"').style.visibility='hidden';",222);if(!BusyGettingAlbumPhotosFromTheServer){if(AlbumMasterButton.innerHTML!=objButton.albumCaption){AlbumPhotoCount=0;GetAlbumPhotoDetails(objButton.albumCaption);AlbumMasterButton.innerHTML="Loading a new Photo Album Set...";AlbumMasterButton.style.color="#000000";AlbumMasterButton.style.textAlign="left";}}};function DropDownTopClick(){var objControl=$get(this["parentIndex"]);var objChildSet=$get(this["childIndex"]);if(objChildSet.style.visibility!="visible"){DropDownShowChildContainer(objControl.id,objChildSet.id);}else{objChildSet.style.visibility="hidden";}return false;};function DropDownChildSetButtonSetup(){for(var i=0;i<AlbumButtonSet.length;i++){AlbumButtonSet[i].style.display="none";AlbumButtonSet[i].albumID=0;AlbumButtonSet[i].albumCaption="";}for(i=0;i<AlbumCount;i++){AlbumButtonSet[i].style.display="inline";AlbumButtonSet[i].albumID=AlbumDetailSet[i].AlbumID;AlbumButtonSet[i].albumCaption=AlbumDetailSet[i].Caption;AlbumButtonSet[i].innerHTML="&nbsp&nbsp"+AlbumDetailSet[i].Caption;}};function RefreshTheAlbumSetButton(){GetFullDatabaseAlbumList();GoToNextAlbum=true;};function disableAllPhotoAlbumButtons(){if($get("PhotoControlButton1")!=null){$get("PhotoControlButton1").disabled=true;}if($get("PhotoControlButton2")!=null){$get("PhotoControlButton2").disabled=true;}if($get("PhotoControlButton3")!=null){$get("PhotoControlButton3").disabled=true;}if($get("PhotoControlButton4")!=null){$get("PhotoControlButton4").disabled=true;}if($get("PhotoControlButton5")!=null){$get("PhotoControlButton5").disabled=true;}if($get("PhotoControlButton6")!=null){$get("PhotoControlButton6").disabled=true;}if($get("PhotoControlButton7")!=null){$get("PhotoControlButton7").disabled=true;}if($get("PhotoControlButton8")!=null){$get("PhotoControlButton8").disabled=true;}if($get("PhotoControlButton9")!=null){$get("PhotoControlButton9").disabled=true;}if($get("PhotoControlButton10")!=null){$get("PhotoControlButton10").disabled=true;}};function enableAllPhotoAlbumButtons(){if($get("PhotoControlButton1")!=null){$get("PhotoControlButton1").disabled=false;}if($get("PhotoControlButton2")!=null){$get("PhotoControlButton2").disabled=false;}if($get("PhotoControlButton3")!=null){$get("PhotoControlButton3").disabled=false;}if($get("PhotoControlButton4")!=null){$get("PhotoControlButton4").disabled=false;}if($get("PhotoControlButton5")!=null){$get("PhotoControlButton5").disabled=false;QuicklyPauseTheSlideShow=false;$get("PhotoControlButton5").innerHTML="Pause";$get("PhotoControlButton5").style.color="#000000";}if($get("PhotoControlButton6")!=null){$get("PhotoControlButton6").disabled=false;}if($get("PhotoControlButton7")!=null){$get("PhotoControlButton7").disabled=false;}if($get("PhotoControlButton8")!=null){$get("PhotoControlButton8").disabled=false;}if($get("PhotoControlButton9")!=null){$get("PhotoControlButton9").disabled=false;}if($get("PhotoControlButton10")!=null){$get("PhotoControlButton10").disabled=false;}};function FastModePhotoAlbumButton(){ImageSetIntervalValue=60;if($get("PhotoControlButton2")!=null){$get("PhotoControlButton2").style.color="#00ff00";}if($get("PhotoControlButton3")!=null){$get("PhotoControlButton3").style.color="#000000";}if($get("PhotoControlButton4")!=null){$get("PhotoControlButton4").style.color="#000000";}};function NormalModePhotoAlbumButton(){ImageSetIntervalValue=150;if($get("PhotoControlButton2")!=null){$get("PhotoControlButton2").style.color="#000000";}if($get("PhotoControlButton3")!=null){$get("PhotoControlButton3").style.color="#00ff00";}if($get("PhotoControlButton4")!=null){$get("PhotoControlButton4").style.color="#000000";}};function SlowModePhotoAlbumButton(){ImageSetIntervalValue=250;if($get("PhotoControlButton2")!=null){$get("PhotoControlButton2").style.color="#000000";}if($get("PhotoControlButton3")!=null){$get("PhotoControlButton3").style.color="#000000";}if($get("PhotoControlButton4")!=null){$get("PhotoControlButton4").style.color="#00ff00";}};function TogglePauseModePhotoAlbumButton(){if(QuicklyPauseTheSlideShow){QuicklyPauseTheSlideShow=false;if($get("PhotoControlButton5")!=null){$get("PhotoControlButton5").innerHTML="Pause";$get("PhotoControlButton5").style.color="#000000";}}else{QuicklyPauseTheSlideShow=true;if($get("PhotoControlButton5")!=null){$get("PhotoControlButton5").innerHTML="Start";$get("PhotoControlButton5").style.color="#0000ff";}}};function HugeSizePhotoImagePlease(){try{if(ImageNewURLSize!="XL"){ImageNewURLSize="XL";setCookie("ImageNewURLSize","XL",100);ImageNewURL[0]=null;ImageNewURL[1]=null;ImageNewURLIndex=0;ImageDivChange=true;ImageDivHeight="900px";ImageDivWidth="900px";ImageSetInterval=500;if($get("PhotoControlButton7")!=null){$get("PhotoControlButton7").style.color="#0000ff";}if($get("PhotoControlButton8")!=null){$get("PhotoControlButton8").style.color="#000000";}if($get("PhotoControlButton9")!=null){$get("PhotoControlButton9").style.color="#000000";}if($get("PhotoControlButton10")!=null){$get("PhotoControlButton10").style.color="#000000";}}}catch(e){writeDebug("Error in HugeSizePhotoImagePlease()",true);}};function LargeSizePhotoImagePlease(){try{if(ImageNewURLSize!="L"){ImageNewURLSize="L";setCookie("ImageNewURLSize","L",100);ImageNewURL[0]=null;ImageNewURL[1]=null;ImageNewURLIndex=0;ImageDivChange=true;ImageDivHeight="700px";ImageDivWidth="700px";ImageSetInterval=500;if($get("PhotoControlButton7")!=null){$get("PhotoControlButton7").style.color="#000000";}if($get("PhotoControlButton8")!=null){$get("PhotoControlButton8").style.color="#0000ff";}if($get("PhotoControlButton9")!=null){$get("PhotoControlButton9").style.color="#000000";}if($get("PhotoControlButton10")!=null){$get("PhotoControlButton10").style.color="#000000";}}}catch(e){writeDebug("Error in LargeSizePhotoImagePlease()",true);}};function MediumSizePhotoImagePlease(){try{if(ImageNewURLSize!="ML"){ImageNewURLSize="ML";setCookie("ImageNewURLSize","ML",100);ImageNewURL[0]=null;ImageNewURL[1]=null;ImageNewURLIndex=0;ImageDivChange=true;ImageDivHeight="550px";ImageDivWidth="550px";ImageSetInterval=500;if($get("PhotoControlButton7")!=null){$get("PhotoControlButton7").style.color="#000000";}if($get("PhotoControlButton8")!=null){$get("PhotoControlButton8").style.color="#000000";}if($get("PhotoControlButton9")!=null){$get("PhotoControlButton9").style.color="#0000ff";}if($get("PhotoControlButton10")!=null){$get("PhotoControlButton10").style.color="#000000";}}}catch(e){writeDebug("Error in MediumSizePhotoImagePlease()",true);}};function NormalSizePhotoImagePlease(){try{if(ImageNewURLSize!="M"){ImageNewURLSize="M";setCookie("ImageNewURLSize","M",100);ImageNewURL[0]=null;ImageNewURL[1]=null;ImageNewURLIndex=0;ImageDivChange=true;ImageDivHeight="400px";ImageDivWidth="400px";ImageSetInterval=500;if($get("PhotoControlButton7")!=null){$get("PhotoControlButton7").style.color="#000000";}if($get("PhotoControlButton8")!=null){$get("PhotoControlButton8").style.color="#000000";}if($get("PhotoControlButton9")!=null){$get("PhotoControlButton9").style.color="#000000";}if($get("PhotoControlButton10")!=null){$get("PhotoControlButton10").style.color="#0000ff";}}}catch(e){writeDebug("Error in NormalSizePhotoImagePlease()",true);}};function gotoNextRandomAlbum(){GoToNextAlbum=true;};function gotoNextRandomPhoto(){ImageSetInterval=500;};function ActivateSelectedPhotoDataBaseServer(){var iServerIndex=$get("PhotoServerURIList").selectedIndex;if(iServerIndex!= -1){currentServerURI=$get("PhotoServerURIList").options[iServerIndex].text;currentServerIndex=$get("PhotoServerURIList").options[iServerIndex].value;GetFullDatabaseAlbumList();GoToNextAlbum=true;}return false;}(function(){var swapper=function(suffleMe,el,all){var ran=Math.floor(Math.random()*all);var saver=suffleMe[el];suffleMe[el]=suffleMe[ran];suffleMe[ran]=saver;};Array.prototype.shuffle=function(){var i=this.length;var Total=i;while(i--){swapper(this,i,Total);}};})();function ShowHideAllUserControls(){if(HeaderClickUserControlsVisible){HeaderClickUserControlsVisible=false;$get("photoalbumButtBarOne").style.visibility="hidden";$get("photoalbumButtBarOne").style.display="none";$get("photoalbumButtBarTwo").style.visibility="hidden";$get("photoalbumButtBarTwo").style.display="none";$get("photoalbumButtBarThree").style.visibility="hidden";$get("photoalbumButtBarThree").style.display="none";$get("ImageShowOptionPanelAccordion").style.visibility="hidden";$get("ImageShowOptionPanelAccordion").style.display="none";}else{HeaderClickUserControlsVisible=true;$get("photoalbumButtBarOne").style.visibility="visible";$get("photoalbumButtBarOne").style.display="block";$get("photoalbumButtBarTwo").style.visibility="visible";$get("photoalbumButtBarTwo").style.display="block";$get("photoalbumButtBarThree").style.visibility="visible";$get("photoalbumButtBarThree").style.display="block";$get("ImageShowOptionPanelAccordion").style.visibility="visible";$get("ImageShowOptionPanelAccordion").style.display="block";}};function ShowHideAlbumPhotoTitle(){if(formPhoto.ShowTitleCheck.checked){$get("albumphotoTitleID").style.visibility="visible";$get("albumphotoTitleID").style.display="block";}else{$get("albumphotoTitleID").style.visibility="hidden";$get("albumphotoTitleID").style.display="none";}};function ShowHideAlbumPhotoStory(){if(formPhoto.ShowStoryCheck.checked){$get("albumphotoStoryID").style.visibility="visible";$get("albumphotoStoryID").style.display="block";}else{$get("albumphotoStoryID").style.visibility="hidden";$get("albumphotoStoryID").style.display="none";}};function DoTimerPOP(){if(GoToNextAlbum&& !BusyGettingAlbumPhotosFromTheServer){if(AlbumCount>0){try{GoToNextAlbum=false;AlbumIndex++;if(AlbumIndex>=AlbumCount){AlbumIndex=0;}AlbumPhotoCount=0;GetAlbumPhotoDetails(AlbumDetailSet[AlbumShuffleArray[AlbumIndex]].Caption);AlbumMasterButton.innerHTML="Loading a new Photo Album Set...";AlbumMasterButton.style.color="#000000";AlbumMasterButton.style.textAlign="left";}catch(e){writeDebug("Error in DoTimerPOP(Random photo Album pick)",true);}}}if(!QuicklyPauseTheSlideShow){ImageSetInterval++;if(ImageSetInterval>=ImageSetIntervalValue){ImageSetInterval=0;if(AlbumPhotoCount>0){RefreshImageCache();}}else if(FadeTransition&&ImageFadeIn){JustFadeIn();}else if(IrisTransition&&ApplyIrisOut){DoTheIrisOut();}else if(IrisTransition&&ApplyIrisIn){DoTheIrisIn();}else if(BlindsTransition&&BlindsRandom){DoTheBlindsThing();}if(FadeTransition&&ImageSetInterval==ImageSetIntervalValue-20){if(broswerId=="msie"){ImageObject.opacity=100;ImageFadeIn=false;ImageFadeOut=true;ImageFadeCount=0;}}if(FadeTransition&&ImageFadeOut){JustFadeOut();}}window.setTimeout('DoTimerPOP()',100);};function RefreshImageCache(){if(AlbumPhotoCount>0){if(AlbumPhotoIndex== -1){try{if($get("picholder")!=null){var newColor=BackgroundColorSet[BackGroundColorSetIndex];var newColorBody=BodyMatchColorSet[BackGroundColorSetIndex];var newColorTitle=AlbumPhotoTitleColorSet[BackGroundColorSetIndex];$get("picholder").style.backgroundColor=newColor;with(document.body.style){backgroundColor=newColorBody;}$get("albumphotoTitleID").style.color=newColorTitle;BackGroundColorSetIndex++;if(BackGroundColorSetIndex>BackgroundColorSet.length-1){BackGroundColorSetIndex=0;}}}catch(e){writeDebug("Error in RefreshImageCache(Change the IMAGE Background color)",true);}ImageNewURL[0]=null;ImageNewURL[1]=null;}if(ImageNewURL[0]==null){try{ImageNewURL[0]=new Image();var TimeStampOne=new Date();var SecondsOne=TimeStampOne.getTime();AlbumPhotoIndex++;if(AlbumPhotoIndex>=AlbumPhotoCount){AlbumPhotoIndex=0;}var srcTargetOne=null;if(currentServerIndex== -1){srcTargetOne="whdBaseLinqImgHandler.ashx?PhotoID=";}else{srcTargetOne=photoDatabaseServers[currentServerIndex]+"whdBaseLinqImgHandler.ashx?PhotoID=";}if(AlbumRandomPlaybackMode==true){srcTargetOne+=AlbumPhotoDetailSet[AlbumPhotoShuffleArray[AlbumPhotoIndex]].PhotoID;}else{srcTargetOne+=AlbumPhotoDetailSet[AlbumPhotoIndex].PhotoID;}srcTargetOne+="&Size="+ImageNewURLSize;srcTargetOne+="&isPublic=true";srcTargetOne+="&time=";srcTargetOne+=SecondsOne;ImageNewURL[0].src=srcTargetOne;ImageNewURL[0].title=AlbumPhotoDetailSet[AlbumPhotoShuffleArray[AlbumPhotoIndex]].Caption;ImageNewURL[0].story=AlbumPhotoDetailSet[AlbumPhotoShuffleArray[AlbumPhotoIndex]].PhotoStory;}catch(e){writeDebug("Error in RefreshImageCache(IMAGE Cache ENTRY 0 Management)",true);}}if(ImageNewURL[1]==null){try{ImageNewURL[1]=new Image();var TimeStampTwo=new Date();var SecondsTwo=TimeStampTwo.getTime();AlbumPhotoIndex++;if(AlbumPhotoIndex>=AlbumPhotoCount){AlbumPhotoIndex=0;}var srcTargetTwo=null;if(currentServerIndex== -1){srcTargetTwo="whdBaseLinqImgHandler.ashx?PhotoID=";}else{srcTargetTwo=photoDatabaseServers[currentServerIndex]+"whdBaseLinqImgHandler.ashx?PhotoID=";}if(AlbumRandomPlaybackMode==true){srcTargetTwo+=AlbumPhotoDetailSet[AlbumPhotoShuffleArray[AlbumPhotoIndex]].PhotoID;}else{srcTargetTwo+=AlbumPhotoDetailSet[AlbumPhotoIndex].PhotoID;}srcTargetTwo+="&Size="+ImageNewURLSize;srcTargetTwo+="&isPublic=true";srcTargetTwo+="&time=";srcTargetTwo+=SecondsTwo;ImageNewURL[1].src=srcTargetTwo;ImageNewURL[1].title=AlbumPhotoDetailSet[AlbumPhotoShuffleArray[AlbumPhotoIndex]].Caption;ImageNewURL[1].story=AlbumPhotoDetailSet[AlbumPhotoShuffleArray[AlbumPhotoIndex]].PhotoStory;}catch(e){writeDebug("Error in RefreshImageCache(IMAGE Cache ENTRY 1 Management)",true);}}if(broswerId=="msie"){if(FadeTransition){ImageObject.opacity=0;ImageFadeIn=true;ImageFadeOut=false;ImageFadeCount=0;}else if(IrisTransition){ApplyIrisOut=true}else if(BlindsTransition){BlindsRandom=true;}}else{ImageObject.src=ImageNewURL[ImageNewURLIndex].src;ImageNewURL[ImageNewURLIndex]=null;ImageNewURLIndex++;if(ImageNewURLIndex>=ImageNewURL.length){ImageNewURLIndex=0;}FadeTransition=false;ImageFadeIn=false;ImageFadeOut=false;ImageFadeCount=0;}}};function SetImageOpacity(imgName,step){try{if(broswerId=="msie"){var img=document.images[imgName];img.opacity+=step;img.style.filter='alpha(opacity = '+img.opacity+')';}}catch(e){writeDebug("Error in SetImageOpacity()",true);}};function JustFadeIn(){try{if(ImageNewURL[ImageNewURLIndex]!=null){if(ImageNewURL[ImageNewURLIndex].readyState=='complete'){if(ImageDivChange){ImageDivChange=false;if($get("picholder")!=null){$get("picholder").style.height=ImageDivHeight;$get("picholder").style.width=ImageDivWidth;$get("fullcontainer").style.width=ImageDivWidth;}}if(ImageNewURL[ImageNewURLIndex].title!=null){$get("albumphotoTitleID").innerHTML=ImageNewURL[ImageNewURLIndex].title;}else{$get("albumphotoTitleID").innerHTML="No title information available";}if(ImageNewURL[ImageNewURLIndex].story!=null){$get("albumphotoStoryID").innerHTML=ImageNewURL[ImageNewURLIndex].story;}else{$get("albumphotoStoryID").innerHTML="No story information available";}ImageObject.src=ImageNewURL[ImageNewURLIndex].src;ImageObject.title="Click to see the next Photo!";ImageObject.style.visibility="visible";ImageObject.width=ImageNewURL[ImageNewURLIndex].width;ImageObject.height=ImageNewURL[ImageNewURLIndex].height;ImageObject.alt=ImageObject.src;if(ImageObject.width>ImageObject.parentElement.clientWidth)ImageObject.width=(ImageObject.parentElement.clientWidth-20);if(ImageObject.height>ImageObject.parentElement.clientHeight)ImageObject.height=(ImageObject.parentElement.clientHeight-20);var vert=(ImageObject.parentElement.clientHeight-ImageObject.height)/2;if(vert>0)ImageObject.style.marginTop=vert-(vert/10);ImageNewURL[ImageNewURLIndex]=null;ImageNewURLIndex++;if(ImageNewURLIndex>=ImageNewURL.length){ImageNewURLIndex=0;}}}else{SetImageOpacity('imgview',10);ImageFadeCount++;if(ImageFadeCount>=10){ImageFadeIn=false;ImageFadeOut=false;ImageFadeCount=0;}}}catch(e){writeDebug("Error in JustFadeIn()",true);}};function JustFadeOut(){SetImageOpacity('imgview',-10);ImageFadeCount++;if(ImageFadeCount>=10){ImageFadeIn=false;ImageFadeOut=false;ImageFadeCount=0;}};function DoTheIrisOut(){try{if(ImageNewURL[ImageNewURLIndex]!=null){if(ImageNewURL[ImageNewURLIndex].readyState=='complete'){if(ImageDivChange){ImageDivChange=false;if($get("picholder")!=null){$get("picholder").style.height=ImageDivHeight;$get("picholder").style.width=ImageDivWidth;$get("fullcontainer").style.width=ImageDivWidth;}}if(ImageNewURL[ImageNewURLIndex].title!=null){$get("albumphotoTitleID").innerHTML=ImageNewURL[ImageNewURLIndex].title;}else{$get("albumphotoTitleID").innerHTML="No title information available";}if(ImageNewURL[ImageNewURLIndex].story!=null){$get("albumphotoStoryID").innerHTML=ImageNewURL[ImageNewURLIndex].story;}else{$get("albumphotoStoryID").innerHTML="No story information available";}var IrisStyleIndex=Math.floor(Math.random()*6);var IrisDuration=1;if(IrisXFormType[IrisStyleIndex]=="plus"||IrisXFormType[IrisStyleIndex]=="cross")IrisDuration=1;ImageObject.style.filter="progid:DXImageTransform.Microsoft.Iris(irisstyle="+IrisXFormType[IrisStyleIndex]+",motion=out,duration="+IrisDuration+")";ImageObject.filters(0).Apply();ImageObject.src=ImageNewURL[ImageNewURLIndex].src;ImageObject.title="Click to see the next Photo!";ImageObject.style.visibility="visible";ImageObject.filters(0).Play();ApplyIrisOut=false;ImageObject.width=ImageNewURL[ImageNewURLIndex].width;ImageObject.height=ImageNewURL[ImageNewURLIndex].height;ImageObject.alt=ImageObject.src;ImageNewURL[ImageNewURLIndex]=null;ImageNewURLIndex++;if(ImageNewURLIndex>=ImageNewURL.length){ImageNewURLIndex=0;}if(ImageObject.width>ImageObject.parentElement.clientWidth)ImageObject.width=(ImageObject.parentElement.clientWidth-20);if(ImageObject.height>ImageObject.parentElement.clientHeight)ImageObject.height=(ImageObject.parentElement.clientHeight-20);var vert=(ImageObject.parentElement.clientHeight-ImageObject.height)/2;if(vert>0)ImageObject.style.marginTop=vert-(vert/10);IrisTransition=false;BlindsTransition=true;}}}catch(e){writeDebug("Error in DoTheIrisOut()",true);}};function DoTheIrisIn(){try{if(ImageNewURL[ImageNewURLIndex]!=null){if(ImageNewURL[ImageNewURLIndex].readyState=='complete'){if(ImageDivChange){ImageDivChange=false;if($get("picholder")!=null){$get("picholder").style.height=ImageDivHeight;$get("picholder").style.width=ImageDivWidth;$get("fullcontainer").style.width=ImageDivWidth;}}if(ImageNewURL[ImageNewURLIndex].title!=null){$get("albumphotoTitleID").innerHTML=ImageNewURL[ImageNewURLIndex].title;}else{$get("albumphotoTitleID").innerHTML="No title information available";}if(ImageNewURL[ImageNewURLIndex].story!=null){$get("albumphotoStoryID").innerHTML=ImageNewURL[ImageNewURLIndex].story;}else{$get("albumphotoStoryID").innerHTML="No story information available";}var IrisStyleIndex=Math.floor(Math.random()*6);var IrisDuration=1;if(IrisXFormType[IrisStyleIndex]=="plus"||IrisXFormType[IrisStyleIndex]=="cross")IrisDuration=1;ImageObject.style.filter="progid:DXImageTransform.Microsoft.Iris(irisstyle="+IrisXFormType[IrisStyleIndex]+",motion=in,duration="+IrisDuration+")";ImageObject.filters(0).Apply();ImageObject.src=ImageNewURL[ImageNewURLIndex].src;ImageObject.title="Click to see the next Photo!";ImageObject.style.visibility="visible";ImageObject.filters(0).Play();ApplyIrisIn=false;ImageObject.width=ImageNewURL[ImageNewURLIndex].width;ImageObject.height=ImageNewURL[ImageNewURLIndex].height;ImageObject.alt=ImageObject.src;ImageNewURL[ImageNewURLIndex]=null;ImageNewURLIndex++;if(ImageNewURLIndex>=ImageNewURL.length){ImageNewURLIndex=0;}if(ImageObject.width>ImageObject.parentElement.clientWidth)ImageObject.width=(ImageObject.parentElement.clientWidth-20);if(ImageObject.height>ImageObject.parentElement.clientHeight)ImageObject.height=(ImageObject.parentElement.clientHeight-20);var vert=(ImageObject.parentElement.clientHeight-ImageObject.height)/2;if(vert>0)ImageObject.style.marginTop=vert-(vert/10);IrisTransition=false;BlindsTransition=true;}}}catch(e){writeDebug("Error in DoTheIrisIn()",true);}};function DoTheBlindsThing(){try{if(ImageNewURL[ImageNewURLIndex]!=null){if(ImageNewURL[ImageNewURLIndex].readyState=='complete'){if(ImageDivChange){ImageDivChange=false;if($get("picholder")!=null){$get("picholder").style.height=ImageDivHeight;$get("picholder").style.width=ImageDivWidth;$get("fullcontainer").style.width=ImageDivWidth;}}if(ImageNewURL[ImageNewURLIndex].title!=null){$get("albumphotoTitleID").innerHTML=ImageNewURL[ImageNewURLIndex].title;}else{$get("albumphotoTitleID").innerHTML="No title information available";}if(ImageNewURL[ImageNewURLIndex].story!=null){$get("albumphotoStoryID").innerHTML=ImageNewURL[ImageNewURLIndex].story;}else{$get("albumphotoStoryID").innerHTML="No story information available";}var BlindsTypeIndex=Math.floor(Math.random()*4);var BlindsBands=Math.floor(Math.random()*10);if(BlindsBands<=0)BlindsBands=1;else if(BlindsBands>10)BlindsBands=10;ImageObject.style.filter="progid:DXImageTransform.Microsoft.Blinds(direction="+BlindsXFormType[BlindsTypeIndex]+",bands="+BlindsBands+",duration=1)";ImageObject.filters(0).Apply();ImageObject.src=ImageNewURL[ImageNewURLIndex].src;ImageObject.title="Click to see the next Photo!";ImageObject.style.visibility="visible";ImageObject.filters(0).Play();BlindsRandom=false;ImageObject.width=ImageNewURL[ImageNewURLIndex].width;ImageObject.height=ImageNewURL[ImageNewURLIndex].height;ImageObject.alt=ImageObject.src;ImageNewURL[ImageNewURLIndex]=null;ImageNewURLIndex++;if(ImageNewURLIndex>=ImageNewURL.length){ImageNewURLIndex=0;}if(ImageObject.width>ImageObject.parentElement.clientWidth)ImageObject.width=(ImageObject.parentElement.clientWidth-20);if(ImageObject.height>ImageObject.parentElement.clientHeight)ImageObject.height=(ImageObject.parentElement.clientHeight-20);var vert=(ImageObject.parentElement.clientHeight-ImageObject.height)/2;if(vert>0)ImageObject.style.marginTop=vert-(vert/10);IrisTransition=true;BlindsTransition=false;}}}catch(e){writeDebug("Error in DoTheBlindsThing()",true);}};function TogglePhotoOptionsPanelAccordionTitle(target,event){try{if(PhotoOptionsPanelVisible){var PhotoOptionsPanelAccordionTitle=$get("PhotoOptionsPanelButtonID");if(PhotoOptionsPanelAccordionTitle!=null){PhotoOptionsPanelVisible=false;PhotoOptionsPanelAccordionTitle.innerHTML="Click to <i>show</i> the complete Photo Options Panel!";}}else{var PhotoOptionsPanelAccordionTitle=$get("PhotoOptionsPanelButtonID");if(PhotoOptionsPanelAccordionTitle!=null){PhotoOptionsPanelVisible=true;PhotoOptionsPanelAccordionTitle.innerHTML="Click to <i>hide</i> the complete Photo Options Panel!";}}}catch(e){writeDebug("Error in TogglePhotoOptionsPanelAccordionTitle ["+e.name+"]: "+e.message,true);}};function pageLoad(){var thisPhotoOptionsPanelBehavior=$get("ImageShowOptionPanelAccordion").AccordionBehavior;if(thisPhotoOptionsPanelBehavior!=null){thisPhotoOptionsPanelBehavior.add_selectedIndexChanged(TogglePhotoOptionsPanelAccordionTitle);}var logoBannerIndex=1;try{var theLogoBannerIndex=getCookie("logoBannerIndex");if(theLogoBannerIndex!=null){if(theLogoBannerIndex==1){logoBannerIndex=1;}else if(theLogoBannerIndex==2){logoBannerIndex=2;}else if(theLogoBannerIndex==3){logoBannerIndex=3;}}}catch(e){writeDebug("Error in load(GetLogoBannerIndexCookie) ["+e.name+"]: "+e.message,true);}var grabTheBanner=$get('fullwidthHeaderStyleID');if(grabTheBanner!=null){var WebSite=location.pathname;var endChar=WebSite.lastIndexOf("/");WebSite=WebSite.substring(0,endChar+1);var currentHostURL="http://"+location.host+WebSite+"images/";bannerImageName="BiteMeImagerLogo"+logoBannerIndex+".png";var urlImageBacker="url("+currentHostURL+bannerImageName+")";grabTheBanner.style.backgroundImage=urlImageBacker;}logoBannerIndex++;if(logoBannerIndex>3){logoBannerIndex=1;}try{setCookie("logoBannerIndex",logoBannerIndex,100);}catch(e){writeDebug("Error in load(SetLogoBannerIndexCookie) ["+e.name+"]: "+e.message,true);}};function load(){clearDebug();try{AlbumMasterButton=$get('dropdownParent');AlbumButtonSet[0]=$get('AlbumButton1');AlbumButtonSet[1]=$get('AlbumButton2');AlbumButtonSet[2]=$get('AlbumButton3');AlbumButtonSet[3]=$get('AlbumButton4');AlbumButtonSet[4]=$get('AlbumButton5');AlbumButtonSet[5]=$get('AlbumButton6');AlbumButtonSet[6]=$get('AlbumButton7');AlbumButtonSet[7]=$get('AlbumButton8');AlbumButtonSet[8]=$get('AlbumButton9');AlbumButtonSet[9]=$get('AlbumButton10');AlbumButtonSet[10]=$get('AlbumButton11');AlbumButtonSet[11]=$get('AlbumButton12');AlbumButtonSet[12]=$get('AlbumButton13');AlbumButtonSet[13]=$get('AlbumButton14');AlbumButtonSet[14]=$get('AlbumButton15');AlbumButtonSet[15]=$get('AlbumButton16');AlbumButtonSet[16]=$get('AlbumButton17');AlbumButtonSet[17]=$get('AlbumButton18');AlbumButtonSet[18]=$get('AlbumButton19');AlbumButtonSet[19]=$get('AlbumButton20');AlbumButtonSet[20]=$get('AlbumButton21');AlbumButtonSet[21]=$get('AlbumButton22');AlbumButtonSet[22]=$get('AlbumButton23');AlbumButtonSet[23]=$get('AlbumButton24');AlbumButtonSet[24]=$get('AlbumButton25');}catch(e){writeDebug("Trouble in load(getElementById)... Album Buttons!",true);}try{ImageObject=$get('imgview');ImageNewURL[0]=null;ImageNewURL[1]=null;ImageNewURLIndex=0;if(broswerId=="msie"){ImageObject.opacity=0;IrisTransition=true;ApplyIrisOut=true;}}catch(e){writeDebug("Trouble in load(getElementById)... ImageObject Setup!",true);}try{var theImageSize=getCookie("ImageNewURLSize");if(theImageSize!=null){if(theImageSize=="XL"){HugeSizePhotoImagePlease();}else if(theImageSize=="L"){LargeSizePhotoImagePlease();}else if(theImageSize=="ML"){MediumSizePhotoImagePlease();}else if(theImageSize=="M"){NormalSizePhotoImagePlease();}}else{NormalSizePhotoImagePlease();}}catch(e){writeDebug("Error in load(GetImageSizeCookie) ["+e.name+"]: "+e.message,true);}NormalModePhotoAlbumButton();GoToNextAlbum=false;GetPhotoDBaseServerURIList();DoTimerPOP();};var debugDiv=null;var debugSpan=null;var debugShow=false;function toggleDebugView(){try{if(debugShow){debugShow=false;hideDebug();}else{debugShow=true;showDebug();}}catch(e){alert("toggleDebugView() call failed");}};function showDebug(){try{debugDiv=$get("debugDivContent");if(debugDiv!=null){debugDiv.style.display="block";debugDiv.style.visibility="visible";}}catch(e){alert("showDebug() call failed");}};function hideDebug(){try{debugDiv=$get("debugDivContent");if(debugDiv!=null){debugDiv.style.display="none";debugDiv.style.visibility="hidden";}}catch(e){alert("hideDebug() call failed");}};function clearDebug(){try{debugDiv=$get("debugDivContent");if(debugDiv!=null){debugDiv.innerHTML="";writeClearLink();}debugSpan=$get("debugSpanContent");if(debugSpan!=null){debugSpan.style.color="#009900";}}catch(e){alert("clearDebug() call failed");}};function writeDebug(MessageOut,AddTime){try{if(AddTime==null||AddTime==""){AddTime=false;}debugDiv=$get("debugDivContent");if(debugDiv!=null){if(AddTime){debugDiv.innerHTML+=Date()+"<br\/>"+MessageOut+"<br\/>";}else{debugDiv.innerHTML+=MessageOut+"<br\/>";}}debugSpan=$get("debugSpanContent");if(debugSpan!=null&&debugSpan.style.color!="#990000"){debugSpan.style.color="#990000";}}catch(e){alert("writeDebug() call failed");}};function writeEval(code){writeDebug(code+" = "+eval(code),true);};function writeDebugObject(myobject){var strCollection="";for(curObj in myobject){if(typeof myobject[curObj]=="object"){strCollection+=curObj+": "+myobject[curObj]+"<br\/>";}else{try{strCollection+=curObj+": "+myobject[curObj]+"<br\/>";}catch(e){strCollection+=curObj+": Unable to evaluate!<br\/>";}}}writeDebug(strCollection,false);};function writeClearLink(){writeDebug("<a href='#' title='Cleanup this mess!' onclick='clearDebug(); return false;'>Clear the Debug Window!</a>",false);};function dumpToPopup(x){var win=window.open();for(var i in x){try{win.document.write(i+" = "+x[i]+"<br>");}catch(e){win.document.write(i+": Unable to evaluate!<br>");}}}