function ShowItem(strID) {
    var strQuestionItem, strAnswerItem;

    if (document.getElementById || document.all) {
        strQuestionItem = "Question" + strID;
        strAnswerItem = "divA" + strID;
        if (document.getElementById) {
            if (document.getElementById(strAnswerItem).className == 'FAQAHide') {
                document.getElementById(strQuestionItem).className = 'FAQQuestionExp';
                document.getElementById(strAnswerItem).className   = 'FAQAShow';
            } else {
                document.getElementById(strQuestionItem).className = 'FAQQuestion';
                document.getElementById(strAnswerItem).className   = 'FAQAHide';
            }
        } else {
            if (document.all.strAnswerItem.style.display == '') {
                document.all.strQuestionItem.className   = 'FAQQuestion';
                document.all.strAnswerItem.style.display = 'none';
            } else {
                document.all.strQuestionItem.className = 'FAQQuestionExp';
                document.all.strAnswerItem.style.display = '';
            }
        }
    }
}

function ShowAll(show, hide) {
    var bShowAllFaqs, i, linkItem;
    var strQuestionItem, strAnswerItem;

    if (document.getElementById || document.all) {
        var totalItems = CountQuestions();
        if (totalItems == 0) {
            return;
        }

        if (document.getElementById) {
            linkItem = document.getElementById("ShowAllFaqLink").innerHTML;
            if (linkItem == show) {
                bShowAllFaqs = true;
                document.getElementById("ShowAllFaqLink").innerHTML = hide;
            } else {
                bShowAllFaqs  = false;
                document.getElementById("ShowAllFaqLink").innerHTML = show;
            }
        } else {
            linkItem = document.all.ShowAllFaqLink.innerHTML = linkItem;
            if (linkItem == show) {
                bShowAllFaqs = true;
                document.all.ShowAllFaqLink.innerHTML = hide;
            } else {
                bShowAllFaqs  = false;
                document.all.ShowAllFaqLink.innerHTML = show;
            }
        }

        for (i = 0; i < totalItems; i++) {
            strQuestionItem = "Question" + i;
            strAnswerItem = "divA" + i;
            if (document.getElementById) {
                if (bShowAllFaqs) {
                    document.getElementById(strQuestionItem).className = 'FAQQuestionExp';
                    document.getElementById(strAnswerItem).className = 'FAQAShow';
                } else {
                    document.getElementById(strQuestionItem).className = 'FAQQuestion';
                    document.getElementById(strAnswerItem).className = 'FAQAHide';
                }
            } else {
                if (bShowAllFaqs) {
                    document.all.strQuestionItem.className = 'FAQQuestionExp';
                    document.all.strAnswerItem.style.display = '';
                } else {
                    document.all.strQuestionItem.className = 'FAQQuestion';
                    document.all.strAnswerItem.style.display = 'none';
                }
            }
        }
    }
}

function CountQuestions() {
    var count = 0;
    var itemID = "Question" + count;
    if (document.getElementById || document.all) {
        if (document.getElementById) {
            while(document.getElementById(itemID)) {
                count++;
                itemID = "Question" + count;
            }
        } else {
            while(document.all.itemID) {
                count++;
                itemID = "Question" + count;
            }
        }
    }

    return count;
}

