
document.getById = function(strId) {
    if (document.getElementById)
        return document.getElementById(strId);
    else if (document.all)
        return document.all[strId];
    else if (document[strId])
        return document[strId];
    else if (document.layers && document.layers[strId])
        return document.layers[strId];
}

if (String && String.prototype) {
    String.prototype.trim = function() {
        return this.replace(/^\s+|\s+$/g, "");
    }
}

function showSection(section_id) {
    var obSect = document.getById(section_id);
    if (obSect && !obSect.isShown) {
        obSect.style.display = 'block';
        obSect.isShown = true;
    }
    else {
        obSect.style.display = 'none';
        obSect.isShown = false;
    }
}

function setTitleImage(strImg) {
    var ob_ttl_div = document.getById("title_place");
    var ob_ttl     = document.getById("page_ttl");
    if (ob_ttl) {
        ob_ttl.src = strImg;
        ob_ttl_div.style.visibility = "visible";
    }
}

function swapImage(imgObj, strImg) {
    imgObj.old = imgObj.src;
    imgObj.src = strImg;
}

function restoreImage(imgObj) {
    imgObj.src = imgObj.old;
}

