/* Function that adds an element to the iconmenu list,
   Creator:  th[eZ] and yj[eZ]
*/

function addListItem( listID, type )
{
    var ulItem = document.getElementById( listID );
    var newLi = document.createElement( 'li' );
    var newA = document.createElement( 'a' );
    var newSpan = document.createElement( 'span' );
    newSpan.className = 'hide';
    var newText = '';
    if ( type == 'print' )
    {
        newText = document.createTextNode( 'Print' );
        newA.setAttribute( 'title', 'Skriv ud' );
        newA.setAttribute( 'href', 'javascript:window.print()' );
        newLi.className = 'print';
    }
    if ( type == 'largertext' )
    {
        newText = document.createTextNode( 'Larger text' );
        newA.setAttribute( 'title', 'Større tekst' );
        newA.setAttribute( 'href', 'javascript:fontResize( +1 )' );
        newLi.className = 'largertext';
    }
    if ( type == 'smallertext' )
    {
        newText = document.createTextNode( 'Smaller text' );
        newA.setAttribute( 'title', 'Mindre tekst' );
        newA.setAttribute( 'href', 'javascript:fontResize( -1 )' );
        newLi.className = 'smallertext';
    }

    newLi.style.position = 'relative';

    newSpan.appendChild( newText );
    newA.appendChild( newSpan );
    newLi.appendChild( newA );
    ulItem.appendChild( newLi );
}

