// Blank lines and comments stripped to reduce size.
// Contact contact@SpiritAndTruth.org for commented source files.
wlx.wlx_titleIndex = function( title )
    {
    index = -1
    if ( wlx.wlx_titleBooks != undefined )
        {
        for ( i = 0 ; i < wlx.wlx_titleBooks.length ; i++ )
            {
            if ( wlx.wlx_titleBooks[ i ] == title )
                {
                index = i
                break
                }
            }
        }
    return index
    }
wlx.wlx_titleBooks = undefined
wlx.wlx_titleRegister = function( title )
    {
    if ( undefined == wlx.wlx_titleBooks )
        {
        wlx.wlx_titleBooks = new Array()
        }
    if ( wlx.wlx_titleIndex( title ) == -1 )
        {
        wlx.wlx_titleBooks[ wlx.wlx_titleBooks.length ] = title
        }
    }
wlx.wlx_titleDisplay = function( myDoc, selectTitle, extraTitle )
    {
    wlx.wlx_titleBooks.sort()
    // DISABLED
    if ( 0 && undefined != selectTitle )
        {
        displayTitle = 'NASB Bible'
        if ( '(None)' == selectTitle || wlx.wlx_titleIndex( selectTitle ) != -1 )
            {
            displayTitle = selectTitle
            }
        myDoc.writeln( '<OPTION >' + displayTitle + '</OPTION>' )
        }
    for ( i = 0 ; i < wlx.wlx_titleBooks.length ; i++ )
        {
        // Filter out KJV in favor of KJV-Strongs.
        //if ( wlx.wlx_titleBooks[ i ] == 'KJV Bible' ) continue
        myDoc.writeln( '<OPTION >' + wlx.wlx_titleBooks[ i ] + '</OPTION>' )
        }
    if ( undefined != extraTitle )
        {
        if ( wlx.wlx_titleIndex( extraTitle ) == -1 )
            {
            myDoc.writeln( '<OPTION >' + extraTitle + '</OPTION>' )
            }
        }
    }

wlx.wlx_subtractPublicTitles = function( count )
    {
    // Subtract private bibles from count if present.
    if ( wlx.wlx_titlePresent( 'NKJV Bible' ) ) count -= 1
    if ( wlx.wlx_titlePresent( 'NET Bible' ) ) count -= 1
    return count
    }

wlx.wlx_titlePresent = function( title )
    {
    return -1 != wlx.wlx_titleIndex( title )
    }

wlx.wlx_titlesPublic = function( title )
    {
    var count = 0

    // How many titles are present?
    if ( wlx.wlx_titleBooks ) 
        {
        count = wlx.wlx_subtractPublicTitles( wlx.wlx_titleBooks.length )
        }

    // Returns count of public titles.
    return count

    }

wlx.wlx_titlesMaxPublic = function()
    {
    return wlx.wlx_subtractPublicTitles( 22 )
    }


