function checkRadio(strName) {
    var tabRadio = document.getElementsByName(strName);
    for (var index = 0; index < tabRadio.length; ++index) {
        var itemRadio = tabRadio[index];
        if (itemRadio.checked) {
            return 1
        }
    }
    return 0
}

function checkMultipleSelect(strPrefixeName, jsonSuffixe) {
    var nbSelected = 0;
    var nbSelect = 0;
    if (Object.isString(jsonSuffixe)) {
        jsonSuffixe = jsonSuffixe.evalJSON(true)
    }
    jsonSuffixe.each(function (strSuffixe, index) {
        var tabItems = document.getElementsByName(strPrefixeName + strSuffixe);
        if (tabItems[0].selectedIndex != 0) {
            ++nbSelected
        }++nbSelect
    });
    if (nbSelect == nbSelected) {
        return 1
    }
    return 0
}

function insertBefore(node, position) {
    position.parentNode.insertBefore(node, position)
}

function insertAfter(node, position) {
    if (position.nextSibling) {
        insertBefore(node, position.nextSibling)
    } else {
        if (position.parentNode) {
            appendChild(node, position.parentNode)
        }
    }
}

function appendChild(node, position) {
    position.appendChild(node)
}

function appendChildFirst(node, position) {
    if (position.firstChild) {
        insertBefore(node, position.firstChild)
    } else {
        appendChild(node, position)
    }
}

function removeNode(node) {
    if (node && node.parentNode) {
        node.parentNode.removeChild(node);
    }
}

function killAllChildren(parrentNode) {
    while (parrentNode.hasChildNodes()) {
        parrentNode.removeChild(parrentNode.firstChild)
    }
}
