﻿//-----------------------------------------------------------------------
// Copyright (C) SFosterMurray. All rights reserved.
//-----------------------------------------------------------------------
//SlideShower.js

//-----------------------------------------------------
// Why we here... The Album Details SET!
//-----------------------------------------------------
var AlbumDetailSet;
var AlbumCount;
var AlbumIndex;
//-----------------------------------------------------
// Why we here... The Album Photo Details SET!
//-----------------------------------------------------
var AlbumPhotoDetailSet;
var AlbumPhotoCount;
var AlbumPhotoIndex;
//-----------------------------------------------------
//A global XMLHttpRequest object reference.
//-----------------------------------------------------
var AlbumDetailsXHR=CreateXmlHttpRequestObject();
var AlbumPhotoDetailsXHR=CreateXmlHttpRequestObject();
//-----------------------------------------------------
// WS CALL... Get a list of all Albums in the Database.
//-----------------------------------------------------
function GetFullDatabaseAlbumList()
{
	//Better have the XmlHttpRequest Object!
	if (AlbumDetailsXHR)
	{
		//Assume we have NOTHING!
		AlbumCount=0;
		//Grab the Website from the FULL PATH... everything upto and
		//including to last '/'.
		var WebSite=location.pathname;
		var endChar=WebSite.lastIndexOf("/");
		var WebSite=WebSite.substring(0, endChar+1);
		//Full URL to target WebService.
		var hostURL="http://"+location.host+WebSite+"AlbumPhotoDetailsService.asmx/GetAlbumDetails";
		//We want this XmlHttpRequest synchronous
		AlbumDetailsXHR.open("POST", hostURL, true);
		//This is the ASYNC Response Handler.
		AlbumDetailsXHR.onreadystatechange=onFullDatabaseAlbumListComplete;
		//Execute the request... Fire at will!
		AlbumDetailsXHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		AlbumDetailsXHR.send();
	}
}
//-----------------------------------------------------
// WS Return CALL... Save the Album Details Set.
//-----------------------------------------------------
function onFullDatabaseAlbumListComplete() 
{
	//We only care about READYSTATE_COMPLETE Ready State (4).
	if (AlbumDetailsXHR.readyState==READYSTATE_COMPLETE)
	{
		//GOOD: the request was OK (equal to a Http Status code of 200).
		if (AlbumDetailsXHR.status==HTTPSTATUS_OK)
		{
			//Deal with the Response as JSON formatted Data.
			var JSONResponse=AlbumDetailsXHR.responseText;
			AlbumDetailSet=JSONResponse.parseJSON();
			//Get the Album List Count... and init the index.
			if (AlbumDetailSet!=null)
			{
				AlbumCount=AlbumDetailSet.length;
				AlbumIndex=-1;
			}
		} 
		else
		{
			//Never Happen: Trouble, Tell the USER!
			var Bugs=AlbumDetailsXHR.responseText;
			alert("Error Occurred! \n\n"+Bugs);
		}
	}
}
//-----------------------------------------------------
// WS CALL... Get the entire Album Photo Details Set.
//-----------------------------------------------------
function GetAlbumPhotoDetails(albumTitle)
{
	//Better have the XmlHttpRequest Object!
	if (AlbumPhotoDetailsXHR)
	{
		//Assume we have NOTHING!
		AlbumPhotoCount=0;
		//Grab the Website from the FULL PATH... everything upto and
		//including to last '/'.
		var WebSite=location.pathname;
		var endChar=WebSite.lastIndexOf("/");
		var WebSite=WebSite.substring(0, endChar+1);
		//Full URL to target WebService.
		var hostURL="http://"+location.host+WebSite+"AlbumPhotoDetailsService.asmx/GetAlbumPhotoDetails";
		//We want this XmlHttpRequest synchronous
		AlbumPhotoDetailsXHR.open("POST", hostURL, true);
		//This is the ASYNC Response Handler.
		AlbumPhotoDetailsXHR.onreadystatechange=onAlbumPhotoDetailsComplete;
		//Execute the request... Fire at will!
		AlbumPhotoDetailsXHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		AlbumPhotoDetailsXHR.send("AlbumTitle="+albumTitle);
	}
}
//-----------------------------------------------------
// WS Return CALL... Save the Album Photo Details Set.
//-----------------------------------------------------
function onAlbumPhotoDetailsComplete() 
{
	//We only care about READYSTATE_COMPLETE Ready State (4).
	if (AlbumPhotoDetailsXHR.readyState==READYSTATE_COMPLETE)
	{
		//GOOD: the request was OK (equal to a Http Status code of 200).
		if (AlbumPhotoDetailsXHR.status==HTTPSTATUS_OK)
		{
			//Deal with the Response as JSON formatted Data.
			var JSONResponse=AlbumPhotoDetailsXHR.responseText;
			AlbumPhotoDetailSet=JSONResponse.parseJSON();
			//Get the Album Photo Count... and init the index.
			if (AlbumPhotoDetailSet!=null)
			{
				AlbumPhotoCount=AlbumPhotoDetailSet.length;
				AlbumPhotoIndex=-1;
			}
		} 
		else
		{
			//Never Happen: Trouble, Tell the USER!
			var Bugs=AlbumPhotoDetailsXHR.responseText;
			alert("Error Occurred! \n\n"+Bugs);
		}
	}
}
//-----------------------------------------------------
// Image (Photo) Management Global STUFF!
//-----------------------------------------------------
var ImageContainer=null;
var ImageObject=null;
var ImageNewURL=null;
var ImageTextDIV=new Array(13);
var ImageHeaderDIV=null;
var ImageTextInterval=0;
//-----------------------------------------------------
// Image (Animation) Management Global STUFF!
//-----------------------------------------------------
var ImageAnimationSet=new Array(5);
var ImageAnimationIndex=0;
var ImageAnimationMaxCount=4;
var ImageAnimationWaitCount=0;
//-----------------------------------------------------
// Need access to the Slideshow radio button DIV.
//-----------------------------------------------------
var SlideshowRadioButtonDIV=null;
var RadioSet=new Array(4);
//-----------------------------------------------------
// Interval Control Management Global STUFF!
//-----------------------------------------------------
var ImageSetInterval=0;
var ImageIntervalSTOP=false;
var ImageIntervalSlow=320;
var ImageIntervalNormal=160;
var ImageIntervalFast=80;
var ImageIntervalTimeLimit=0;
//-----------------------------------------------------
// Image Run-Time Size Global STUFF!
//-----------------------------------------------------
var PhotoSize="M";
var PhotoSizeL="L";
var PhotoSizeML="ML";
var PhotoSizeM="M";
//-----------------------------------------------------
// Image Transition ActiveX Global STUFF!
//-----------------------------------------------------
var FadeTransition=true;
var ImageFadeIn=false;
var ImageFadeOut=false;
var ImageFadeCount=0;
var BlindsTransition=false;
var BlindsRandom=false;
//-----------------------------------------------------
// Blinds Transition TYPES Global STUFF!
//-----------------------------------------------------
var BlindsXFormType=new Array(4);
BlindsXFormType[0]="left";
BlindsXFormType[1]="right";
BlindsXFormType[2]="up";
BlindsXFormType[3]="down";
//-----------------------------------------------------
// Timer Manager DUDE!
//-----------------------------------------------------
function DoTimerPOP()
{
	//Did the USER stop the CLOCK???
	if (ImageIntervalSTOP==true)
	{
		window.setTimeout('DoTimerPOP()', 100);
		return;
	}
	//WE MUST HAVE THE ALBUM PHOTO SET... wait for the WS!
	if (AlbumPhotoCount==0)
	{
		window.setTimeout('DoTimerPOP()', 100);
		return;
	}
	//Deal the the ImageSet interval
	ImageSetInterval++;
	if (ImageSetInterval>=ImageIntervalTimeLimit)
	{
		//Point to the next Photo in the current Album.
		AlbumPhotoIndex++;
		//Wrap the Filename Indexer... this should come from WService.
		if (AlbumPhotoIndex>=AlbumPhotoCount)
		{
			AlbumPhotoIndex=-1;
			GoToNextAlbum=true;
		}
		else
		{
			ImageSetInterval=0;
			SetTheNextImage();
		}
	}
	//Deal with Image Fade in.
	else if (FadeTransition && ImageFadeIn)
	{
		JustFadeIn();
	}
	//Deal with Random Blinds Image Transition.
	else if (BlindsTransition && BlindsRandom)
	{
		DoTheBlindsThing();
	}
	//Is it time to fade away DUDE!
	if (FadeTransition && ImageSetInterval==(ImageIntervalTimeLimit-20))
	{
		//Perpare the fader... MSIE v6.0 or later!	
		if (document.all) 
		{
			ImageObject.opacity=100;
			ImageFadeIn=false;
			ImageFadeOut=true;
			ImageFadeCount=0;
		}
	}
	//deal with Image Fade out.
	if (FadeTransition && ImageFadeOut)
	{
		JustFadeOut();
	}
	//Set the next Image Text Title/Story line... After the Image is visible!
	ImageTextInterval++;
	if (ImageTextInterval==15)
	{
		if (AlbumPhotoIndex>=0 && AlbumPhotoIndex<AlbumPhotoCount)
		{
			//Set the current Album Photo Story LINE.
			ShowTheAlbumPhotoStory();
			//Set the current Album Title LINE.
			ImageHeaderDIV.innerHTML=AlbumPhotoDetailSet[AlbumPhotoIndex].Caption;
			//May sure we can see it!
			ImageHeaderDIV.style.display="block";
			ImageHeaderDIV.style.visibility="visible";
			//Set the Padding...
			ImageHeaderDIV.style.paddingLeft="10"
			ImageHeaderDIV.style.paddingRight="10"
		}
	}
	//Time to change the ANIMATION Image????
	ImageAnimationWaitCount++;
	if (ImageAnimationWaitCount>=(ImageIntervalTimeLimit*4))
	{
		var radio=document.getElementById('radio1'); 
		
		ImageAnimationWaitCount=0;
		//Hide the last ANIMATION Image.
		ImageAnimationSet[ImageAnimationIndex].style.display="none";
		ImageAnimationSet[ImageAnimationIndex].style.visibility="hidden";
		//Get the next ANIMATION Image Index: wrap it!
		ImageAnimationIndex++;
		if (ImageAnimationIndex>ImageAnimationMaxCount)
		{
			ImageAnimationIndex=0;
		}
		//Show the next ANIMATION Image.
		ImageAnimationSet[ImageAnimationIndex].style.display="block";
		ImageAnimationSet[ImageAnimationIndex].style.visibility="visible";
		//Reset the Margin of the DIV below this OBJECT.
		if (ImageAnimationIndex==0)
		{
			SlideshowRadioButtonDIV.style.marginTop=16;
		}
		else if (ImageAnimationIndex==1)
		{
			SlideshowRadioButtonDIV.style.marginTop=12;
			ImageAnimationSet[ImageAnimationIndex].style.marginTop=-197;
		}
		else if (ImageAnimationIndex==2)
		{
			SlideshowRadioButtonDIV.style.marginTop=12;
			ImageAnimationSet[ImageAnimationIndex].style.marginTop=-197;
		}
		else if (ImageAnimationIndex==3)
		{
			SlideshowRadioButtonDIV.style.marginTop=10;
			ImageAnimationSet[ImageAnimationIndex].style.marginTop=-182;
		}
		else if (ImageAnimationIndex==4)
		{
			SlideshowRadioButtonDIV.style.marginTop=15;
			ImageAnimationSet[ImageAnimationIndex].style.marginTop=-167;
		}
	}
	//-------------------------------------------------------------------
	// Schedule the next call to method DoTimerPOP() in XXX milliseconds.
	//-------------------------------------------------------------------
	window.setTimeout('DoTimerPOP()', 100);
}
//-----------------------------------------------------
//Select the next IMAGE.
//-----------------------------------------------------
function SetTheNextImage()
{
	//Need a unique number for each handler call to fool the MSIE cache.
	var TimeStamp=new Date();
	var Seconds=TimeStamp.getTime();
	//Create a new Image Obj to rcv the new Image and we must
	// wait for xmt completion... see fade-in logic!
	ImageNewURL=new Image();
	ImageNewURL.src="Handler.ashx?PhotoID="+AlbumPhotoDetailSet[AlbumPhotoIndex].PhotoID+"&Size="+PhotoSize+"&time="+Seconds;
	//Clear Text Story LINEs.
	HideAllImageStoryDivs(false);
	ImageTextInterval=0;
	//Perpare the fader... MSIE v6.0 or later!	
	if (document.all) 
	{
		//Fade /in/out/...
		if (FadeTransition) 
		{
			ImageObject.opacity=0;
			ImageFadeIn=true;
			ImageFadeOut=false;
			ImageFadeCount=0;
		}
		//Blinds /left/right/up/down/...
		else if (BlindsTransition)
		{
			BlindsRandom=false;
		}
	}
	//All other browsers... just do it!	
	else 
	{
		//Ya! Save the newly arrived Image.
		ImageObject.src= ImageNewURL.src;
		//We are done with the TEMP Image Obj
		ImageNewURL=null;
		FadeTransition=false;
		ImageFadeIn=false;
		ImageFadeOut=false;
		ImageFadeCount=0;
	}
}
//-----------------------------------------------------
//Set the IMAGE Opacity.
//-----------------------------------------------------
function SetOpacity(imgName, step)
{
	//MSIE v6.0 and better my friends!
	if (document.all)
	{
		var img=document.images[imgName];
		img.opacity += step;
		img.style.filter='alpha(opacity = ' + img.opacity + ')'; 	
	}
}
//-----------------------------------------------------
//Image Fade-In Handler.
//-----------------------------------------------------
function JustFadeIn()
{
	//Do not start until the new IMG has arrived!
	if (ImageNewURL!=null)
	{
		if (ImageNewURL.readyState=='complete')
		{
			//Match the outer DIV frame size to the new IMAGE.
			ImageContainer.style.height=ImageNewURL.height;
			ImageContainer.style.width=ImageNewURL.width;
			ImageContainer.style.border="outset";
			//Position the Picture in it's DIV container.
			ImageContainer.style.marginTop=15;
			if (ImageNewURL.width>ImageNewURL.height)
			{
				ImageContainer.style.marginTop=50;
			}
			//Ya! Save the newly arrived Image.
			ImageObject.src=ImageNewURL.src;
			//Make sure we have the proper height/width
			ImageObject.width=ImageNewURL.width;
			ImageObject.height=ImageNewURL.height;
			//MouseOver: I want to see the Image URL!
			ImageObject.alt=ImageObject.src;
			//We are done with the TEMP Image Obj
			ImageNewURL=null;
		}
	}
	else 
	{
		//Deal with the FADE-IN Operation.
		SetOpacity('imgview', 5);
		ImageFadeCount++;
		//Ya! First time thru... make sure it is hidden!
		if (ImageFadeCount==1)
			ImageObject.style.visibility="visible";
		if (ImageFadeCount>=20)
		{
			ImageFadeIn=false;
			ImageFadeOut=false;
			ImageFadeCount=0;
			//Make sure the Radio Button Set is ENABLED.
			if (RadioSet[0].isDisabled==true)
			{
				RadioSet[0].disabled=false;
				RadioSet[1].disabled=false;
				RadioSet[2].disabled=false;
				RadioSet[3].disabled=false;
			}
		}
	}
}
//-----------------------------------------------------
//Image Fade-Out Handler.
//-----------------------------------------------------
function JustFadeOut()
{
	//Deal with the FADE-OUT Operation.
	SetOpacity('imgview', -5);
	ImageFadeCount++;
	if (ImageFadeCount>=20)
	{
		ImageFadeIn=false;
		ImageFadeOut=false;
		ImageFadeCount=0;
	}
}
//-----------------------------------------------------
//Image Blinds Transition Handler.
//-----------------------------------------------------
function DoTheBlindsThing()
{
	//Do not start until the new IMG has arrived!
	if (ImageNewURL!=null)
	{
		if (ImageNewURL.readyState=='complete')
		{
			//Generate a random INDEX [up/down/left/right]
			var BlindsTypeIndex=Math.floor(Math.random()*4);
			//Generate a random Band Count [1-10]
			var BlindsBands=Math.floor(Math.random()*10);
			if (BlindsBands<=0)
				BlindsBands=1;
			else if (BlindsBands>10)
				BlindsBands=10;
			//Setup the new [up/down/left/right] Blinds Filter...
			ImageObject.style.filter="progid:DXImageTransform.Microsoft.Blinds(direction="+BlindsXFormType[BlindsTypeIndex]+",bands="+BlindsBands+",duration=4)";
			//Apply the Filter and stop all motion...
			ImageObject.filters(0).Apply();
			//Ya! Save the newly arrived Image.
			ImageObject.src=ImageNewURL.src;
			//Let the sucker RIP...
			ImageObject.filters(0).Play();
			//Done with this one for now!
			BlindsRandom=false;
			//Match the outer DIV frame size to the new IMAGE.
			ImageContainer.style.height=ImageNewURL.height;
			ImageContainer.style.width=ImageNewURL.width;
			ImageContainer.style.border="outset";
			//Make sure we have the proper height/width
			ImageObject.width=ImageNewURL.width;
			ImageObject.height=ImageNewURL.height;
			//MouseOver: I want to see the Image URL!
			ImageObject.alt=ImageObject.src;
			//We are done with the TEMP Image Obj
			ImageNewURL=null;
		}
	}
}
//-----------------------------------------------------
//Show the Album Photo Story. Divide the entire story
//text into sub-segments, split on newline character.
//-----------------------------------------------------
function ShowTheAlbumPhotoStory()
{
	//We must have a valid album.
	if (AlbumPhotoDetailSet!=null)
	{
		//Grab the next Album Photo story.
		var ThisStory=AlbumPhotoDetailSet[AlbumPhotoIndex].PhotoStory;
		//Split it up into a set of paragraphs.
		var ThisStorySplit=ThisStory.split("\n");
		//Hide all the Slide Show Story DIVs (10).
		HideAllImageStoryDivs(false);
		var DIVCount=0;
		//Multi paragraph Album Photo Story!
		if (ThisStorySplit.length>0)
		{
			//Do it once for each paragraph.
			for (i=0;i<ThisStorySplit.length;i++)
			{
				//Blank line... force some blank chars.
				if (ThisStorySplit[i]=="")
				{
					ImageTextDIV[i].innerHTML="             ";
				}
				//Set the paragraph in the DIV!
				else 
				{
					ImageTextDIV[i].innerHTML=ThisStorySplit[i];
				}
				//May sure we can see it!
				ImageTextDIV[i].style.display="block";
				ImageTextDIV[i].style.visibility="visible";
				//Set the Padding...
				ImageTextDIV[i].style.paddingLeft="10"
				ImageTextDIV[i].style.paddingRight="10"
				if (i==0)
				{
					ImageTextDIV[i].style.paddingTop="5"
				}
				if (i==ThisStorySplit.length-1)
				{
					ImageTextDIV[i].style.paddingBottom="5"
				}
				//We only have 13 inner DIVs...
				DIVCount++
				if (DIVCount==13)
					break;
			}
		}
		//Single paragraph Album Photo Story!
		else
		{
			//Simple... just use all the text.
			ImageTextDIV[0].innerHTML=ThisStory;
			ImageTextDIV[0].style.display="block";
			ImageTextDIV[0].style.visibility="visible";
		}
	}
}
//-----------------------------------------------------
//Hide all the Image Story DIVs. We are creating a new
//Image Story paragraph.
//-----------------------------------------------------
function HideAllImageStoryDivs(bShowLoading)
{	
	for (i=0;i<ImageTextDIV.length;i++)
	{
		ImageTextDIV[i].innerHTML="";
		ImageTextDIV[i].style.display="none";
		ImageTextDIV[i].style.visibility="hidden";
		ImageTextDIV[i].style.paddingLeft="0"
		ImageTextDIV[i].style.paddingRight="0"
		ImageTextDIV[i].style.paddingTop="0"
		ImageTextDIV[i].style.paddingBottom="0"
	}
	//Do we need to show the LOADING... String??
	if (bShowLoading==true)
	{
		//Yes... just do it!
		ImageTextDIV[0].innerHTML="Loading...";
		//May sure we can see it!
		ImageTextDIV[0].style.display="block";
		ImageTextDIV[0].style.visibility="visible";
		//Set the Padding...
		ImageTextDIV[0].style.paddingLeft="10"
		ImageTextDIV[0].style.paddingTop="5"
		ImageTextDIV[0].style.paddingRight="10"
		ImageTextDIV[0].style.paddingBottom="5"
	}
}
//-----------------------------------------------------
//Get the new Slideshow control VALUE.
//-----------------------------------------------------
function SlideshowRunOption1()
{
	//Someone wants to change the Slideshow operation!
	var thisForm=document.forms[0];
	for (var i=0;i<thisForm.SlideShowControl.length;i++) 
	{
		if (thisForm.SlideShowControl[i].checked) 
		{
			break;
		}
	}
	//STOP!
	if (thisForm.SlideShowControl[i].value==0)
	{
		ImageIntervalSTOP=true;
	}
	//Run but slow!
	else if (thisForm.SlideShowControl[i].value==1)
	{
		ImageIntervalSTOP=false;
		//force a re-show!
		ImageIntervalTimeLimit=ImageIntervalSlow;
		ImageSetInterval=ImageIntervalTimeLimit-25;
	}
	//Run normally!
	else if (thisForm.SlideShowControl[i].value==2)
	{
		ImageIntervalSTOP=false;
		//force a re-show!
		ImageIntervalTimeLimit=ImageIntervalNormal;
		ImageSetInterval=ImageIntervalTimeLimit-25;
	}
	//Run but fast!
	else if (thisForm.SlideShowControl[i].value==3)
	{
		ImageIntervalSTOP=false;
		//force a re-show!
		ImageIntervalTimeLimit=ImageIntervalFast;
		ImageSetInterval=ImageIntervalTimeLimit-25;
	}
	else
	//default!
	{
		ImageIntervalSTOP=false;
		//force a re-show!
		ImageIntervalTimeLimit=ImageIntervalNormal;
		ImageSetInterval=ImageIntervalTimeLimit-25;
	}
}
//-----------------------------------------------------
// The one the ONLY... the lonely! LOAD.
//-----------------------------------------------------
function load() 
{
	//IMAGE access using the DOM...	We use this everywhere for IMAGE Header Text.
	ImageHeaderDIV=document.getElementById('slideshow_header1'); 
	//IMAGE Animation Object access using the DOM... Used to hide/show Animated GIFs!
	ImageAnimationSet[0]=document.getElementById('Img1'); 
	ImageAnimationSet[1]=document.getElementById('Img2'); 
	ImageAnimationSet[2]=document.getElementById('Img3'); 
	ImageAnimationSet[3]=document.getElementById('Img4'); 
	ImageAnimationSet[4]=document.getElementById('Img5'); 
	//IMAGE access using the DOM...	We use these DIVs everywhere for IMAGE Story Text.
	ImageTextDIV[0]=document.getElementById('slideshow0'); 
	ImageTextDIV[1]=document.getElementById('slideshow1'); 
	ImageTextDIV[2]=document.getElementById('slideshow2'); 
	ImageTextDIV[3]=document.getElementById('slideshow3'); 
	ImageTextDIV[4]=document.getElementById('slideshow4'); 
	ImageTextDIV[5]=document.getElementById('slideshow5'); 
	ImageTextDIV[6]=document.getElementById('slideshow6'); 
	ImageTextDIV[7]=document.getElementById('slideshow7'); 
	ImageTextDIV[8]=document.getElementById('slideshow8'); 
	ImageTextDIV[9]=document.getElementById('slideshow9'); 
	ImageTextDIV[10]=document.getElementById('slideshow10'); 
	ImageTextDIV[11]=document.getElementById('slideshow11'); 
	ImageTextDIV[12]=document.getElementById('slideshow12'); 
	//IMAGE DIV Container access using the DOM...
	ImageContainer=document.getElementById('slideshow_image'); 
	//We need access to the Radio Button Set.
	RadioSet[0]=document.getElementById('radio1'); 
	RadioSet[1]=document.getElementById('radio2'); 
	RadioSet[2]=document.getElementById('radio3'); 
	RadioSet[3]=document.getElementById('radio4'); 
	//Need access to the Slideshow radio button DIV.
	SlideshowRadioButtonDIV=document.getElementById('slide_show_control_radio'); 
	//IMAGE access using the DOM...	We use this everywhere as well for Image Access.
	ImageObject=document.getElementById('imgview');  
	//Create a new Image Obj to rcv the new Image and we must
	// wait for xmt completion... see fade-in logic!
	ImageNewURL=new Image();
	//Default Image Cycle... Normal!
	ImageIntervalTimeLimit=ImageIntervalNormal
	//Fake-out... make'em grab the 1st Album Photo.
	ImageSetInterval=ImageIntervalTimeLimit-8;
	//WE ARE ACTIVE!
	ImageIntervalSTOP=false;
	//Perpare the fader... MSIE v6.0 or later!	
	if (document.all) 
	{
		ImageObject.opacity=0;
		ImageFadeIn=true;
		ImageFadeOut=false;
		ImageFadeCount=0;
	}
	//All other browsers... just do it!	
	else 
	{
		//Ya! Save the newly arrived Image.
		ImageObject.src= ImageNewURL.src;
		//We are done with the TEMP Image Obj
		ImageNewURL=null;
		FadeTransition=false;
		ImageFadeIn=false;
		ImageFadeOut=false;
		ImageFadeCount=0;
	}
	//Grab the Special 'Twas the Nite B4 XMAS' Album.
	GetAlbumPhotoDetails("Special Slideshow");
	//Start the BALL ROLLING!
	DoTimerPOP();
}

