function toggleContentDiv(img, divName, collapseGif, expandGif, hiddenName)
{
    var div = document.getElementById(divName);
    var hidden = document.getElementById(hiddenName);
    if(div.style.display == "none")
    {
        div.style.display = "block";
        img.src = expandGif;
        img.alt = "Collapse";
        hidden.value = "";
    }
    else
    {
        div.style.display = "none";
        img.src = collapseGif;
        img.alt = "Expand";
        hidden.value = "collapsed";
    }
}

function toggleSeeMore(linkLeftName, linkRightName, ctlName, hiddenName, linkColor)
{
    var linkLeft = document.getElementById(linkLeftName);
    var linkRight = document.getElementById(linkRightName);
    var ctl = document.getElementById(ctlName);
    var hidden = document.getElementById(hiddenName);
    if(ctl.style.display == "none")
    {
        ctl.style.display = "block";
        hidden.value = "";
        fontBlock = document.createElement('font');
        fontBlock.setAttribute('color', linkColor);
        fontBlock.appendChild(document.createTextNode('< '));
        textBlock = document.createTextNode('Less');
        while(linkLeft.hasChildNodes()) linkLeft.removeChild(linkLeft.childNodes[0]);
        while(linkRight.hasChildNodes()) linkRight.removeChild(linkRight.childNodes[0]);
        linkRight.appendChild(fontBlock);
        linkLeft.appendChild(textBlock);
    }
    else
    {
        ctl.style.display = "none";
        hidden.value = "showmore";
        fontBlock = document.createElement('font');
        fontBlock.setAttribute('color', '#0099ff');
        fontBlock.appendChild(document.createTextNode(' >'));
        textBlock = document.createTextNode('More');
        while(linkLeft.hasChildNodes()) linkLeft.removeChild(linkLeft.childNodes[0]);
        while(linkRight.hasChildNodes()) linkRight.removeChild(linkRight.childNodes[0]);
        linkLeft.appendChild(fontBlock);
        linkRight.appendChild(textBlock);
    }
}

function toggleSeeMoreImage(linkLeftName, linkRightName,  ctlName, hiddenName, seeMoreImgUrl, seeLessImgUrl)
{
    var linkLeft = document.getElementById(linkLeftName);
    var linkRight = document.getElementById(linkRightName);
    var ctl = document.getElementById(ctlName);
    var hidden = document.getElementById(hiddenName);
    if(ctl.style.display == "none")
    {
        ctl.style.display = "block";
        hidden.value = "";
        var newimg = document.createElement('img');
        newimg.src = seeLessImgUrl;
        newimg.alt = 'Less';
        textBlock = document.createTextNode('Less');
        while(linkLeft.hasChildNodes()) linkLeft.removeChild(linkLeft.childNodes[0]);
        while(linkRight.hasChildNodes()) linkRight.removeChild(linkRight.childNodes[0]);
        linkLeft.appendChild(textBlock);
        linkRight.appendChild(newimg);
    }
    else
    {
        ctl.style.display = "none";
        hidden.value = "showmore";
        var newimg = document.createElement('img');
        newimg.src = seeMoreImgUrl;
        newimg.alt = 'More';
        textBlock = document.createTextNode('More');
        while(linkLeft.hasChildNodes()) linkLeft.removeChild(linkLeft.childNodes[0]);
        while(linkRight.hasChildNodes()) linkRight.removeChild(linkRight.childNodes[0]);
        linkLeft.appendChild(textBlock);
        linkRight.appendChild(newimg);
    }
}
