var imagePath = "navImages";
var cImage = vImage.length;
var controlsDisplay = "yes";
var useTransitions = "yes";
var needToLoadContacts = "yes";
var needToLoadFilmThumbs = "yes";
var prevPath = imagePath + "/prev.gif";
var nextPath = imagePath + "/next.gif";
var blankPath = imagePath + "/blank.gif";
var runSlidesFlag = 0;
var Mode = "Welcome";
var iImage = 0;
var controlsEnabled = 1;
var buttonsEnabled = 1;
var fullscreen = true;
var usingIE;
var timeoutid;
if ((navigator.appName == "Netscape" || navigator.appName.indexOf("Microsoft") == -1))
{
usingIE = false;
}
else
{
usingIE = true;
}
var nextVal = -1;
var prevVal = -1;
function loadedDoc()
{
if (usingIE)
{
forwButton.src=nextPath;
prevButton.src=prevPath;
topDiv.style.display = "";
galleryText.innerHTML = titleStr;
Slideshow('launch');
}
}
function loadContact()
{
if (controlsDisplay)
{
var contactText = "
";
for (i = 0 ; i < cImage / thumbsPerLine; i++)
{
contactText = contactText + "";
for (j = 0; j < thumbsPerLine; j++)
{
var x = (i * thumbsPerLine + j);
if (x < cImage)
{
contactText = contactText + " | ";
}
}
contactText = contactText + "
";
}
contactText = contactText + "
";
contact.innerHTML = contactText;
}
needToLoadContacts = "";
}
function loadFilm()
{
if (controlsDisplay)
{
var filmThumbsText = "";
for (i = 0 ; i < cImage ; i++)
{
filmThumbsText = filmThumbsText + " | ";
}
filmThumbsText = filmThumbsText + "
";
filmthumbs.innerHTML = filmThumbsText;
}
needToLoadFilmThumbs = "";
}
function Ticker()
{
if (runSlidesFlag == 1 && Mode == "Slideshow")
{
nextImage();
timeoutid = setTimeout("Ticker()", 5000);
}
}
function ShowControls(x)
{
if (controlsDisplay)
{
if (x=="Contact")
{
titleText.innerHTML = "";
}
}
else
{
advcontrols.style.visibility = "hidden";
}
}
function ShowButtons(f)
{
forwButton.filters[0].Apply();
prevButton.filters[0].Apply();
if (f)
{
buttonsEnabled = 1;
forwButton.filters[0].transition = 3;
prevButton.filters[0].transition = 3;
forwButton.src=nextPath;
prevButton.src=prevPath;
}
else
{
buttonsEnabled = 0;
forwButton.filters[0].transition = 2;
prevButton.filters[0].transition = 2;
prevButton.src=blankPath;
forwButton.src=blankPath;
}
forwButton.filters[0].Play();
prevButton.filters[0].Play();
}
function Film()
{
if (controlsEnabled)
{
if (needToLoadFilmThumbs)
{
loadFilm();
}
ShowControls('Film');
Mode = "Film";
runSlidesFlag = 0;
controls.style.display = "";
film.style.display = "";
filmthumbs.style.display = "";
contact.style.display = "none";
slideshow.style.display = "none";
ShowButtons(0);
filmSelect(iImage);
doResize();
}
}
function Slideshow(x)
{
if (controlsEnabled)
{
ShowControls('Slideshow');
Mode = "Slideshow";
controls.style.display = "";
slideshow.style.display = "";
ShowButtons(1);
contact.style.display = "none";
film.style.display = "none";
filmthumbs.style.display = "none";
slidemain.src = imageDir + vImage[iImage] + ".JPG";
slidemain.alt = vText[iImage];
titleText.innerHTML = vText[iImage];
doResize();
}
}
function Contact()
{
if (controlsEnabled)
{
if (needToLoadContacts)
{
loadContact();
}
ShowControls('Contact');
Mode = "Contact";
runSlidesFlag = 0;
controls.style.display = "";
contact.style.display = "";
slideshow.style.display = "none";
ShowButtons(0);
film.style.display = "none";
filmthumbs.style.display = "none";
}
}
function changeImage(x,y)
{
iImage = (iImage + cImage + x) % cImage;
if (y == "notrans" || useTransitions != "yes")
{
slidemain.src = imageDir + vImage[iImage] + ".JPG";
slidemain.alt = vText[iImage];
titleText.innerHTML = vText[iImage];
}
else
{
slidemain.filters[0].Apply();
slidemain.filters[0].transition = 17;
slidemain.src = imageDir + vImage[iImage] + ".JPG";
slidemain.alt = vText[iImage];
titleText.innerHTML = vText[iImage];
slidemain.filters[0].Play();
}
doResize();
}
function prevImage(x)
{
changeImage(-1,x);
}
function nextImage(x)
{
changeImage(+1,x);
}
function slideClick()
{
if (runSlidesFlag == 1)
{
runSlides();
}
nextImage("notrans");
}
function nextImageButton()
{
if (buttonsEnabled)
{
if (runSlidesFlag == 1)
{
runSlides();
}
nextImage("notrans");
}
}
function runSlidesButton()
{
if (buttonsEnabled)
{
if (runSlidesFlag == 0)
{
nextImage();
}
runSlides();
}
}
function prevImageButton()
{
if (buttonsEnabled)
{
if (runSlidesFlag == 1)
{
runSlides();
}
prevImage("notrans");
}
}
function runSlides()
{
runSlidesFlag = (runSlidesFlag + 1) % 2;
if (runSlidesFlag == 1)
{
timeoutid = setTimeout("Ticker()", 10000);
}
else
{
clearTimeout(timeoutid);
}
}
function filmSelect(i)
{
iImage = i;
filmmain.src = imageDir + vImage[i] + ".JPG";
filmmain.alt = vText[i];
titleText.innerHTML = vText[i];
for (var j = 0 ; j < cImage ; j++)
{
document.all["filmThumbCell"+j].style.border="";
}
document.all["filmThumbCell"+i].style.border="#00d 1px dashed";
doResize();
}
function filmJump(i)
{
iImage = i;
Film();
}
function changeFilmImage(x)
{
filmSelect((iImage + cImage + x) % cImage);
}
function prevFilmImage()
{
changeFilmImage(-1);
}
function nextFilmImage()
{
changeFilmImage(+1);
}
function contactSelect(i)
{
iImage = i;
Film();
filmmain.src = imageDir + vImage[i] + ".JPG";
filmmain.alt = vText[i];
titleText.innerHTML = vText[i];
doResize();
}
function doResize()
{
var clientWidth = (document.body.clientWidth * .802);
/* var clientHeight = (document.body.clientHeight - document.all.controls.offsetHeight - document.all.topDiv.offsetHeight - 30); */
var clientHeight = (document.body.clientHeight * .80);
if (Mode == "Film")
{
clientWidth = (document.body.clientWidth * .50);
clientHeight = (document.body.clientHeight * .50);
}
var cx = cxImage[iImage];
var cy = cyImage[iImage];
if (clientWidth < cx)
{
cy = cy * clientWidth / cx;
cx = clientWidth;
}
if (clientHeight < cy)
{
cx = cx * clientHeight / cy;
cy = clientHeight;
}
if (Mode == "Film")
{
filmmain.width = cx;
filmmain.height = cy;
}
else
{
slidemain.width = cx;
slidemain.height = cy;
}
}