var illLargeCurrent = null;
var illLargeNew = null;
var illSmallCurrent = null;
var illSmallNew = null;

function showIllustration(illId) 
{
    illLargeNew = document.getElementById('ill-large-' + illId);
    if(illLargeNew != illLargeCurrent) 
    {
        if(illLargeCurrent) 
        {
            illLargeCurrent.style.display = 'none';
        }
        if(illLargeNew) 
        {
            illLargeNew.style.display = 'block';
            illLargeCurrent = illLargeNew;
			repositionBlock('ill-large-' + illId);
        }
    }
    
}

function closeIllustration(illId) 
{
    illLargeCurrent = document.getElementById('ill-large-' + illId);
    illLargeCurrent.style.display = 'none';
    illLargeCurrent = null;
}

function repositionBlock(div_id)
{
    doc_width = document.documentElement.clientWidth;
    doc_height = document.documentElement.clientHeight;
    div_width = document.getElementById(div_id).offsetWidth;
    div_height = document.getElementById(div_id).offsetHeight;
    
    div_left = (doc_width - div_width) / 2;

    var scrollTop = 0;
    if( typeof( window.pageYOffset ) == 'number' )
    {
        //Netscape compliant
        scrollTop = window.pageYOffset;
    }
    else if( document.body && document.body.scrollTop )
    {
        //DOM compliant
        scrollTop = document.body.scrollTop;
    }
    else if( document.documentElement && document.documentElement.scrollTop )
    {
        //IE6 standards compliant mode
        scrollTop = document.documentElement.scrollTop;
    }
    div_top = scrollTop + (doc_height - div_height) / 2;

    if(div_top < 0)
        div_top = 0;
    if(div_left < 0)
        div_left = 0;

    document.getElementById(div_id).style.left = div_left + 'px';
    document.getElementById(div_id).style.top = div_top + 'px';
}

