﻿
$(document).ready(function() {

    $("#showHide").attr("id", 'Template_showHide');
    $("#showText").attr("id", 'Template_showText');
    $("#showImages").attr("id", 'Template_showImages');
    $("#slidingContent").attr("id", 'Template_slidingContent');
    $("#slidingImage").attr("id", 'Template_slidingImage');

    ClickShowImage();

});

function SetupContentSlide() {
    $("#Template_showText a").click(
        function() {
            ToggleDisplay("Text", 1000);
            return false;
        });
    }
function ClickShowText() {

            ToggleDisplay("Text", 1000);
            return false;
        }
function ClickShowImage() {

            ToggleDisplay("Image", 1000);
            return false;
        }

function ToggleDisplay(displayType, duration) {

    if (displayType == "Text") {

        $("#Template_slidingImage").animate({ marginRight: "-510px" }, duration);
        $("#Template_showHide").animate({ left: "532px" }, duration, "", function() {

            $("#Template_slidingContent").css("display", "inline");

        });
        $("#Template_showText").hide();
        $("#Template_showImages").show();

    }
    else {

        $("#Template_slidingContent").fadeOut("slow", function() {
            $("#Template_slidingImage").animate({ marginRight: "0" }, duration, function() { if (imagesLength > 0) { $("#prevNext").fadeIn(); } });
            $("#Template_showHide").animate({ left: "22px" }, duration);
            $("#Template_showText").show();
            $("#Template_showImages").hide();
        });

        $("#Template_showText a").click(
        function() {
            ToggleDisplay("Text", 1000);
            return false;
        });

    }

}


