﻿var currentBorderDrawn = "";
var currentBorderDrawnGallery = "";
var photoSliderPos = 0;
var floorPlanSliderPos = 0;
var animationSliderPos = 0;
var videoSliderPos = 0;
var galleryPhotoSliderPos = 0;
var galleryFloorPlanSliderPos = 0;
var galleryAnimationSliderPos = 0;
var galleryVideoSliderPos = 0;
var scrollDwnAmt = 0;
var scrollUpAmt = 0;
var scrollLeftAmt = 0;
var scrollRightAmt = 0;
var currentGlobalCtrl = "";

function DeactivateTab() {
    return false;
}

function SetSliderButton(button) {
    var buttonID = "ctl03_" + button;

    if (button == "btnMoveUp") {
        if (document.getElementById(buttonID).style.cursor = "default") {
            document.getElementById(buttonID).src = "App_Themes/Images/SliderTest/slider-button-top-inactive.gif";
        }
        else {
            document.getElementById(buttonID).src = "App_Themes/Images/SliderTest/slider-button-top-active.gif";
        }
    }
    else {
        if (document.getElementById(buttonID).style.cursor = "default") {
            document.getElementById(buttonID).src = "App_Themes/Images/SliderTest/slider-button-bottom-inactive.gif";
        }
        else {
            document.getElementById(buttonID).src = "App_Themes/Images/SliderTest/slider-button-bottom-inactive.gif";
        }
    }
}
var t;
function MoveSliderDown(ctrlId) {
    var divToScroll = document.getElementById(ctrlId);
    if (scrollDwnAmt < 350) {
        divToScroll.scrollTop = divToScroll.scrollTop + 50;
        t = setTimeout('MoveSliderDown(\'' + ctrlId + '\')', 20);
        scrollDwnAmt += 50;
    }
    else {
        scrollDwnAmt = 0;
        clearTimeout(t);
    }
}

function MoveSliderDownWithSlab(ctrlId, amount) {
    var divToScroll = document.getElementById(ctrlId);
    if (scrollDwnAmt < amount) {
        divToScroll.scrollTop = divToScroll.scrollTop + 50;
        t = setTimeout(function() { MoveSliderDownWithSlab(ctrlId, amount) }, 20);
        scrollDwnAmt += 50;
    }
    else {
        scrollDwnAmt = 0;
        clearTimeout(t);
    }
}

function MoveSliderUp(ctrlId) {
    var divToScroll = document.getElementById(ctrlId);
    if (scrollUpAmt < 350) {
        divToScroll.scrollTop = divToScroll.scrollTop - 50;
        t = setTimeout('MoveSliderUp(\'' + ctrlId + '\')', 20);
        scrollUpAmt += 50;
    }
    else {
        scrollUpAmt = 0;
        clearTimeout(t);
    }
}

function MoveSliderUpWithSlab(ctrlId, amount) {
    var divToScroll = document.getElementById(ctrlId);
    if (scrollUpAmt < amount) {
        divToScroll.scrollTop = divToScroll.scrollTop - 50;
        t = setTimeout(function() { MoveSliderUpWithSlab(ctrlId, amount) }, 20);
        scrollUpAmt += 50;
    }
    else {
        scrollUpAmt = 0;
        clearTimeout(t);
    }
}

function MoveSliderRightWithSlab(ctrldId, amount) {
    var divToScroll = document.getElementById(ctrldId);
    if (scrollRightAmt < amount) {
        divToScroll.scrollLeft = divToScroll.scrollLeft + 88;
        t = setTimeout(function() { MoveSliderRightWithSlab(ctrldId, amount) }, 20);
        scrollRightAmt += 88;
    }
    else {
        scrollRightAmt = 0;
        clearTimeout(t);
    }
}

function MoveSliderRight(ctrlId) {
    var divToScroll = document.getElementById(ctrlId);
    if (scrollRightAmt < 880) {
        divToScroll.scrollLeft = divToScroll.scrollLeft + 88;
        t = setTimeout('MoveSliderRight(\'' + ctrlId + '\')', 20);
        scrollRightAmt += 88;
    }
    else {
        scrollRightAmt = 0;
        clearTimeout(t);
    }
}

function MoveSliderLeft(ctrlId) {
    var divToScroll = document.getElementById(ctrlId);
    if (scrollLeftAmt < 880) {
        divToScroll.scrollLeft = divToScroll.scrollLeft - 88;
        t = setTimeout('MoveSliderLeft(\'' + ctrlId + '\')', 20);
        scrollLeftAmt += 88;
    }
    else {
        scrollLeftAmt = 0;
        clearTimeout(t);
    }
}

function MoveSliderLeftWithSlab(ctrlId, amount) {
    var divToScroll = document.getElementById(ctrlId);
    if (scrollLeftAmt < amount) {
        divToScroll.scrollLeft = divToScroll.scrollLeft - 88;
        t = setTimeout(function() { MoveSliderLeftWithSlab(ctrlId, amount) }, 20);
        scrollLeftAmt += 88;
    }
    else {
        scrollLeftAmt = 0;
        clearTimeout(t);
    }
}

function setOpacity(obj, opacity) {
    opacity = (opacity == 100) ? 99.999 : opacity;

    // IE/Win
    obj.style.filter = "alpha(opacity:" + opacity + ")";

    // Safari<1.2, Konqueror
    obj.style.KHTMLOpacity = opacity / 100;

    // Older Mozilla and Firefox
    obj.style.MozOpacity = opacity / 100;

    // Safari 1.2, newer Firefox and Mozilla, CSS3
    obj.style.opacity = opacity / 100;
}

function fadeIn(objId, opacity) {
    if (document.getElementById) {
        obj = document.getElementById(objId);
        if (opacity <= 100) {
            setOpacity(obj, opacity);
            opacity += 10;
            window.setTimeout("fadeIn('" + objId + "'," + opacity + ")", 50);
        }
    }
}

function LoadGeneralContentMainImg(imgName) {
    document.getElementById("ContentFlashHolder").innerHTML = "";
    document.getElementById("ContentFlashHolder").className = "ContentFlashHolderHidden";
    document.getElementById("ctl00_ContentPlaceHolder1_GeneralContentMainImage").style.display = "block";
    document.getElementById("ctl00_ContentPlaceHolder1_GeneralContentMainImage").className = imgName + "-content";
    fadeIn("ctl00_ContentPlaceHolder1_GeneralContentMainImage", 0);
}

function DrawBorder(ImgId) {
    if (ImgId != currentBorderDrawn) {
        if (currentBorderDrawn != "") {
            document.getElementById(currentBorderDrawn).style.border = "solid 2px #3e3526";
            document.getElementById(currentBorderDrawn).className = "Saturated";
            document.getElementById(ImgId).style.border = "solid 2px #fff";
            document.getElementById(ImgId).className = "SaturatedAlive";
            currentBorderDrawn = ImgId;
        }
        else {
            document.getElementById(ImgId).style.border = "solid 2px #fff";
            document.getElementById(ImgId).className = "SaturatedAlive";
            currentBorderDrawn = ImgId;
        }
    }
    else {
        currentBorderDrawn = ImgId;
    }
}

function DrawBorderPhotos(ImgId, original) {
    document.getElementById(original).style.border = "solid 2px #3e3526";
    if (ImgId != currentBorderDrawn) {
        if (currentBorderDrawn != "") {
            document.getElementById(currentBorderDrawn).style.border = "solid 2px #3e3526";
            document.getElementById(currentBorderDrawn).className = "Saturated";
            document.getElementById(ImgId).style.border = "solid 2px #fff";
            document.getElementById(ImgId).className = "SaturatedAlive";
            currentBorderDrawn = ImgId;
        }
        else {
            document.getElementById(ImgId).style.border = "solid 2px #fff";
            document.getElementById(ImgId).className = "SaturatedAlive";
            currentBorderDrawn = ImgId;
        }
    }
    else {
        currentBorderDrawn = ImgId;
    }
}

function DrawGalleryPhotosBorder(ImgId, original) {
    document.getElementById(original).style.border = "solid 2px #3e3526";
    if (ImgId != currentBorderDrawnGallery) {
        if (currentBorderDrawnGallery != "") {
            document.getElementById(currentBorderDrawnGallery).style.border = "solid 2px #3e3526";
            document.getElementById(currentBorderDrawnGallery).className = "Saturated";
            document.getElementById(ImgId).style.border = "solid 2px #fff";
            document.getElementById(ImgId).className = "SaturatedAlive";
            currentBorderDrawnGallery = ImgId;
        }
        else {
            document.getElementById(ImgId).style.border = "solid 2px #fff";
            document.getElementById(ImgId).className = "SaturatedAlive";
            currentBorderDrawnGallery = ImgId;
        }
    }
    else {
        currentBorderDrawnGallery = ImgId;
    }
}

function DrawGalleryBorder(ImgId) {
    if (ImgId != currentBorderDrawnGallery) {
        if (currentBorderDrawnGallery != "") {
            document.getElementById(currentBorderDrawnGallery).style.border = "solid 2px #3e3526";
            document.getElementById(currentBorderDrawnGallery).className = "Saturated";
            document.getElementById(ImgId).style.border = "solid 2px #fff";
            document.getElementById(ImgId).className = "SaturatedAlive";
            currentBorderDrawnGallery = ImgId;
        }
        else {
            document.getElementById(ImgId).style.border = "solid 2px #fff";
            document.getElementById(ImgId).className = "SaturatedAlive";
            currentBorderDrawnGallery = ImgId;
        }
    }
    else {
        currentBorderDrawnGallery = ImgId;
    }
}

function LoadGalleryPhotoToCenter(imgName) {

    document.getElementById("ctl00_ContentPlaceHolder1_GalleryWrapperDiv").style.height = "466px";
    document.getElementById("ctl00_ContentPlaceHolder1_FlashPadder").style.paddingLeft = "0";
    document.getElementById("ctl00_ContentPlaceHolder1_GalleryFlashHolder").innerHTML = "";
    document.getElementById("ctl00_ContentPlaceHolder1_GalleryFlashHolder").className = "GalleryFlashContentHolderHidden";
    document.getElementById("ctl00_ContentPlaceHolder1_GalleryMainImage").style.display = "block";
    document.getElementById("ctl00_ContentPlaceHolder1_GalleryMainImage").className = imgName + "-gallery";
    fadeIn("ctl00_ContentPlaceHolder1_GalleryMainImage", 0);
}

function LoadCaptionText(ImgId) {
    var allCaptions = document.getElementById("ctl00_ContentPlaceHolder1_ctl00_photoCaptionsHidden").value.toString().split('|');
    for (key in allCaptions) {
        if (allCaptions[key].toString().substring(0, 4) == ImgId) {
            if (ImgId.toString().substr(0, 1) == "F") {
                document.getElementById("ctl00_ContentPlaceHolder1_ImageCaptionText").innerHTML = allCaptions[key].toString();
                document.getElementById("ctl00_ContentPlaceHolder1_btnLoadLargeFloorPlan").style.display = "block";
            }
            else {
                document.getElementById("ctl00_ContentPlaceHolder1_ImageCaptionText").innerHTML = allCaptions[key].toString();
                document.getElementById("ctl00_ContentPlaceHolder1_btnLoadLargeFloorPlan").style.display = "none";
            }
        }
    }
}

function LoadFloorPlanModalPopUp(ImgId) {
    var popUpDiv = document.getElementById("popFloorPlan");
    popUpDiv.style.textAlign = "center";
    popUpDiv.innerHTML = "";
    popUpDiv.innerHTML = "<div class=\"TentsFloorPlanWrapper\"><img src='App_Themes/Images/Gallery/" + ImgId + "-gallery.gif' /></div>";
}

function LoadCaptionTextGallery(ImgId) {
    var allCaptions = document.getElementById("ctl00_ContentPlaceHolder1_hiddenCaptionsGallery").value.toString().split('|');
    for (key in allCaptions) {
        if (allCaptions[key].toString().substring(0, 4) == ImgId)
            document.getElementById("ctl00_ContentPlaceHolder1_GalleryImageText").innerHTML = allCaptions[key].toString();
    }
}

function HoverGallerySliderArrow(slider, count, direction) {
    switch (slider) {
        case "photo":
            if (direction == "left") {
                //slider is a top, so don't highlight
                if (galleryPhotoSliderPos < 1) {

                }
                else {
                    document.getElementById("photoLeftArrow").src = "App_Themes/Images/Gallery/thumbnail-arrow-left-high.gif";
                }
            }
            else if (direction == "right") {
                //slider is at bottom so don't highlight
            if (galleryPhotoSliderPos == count - 1) {

                }
                else {
                    document.getElementById("photoRightArrow").src = "App_Themes/Images/Gallery/thumbnail-arrow-right-high.gif";
                }
            }
            break;
        case "floorPlan":
            if (direction == "left") {
                //slider is a top, so don't highlight
                if (galleryFloorPlanSliderPos < 1) {

                }
                else {
                    document.getElementById("floorPlanLeftArrow").src = "App_Themes/Images/Gallery/thumbnail-arrow-left-high.gif";
                }
            }
            else if (direction == "right") {
                //slider is at bottom so don't highlight
            if (galleryFloorPlanSliderPos == count - 1) {

                }
                else {
                    document.getElementById("floorPlanRightArrow").src = "App_Themes/Images/Gallery/thumbnail-arrow-right-high.gif";
                }
            }
            break;
        case "animation":
            if (direction == "left") {
                //slider is a top, so don't highlight
                if (galleryAnimationSliderPos < 1) {

                }
                else {
                    document.getElementById("animationLeftArrow").src = "App_Themes/Images/Gallery/thumbnail-arrow-left-high.gif";
                }
            }
            else if (direction == "right") {
                //slider is at bottom so don't highlight
            if (galleryAnimationSliderPos == count - 1) {

                }
                else {
                    document.getElementById("animationRightArrow").src = "App_Themes/Images/Gallery/thumbnail-arrow-right-high.gif";
                }
            }
            break;
        case "video":
            if (direction == "left") {
                //slider is a top, so don't highlight
                if (galleryVideoSliderPos < 1) {

                }
                else {
                    document.getElementById("videoLeftArrow").src = "App_Themes/Images/Gallery/thumbnail-arrow-left-high.gif";
                }
            }
            else if (direction == "right") {
                //slider is at bottom so don't highlight
            if (galleryVideoSliderPos == count - 1) {

                }
                else {
                    document.getElementById("videoRightArrow").src = "App_Themes/Images/Gallery/thumbnail-arrow-right-high.gif";
                }
            }
            break;
    }
}

function HoverSliderArrow(slider, count, direction) {
    switch (slider) {
        case "photo":
            if (direction == "up") {
                //slider is a top, so don't highlight
                if (photoSliderPos < 1) {

                }
                else {
                    document.getElementById("photoUpArrow").src = "App_Themes/Images/Master/thumbnail-arrow-up-high.gif";
                }
            }
            else if (direction == "down") {
                //slider is at bottom so don't highlight
                if (photoSliderPos == count - 1) {

                }
                else {
                    document.getElementById("photoDownArrow").src = "App_Themes/Images/Master/thumbnail-arrow-down-high.gif";
                }       
            }
            break;
        case "floorPlan":
            if (direction == "up") {
                //slider is a top, so don't highlight
                if (floorPlanSliderPos < 1) {

                }
                else {
                    document.getElementById("floorPlanUpArrow").src = "App_Themes/Images/Master/thumbnail-arrow-up-high.gif";
                }
            }
            else if (direction == "down") {
                //slider is at bottom so don't highlight
            if (floorPlanSliderPos == count - 1) {

                }
                else {
                    document.getElementById("floorPlanDownArrow").src = "App_Themes/Images/Master/thumbnail-arrow-down-high.gif";
                }
            }
            break;
        case "animation":
            if (direction == "up") {
                //slider is a top, so don't highlight
                if (animationSliderPos < 1) {

                }
                else {
                    document.getElementById("animationUpArrow").src = "App_Themes/Images/Master/thumbnail-arrow-up-high.gif";
                }
            }
            else if (direction == "down") {
                //slider is at bottom so don't highlight
            if (animationSliderPos == count - 1) {

                }
                else {
                    document.getElementById("animationDownArrow").src = "App_Themes/Images/Master/thumbnail-arrow-down-high.gif";
                }
            }
            break;
        case "video":
            if (direction == "up") {
                //slider is a top, so don't highlight
                if (videoSliderPos < 1) {

                }
                else {
                    document.getElementById("videoUpArrow").src = "App_Themes/Images/Master/thumbnail-arrow-up-high.gif";
                }
            }
            else if (direction == "down") {
            //slider is at bottom so don't highlight
                if (videoSliderPos == count - 1) {

                }
                else {
                    document.getElementById("videoDownArrow").src = "App_Themes/Images/Master/thumbnail-arrow-down-high.gif";
                }
            }
            break;
    }
}

function ReturnSliderArrowGallery(arrowID, direction) {
    switch (direction) {
        case "left":
            document.getElementById(arrowID).src = "App_Themes/Images/Gallery/thumbnail-arrow-left-low.gif";
            break;
        case "right":
            document.getElementById(arrowID).src = "App_Themes/Images/Gallery/thumbnail-arrow-right-low.gif";
            break;
    }
}

function ReturnSliderArrow(arrowID, direction) {
    switch (direction) {
        case "up":
            document.getElementById(arrowID).src = "App_Themes/Images/Master/thumbnail-arrow-up-low.gif";
            break;
        case "down":
            document.getElementById(arrowID).src = "App_Themes/Images/Master/thumbnail-arrow-down-low.gif";
            break;
    }
}

function SetGallerySliderPos(slider, count, direction) {
    switch (slider) {
        case "photo":
            if (direction == "left") {
                //if slider is already at top then don't do anything just let them click - there should be no hover anyway.
                if (galleryPhotoSliderPos < 1) {
                    galleryPhotoSliderPos = galleryPhotoSliderPos;
                }
                //take it up one slab.
                else if (galleryPhotoSliderPos > 0) {
                    document.getElementById("photoBlob" + galleryPhotoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    galleryPhotoSliderPos--;
                    document.getElementById("photoBlob" + galleryPhotoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            else if (direction == "right") {
                //if slider is at bottom then don't do anything - there should be no hover.
            if (galleryPhotoSliderPos == count) {
                galleryPhotoSliderPos == galleryPhotoSliderPos;
                }
                else if (galleryPhotoSliderPos < count - 1) {
                    document.getElementById("photoBlob" + galleryPhotoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    galleryPhotoSliderPos++;
                    document.getElementById("photoBlob" + galleryPhotoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            break;
        case "floorPlan":
            if (direction == "left") {
                //if slider is already at top then don't do anything just let them click - there should be no hover anyway.
                if (galleryFloorPlanSliderPos < 1) {
                    galleryFloorPlanSliderPos = galleryFloorPlanSliderPos;
                }
                //take it up one slab.
                else if (galleryFloorPlanSliderPos > 0) {
                    document.getElementById("floorPlanBlob" + galleryFloorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    galleryFloorPlanSliderPos--;
                    document.getElementById("floorPlanBlob" + galleryFloorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            else if (direction == "right") {
                //if slider is at bottom then don't do anything - there should be no hover.
                if (galleryFloorPlanSliderPos == count) {
                    galleryFloorPlanSliderPos == galleryFloorPlanSliderPos;
                }
                else if (galleryFloorPlanSliderPos < count - 1) {
                    document.getElementById("floorPlanBlob" + galleryFloorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    galleryFloorPlanSliderPos++;
                    document.getElementById("floorPlanBlob" + galleryFloorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            break;
        case "animation":
            if (direction == "left") {
                //if slider is already at top then don't do anything just let them click - there should be no hover anyway.
                if (galleryAnimationSliderPos < 1) {
                    galleryAnimationSliderPos = galleryAnimationSliderPos;
                }
                //take it up one slab.
                else if (galleryAnimationSliderPos > 0) {
                    document.getElementById("animationBlob" + galleryAnimationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    galleryAnimationSliderPos--;
                    document.getElementById("animationBlob" + galleryAnimationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            else if (direction == "right") {
                //if slider is at bottom then don't do anything - there should be no hover.
                if (galleryAnimationSliderPos == count) {
                    galleryAnimationSliderPos == galleryAnimationSliderPos;
                }
                else if (galleryAnimationSliderPos < count - 1) {
                    document.getElementById("animationBlob" + galleryAnimationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    galleryAnimationSliderPos++;
                    document.getElementById("animationBlob" + galleryAnimationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            break;
        case "video":
            if (direction == "left") {
                //if slider is already at top then don't do anything just let them click - there should be no hover anyway.
                if (galleryVideoSliderPos < 1) {
                    galleryVideoSliderPos = galleryVideoSliderPos;
                }
                //take it up one slab.
                else if (galleryVideoSliderPos > 0) {
                    document.getElementById("videoBlob" + galleryVideoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    galleryVideoSliderPos--;
                    document.getElementById("videoBlob" + galleryVideoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            else if (direction == "right") {
                //if slider is at bottom then don't do anything - there should be no hover.
            if (galleryVideoSliderPos == count) {
                    galleryVideoSliderPos == galleryVideoSliderPos;
                }
                else if (galleryVideoSliderPos < count - 1) {
                    document.getElementById("videoBlob" + galleryVideoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    galleryVideoSliderPos++;
                    document.getElementById("videoBlob" + galleryVideoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            break;
    }
}

function SetSliderPos(slider, count, direction) {

    switch (slider) {
        case "photo":
            if (direction == "up") {
                //if slider is already at top then don't do anything just let them click - there should be no hover anyway.
                if (photoSliderPos < 1) {
                    photoSliderPos = photoSliderPos;
                }
                //take it up one slab.
                else if (photoSliderPos > 0) {
                    document.getElementById("photoBlob" + photoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    photoSliderPos--;
                    document.getElementById("photoBlob" + photoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            else if (direction == "down") {
                //if slider is at bottom then don't do anything - there should be no hover.
                if (photoSliderPos == count) {
                    photoSliderPos == photoSliderPos;
                }
                else if (photoSliderPos < count - 1) {
                    document.getElementById("photoBlob" + photoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                    photoSliderPos++;
                    document.getElementById("photoBlob" + photoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            break;
        case "floorPlan":
            if (direction == "up") {
                //if slider is already at top then don't do anything just let them click - there should be no hover anyway.
                if (floorPlanSliderPos < 1) {
                    floorPlanSliderPos = floorPlanSliderPos;
                }
                //take it up one slab.
                else if (floorPlanSliderPos > 0) {
                document.getElementById("floorPlanBlob" + floorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                floorPlanSliderPos--;
                document.getElementById("floorPlanBlob" + floorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            else if (direction == "down") {
                //if slider is at bottom then don't do anything - there should be no hover.
            if (floorPlanSliderPos == count) {
                floorPlanSliderPos == floorPlanSliderPos;
                }
                else if (floorPlanSliderPos < count -1) {
                document.getElementById("floorPlanBlob" + floorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                floorPlanSliderPos++;
                document.getElementById("floorPlanBlob" + floorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            break;
        case "animation":
            if (direction == "up") {
                //if slider is already at top then don't do anything just let them click - there should be no hover anyway.
                if (animationSliderPos < 1) {
                    animationSliderPos = animationSliderPos;
                }
                //take it up one slab.
                else if (animationSliderPos > 0) {
                document.getElementById("animationBlob" + animationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                animationSliderPos--;
                document.getElementById("animationBlob" + animationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            else if (direction == "down") {
                //if slider is at bottom then don't do anything - there should be no hover.
            if (animationSliderPos == count) {
                animationSliderPos == animationSliderPos;
                }
                else if (animationSliderPos < count - 1) {
                document.getElementById("animationBlob" + animationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                animationSliderPos++;
                document.getElementById("animationBlob" + animationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            break;
        case "video":
            if (direction == "up") {
                //if slider is already at top then don't do anything just let them click - there should be no hover anyway.
                if (videoSliderPos < 1) {
                    videoSliderPos = videoSliderPos;
                }
                //take it up one slab.
                else if (videoSliderPos > 0) {
                document.getElementById("videoBlob" + videoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                videoSliderPos--;
                document.getElementById("videoBlob" + videoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            else if (direction == "down") {
                //if slider is at bottom then don't do anything - there should be no hover.
            if (videoSliderPos == count) {
                videoSliderPos == videoSliderPos;
                }
                else if (videoSliderPos < count - 1) {
                document.getElementById("videoBlob" + videoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
                videoSliderPos++;
                document.getElementById("videoBlob" + videoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
                }
            }
            break;
    }
}

function LoadSlab(slider, slab) {
    switch (slider) {
        case "photo":
            document.getElementById("photoBlob" + photoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
            var difference = slab - photoSliderPos;
            var divToScroll = "DivPhotosSlider";
            photoSliderPos = slab;
            document.getElementById("photoBlob" + photoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
            if (difference < 0) {
                difference = Math.abs(difference) * 350;
                MoveSliderUpWithSlab(divToScroll, difference);
            }
            else {
                difference = difference * 350;
                MoveSliderDownWithSlab(divToScroll, difference);
            }
            break;
        case "floorPlan":
            document.getElementById("floorPlanBlob" + floorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
            var difference = slab - floorPlanSliderPos;
            var divToScroll = "DivFloorPlansSlider";
            floorPlanSliderPos = slab;
            document.getElementById("floorPlanBlob" + floorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
            if (difference < 0) {
                difference = Math.abs(difference) * 350;
                MoveSliderUpWithSlab(divToScroll, difference);
            }
            else {
                difference = difference * 350;
                MoveSliderDownWithSlab(divToScroll, difference);
            }
            break;
        case "animation":
            document.getElementById("animationBlob" + animationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
            var difference = slab - animationSliderPos;
            var divToScroll = "DivAnimationsSliders";
            animationSliderPos = slab;
            document.getElementById("animationBlob" + animationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
            if (difference < 0) {
                difference = Math.abs(difference) * 350;
                MoveSliderUpWithSlab(divToScroll, difference);
            }
            else {
                difference = difference * 350;
                MoveSliderDownWithSlab(divToScroll, difference);
            }
            break;
        case "video":
            document.getElementById("videoBlob" + videoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
            var difference = slab - videoSliderPos;
            var divToScroll = "DivVideosSlider";
            videoSliderPos = slab;
            document.getElementById("videoBlob" + videoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
            if (difference < 0) {
                difference = Math.abs(difference) * 350;
                MoveSliderUpWithSlab(divToScroll, difference);
            }
            else {
                difference = difference * 350;
                MoveSliderDownWithSlab(divToScroll, difference);
            }
            break;
    }
}

function LoadGallerySlab(slider, slab) {
    switch (slider) {
        case "photo":
            document.getElementById("photoBlob" + galleryPhotoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
            var difference = slab - galleryPhotoSliderPos;
            var divToScroll = "GalleryDivPhotos";
            galleryPhotoSliderPos = slab;
            document.getElementById("photoBlob" + galleryPhotoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
            if (difference < 0) {
                difference = Math.abs(difference) * 881;
                MoveSliderLeftWithSlab(divToScroll, difference);
            }
            else {
                difference = difference * 881;
                MoveSliderRightWithSlab(divToScroll, difference);
            }
            break;
        case "floorPlan":
            document.getElementById("floorPlanBlob" + galleryFloorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
            var difference = slab - galleryFloorPlanSliderPos;
            var divToScroll = "GalleryFloorPlansDiv";
            galleryFloorPlanSliderPos = slab;
            document.getElementById("floorPlanBlob" + galleryFloorPlanSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
            if (difference < 0) {
                difference = Math.abs(difference) * 881;
                MoveSliderLeftWithSlab(divToScroll, difference);
            }
            else {
                difference = difference * 881;
                MoveSliderRightWithSlab(divToScroll, difference);
            }
            break;
        case "animation":
            document.getElementById("animationBlob" + galleryAnimationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
            var difference = slab - galleryAnimationSliderPos;
            var divToScroll = "GalleryAnimationsDiv";
            galleryAnimationSliderPos = slab;
            document.getElementById("animationBlob" + galleryAnimationSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
            if (difference < 0) {
                difference = Math.abs(difference) * 881;
                MoveSliderLeftWithSlab(divToScroll, difference);
            }
            else {
                difference = difference * 881;
                MoveSliderRightWithSlab(divToScroll, difference);
            }
            break;
        case "video":
            document.getElementById("videoBlob" + galleryVideoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-low.gif";
            var difference = slab - galleryVideoSliderPos;
            var divToScroll = "GalleryVideosDiv";
            galleryVideoSliderPos = slab;
            document.getElementById("videoBlob" + galleryVideoSliderPos.toString()).src = "App_Themes/Images/Master/thumbnail-page-blob-high.gif";
            if (difference < 0) {
                difference = Math.abs(difference) * 881;
                MoveSliderLeftWithSlab(divToScroll, difference);
            }
            else {
                difference = difference * 881;
                MoveSliderRightWithSlab(divToScroll, difference);
            }
            break;
    }
}
