/**
 * Get an element via it's ID
 *
 * @param string The ID of the element you want to fetch
 *
 * @return Returns null on error, and the element object with success
 */
function getObj(id)
{
    var obj = null;

    if(document.getElementById)
        obj = document.getElementById(id);
    else if(document.all)
        obj = document.all[id];
    else if(document.layers)
        obj = document.layers[id];

    return obj;
}





/**
 * Turn off the displaying of an element (hide it)
 *
 * @param object Element to hide
 */
function displayOff(elm)
{
    elm.style.display = 'none';
}





/**
 * Turn on the displaying of an element (show it)
 *
 * @param object Element to show
 */
function displayOn(elm)
{
    elm.style.display = '';
}





/**
 * Toggle between showing more or less of the post
 *
 * @param integer   The post number on the page (used with ID's)
 * @param string    The action to do; 'more' or 'less', defaults to 'more'.
 *
 * @return True on success, false on failure
 */
function moreLessPost(link_num, action)
{
    var moreLink    = getObj('more_link_' + link_num);
    var moreContent = getObj('more_content_' + link_num);

    if(!moreLink || !moreContent)
        return false;

    if(!action || action == 'more')
    {
        displayOff(moreLink);
        displayOn(moreContent);
    }

    else
    {
        displayOn(moreLink);
        displayOff(moreContent);
    }

    return true;
}// JavaScript Document

