function ExpandSection(SectionId)
{
    if(document.getElementById("section_"+SectionId).style.display == "none")
    {
        document.getElementById("section_"+SectionId).style.display ="";
        document.getElementById("section_"+SectionId).parentNode.style.display ="";
        var arr  = document.getElementById("section_"+SectionId).parentNode.id.split("_");
        document.getElementById("cbutton_"+ arr[1]).src ="http://i.investopedia.com/inv/articles/icons/openbook.gif";   
        document.getElementById("button_"+SectionId).src ="http://i.investopedia.com/inv/articles/icons/contract1.gif";
        document.getElementById("span_"+arr[1]).className = "SectionTitle";
		return;
    }
    if(document.getElementById("section_"+SectionId).style.display == "")
    {
    document.getElementById("section_"+SectionId).style.display ="none";
    document.getElementById("button_"+SectionId).src ="http://i.investopedia.com/inv/articles/icons/expandicon.gif";
    return;
    }   
}

function MinimizeAllSections(SectionId, ChapterSectionId)
{
    var MainTable = document.getElementById("chapterSection_"+ChapterSectionId).childNodes;
    for(i = 0; i < MainTable.length; i++)
        {
            if(MainTable.item(i).tagName == "DIV")
                if(MainTable.item(i).id != "section_" + SectionId && MainTable.item(i).id.indexOf("section_") != -1)
                    {
                        MainTable.item(i).style.display ="none";
                        var arr  = MainTable.item(i).id.split("_");
                        document.getElementById("button_"+arr[1]).src ="http://i.investopedia.com/inv/articles/icons/expandicon.gif";
                    }
        }
}

function BoldPageTitle(Link)
{
document.getElementById(Link).className = "pageBoldLink";
  
	
}


function ExpandChapter(id)
{
    if(document.getElementById("chapterSection_"+id).style.display == "none")
    {
    document.getElementById("chapterSection_"+id).style.display ="";
    document.getElementById("cbutton_"+id).src ="http://i.investopedia.com/inv/articles/icons/openbook.gif";
    document.getElementById("span_"+id).className = "SectionTitle";
    return;
    }
    if(document.getElementById("chapterSection_"+id).style.display == "")
    {
    document.getElementById("chapterSection_"+id).style.display ="none";
    document.getElementById("cbutton_"+id).src ="http://i.investopedia.com/inv/articles/icons/bookicon.gif";
    document.getElementById("span_"+id).className = "";
    return;
    }   
}


function MinimizeAllChapterSections(id)
{
    var MainTable = document.getElementById("mainTable").childNodes;
    for(i = 0; i < MainTable.length; i++)
        {
            if(MainTable.item(i).tagName == "DIV")
                if(MainTable.item(i).id != "chapterSection_" + id && MainTable.item(i).id.indexOf("chapterSection_") != -1)
                    {
                        MainTable.item(i).style.display ="none";
                        var arr  = MainTable.item(i).id.split("_");
                        document.getElementById("cbutton_"+arr[1]).src ="http://i.investopedia.com/inv/articles/icons/bookicon.gif";
                        document.getElementById("span_"+arr[1]).className = "";
                    }
        }
}