
function initExpandedImg(imgObj) {
    var expandedImgId = imgObj.id + "Exp";
    var expandedImgOutId = imgObj.id + "ExpOut";

    imgObj.expandedImgId = expandedImgId;
    imgObj.expandedImgOutId = expandedImgOutId;

    $(expandedImgId).alternativeImg = $(expandedImgOutId);
    $(expandedImgOutId).alternativeImg = $(expandedImgId);

    $(expandedImgId).expandedImgId = expandedImgId;
    $(expandedImgOutId).expandedImgId = expandedImgId;

    $(expandedImgId).expandedImgOutId = expandedImgOutId;
    $(expandedImgOutId).expandedImgOutId = expandedImgOutId;

    $(expandedImgId).imgObjId = imgObj.id;
    $(expandedImgOutId).imgObjId = imgObj.id;

    $(expandedImgId).endImage = imgObj; // only out image returns to end
    $(expandedImgOutId).endImage = imgObj; // only out image returns to end
}

function changeImgToExpanded(imgObj) {
    hideHideShow(imgObj.id, imgObj.expandedImgOutId, imgObj.expandedImgId)
}

function changeImgToExpandedOut(expandedImgObj){
    hideHideShow(expandedImgObj.id, expandedImgObj.endImage.id, expandedImgObj.expandedImgOutId);
}


function hideHideShow(hideId1,hideId2,  showId) {
    hideImg(hideId1);
    hideImg(hideId2);
    showImg(showId);
}
function hideShow(hideId, showId) {
    hideImg(hideId);
    showImg(showId);
}

function showImg(id) {
    $(id).style.display = "";

}

function hideImg(id) {
    $(id).style.display = "none";
}


