﻿function showHideElement(elementId, action) {
    var oElement = document.getElementById(elementId);

    if (oElement) {
        if (action == 'show') {
            oElement.style.display = '';
        } else if (action == 'hide') {
            oElement.style.display = 'none';
        } else if (action == 'toggle') {
            if (oElement.style.display == '') {
                oElement.style.display = 'none';
            } else {
                oElement.style.display = '';
            }
        }

        return oElement;
    }
}



function showHideExpandIcon(elementId, iconId, action, root) {
    var oElement = showHideElement(elementId, action);
    var oIcon = document.getElementById(iconId);

    //If element is not showing, change plus/minus to "plus"
    if (oElement.style.display == 'none') {
        oIcon.src = root + 'images/arrow-right.gif';
    } else {
        oIcon.src = root + 'images/arrow-down.gif';
    }
}


function showElement(elementID) {
    var oElement = document.getElementById(elementID);
    oElement.style.display = '';
}

function hideElement(elementID) {
    var oElement = document.getElementById(elementID);
    oElement.style.display = 'none';
}
