﻿function ESGGetElement( id )
{
    var elem;

    if( document.getElementById ) // this is the way the standards work
        elem = document.getElementById( id );
    else if( document.all ) // this is the way old msie versions work
        elem = document.all[id];
    else if( document.layers ) // this is the way nn4 works
        elem = document.layers[id];

    return elem;
}

function ESGShowElement( id, onOff )
{
    var elem = ESGGetElement(id);
    elem.style.display = onOff ? 'block' : 'none';
}

function ESGHideAll(prefix, count)
{
    for( var i = 1; i <= count; i++ )
    	ESGShowElement( prefix + i);
}

function ESGShowOne(prefix, id, count)
{
    ESGHideAll(prefix, count);
    ESGShowElement(prefix + id, true);
}
