function showBild( bild, title )
    {
    if( String( parseInt( bild ) ) == bild )
        $('bildView').innerHTML = '<img id="image" border="0" src="media/?id='+bild+'&amp;size=max" alt="'+title+'" onclick="doHide()" onload="moveBild()">';
    else
        $('bildView').innerHTML = '<img id="image" border="0" src="'+bild+'" alt="'+title+'" onclick="doHide()" onload="moveBild()">';
    $('bildView').setStyle({ 'display': 'block' });
    $('opacity').setStyle({  'display': 'block',  opacity: 0.8 });
    }

function moveBild()
    {
    $img_height = 600;
    if( $('image').getDimensions().height > 0 )
        $img_height = $('image').getDimensions().height;

    $img_width = 600;
    if( $('image').getDimensions().width > 0 )
        $img_width = $('image').getDimensions().width;

    //alert( $img_height+', '+$img_width );

    document.getElementById('image').style.top  = (
        document.viewport.getScrollOffsets().top
        + document.viewport.getHeight() / 2
        - $img_height / 2
        ) + "px";
    document.getElementById('image').style.left = (
        document.viewport.getScrollOffsets().left
        + document.viewport.getWidth() / 2
        - $img_width / 2
        ) + "px";
    }

function doHide()
    {
    $('bildView').setStyle({ 'display': 'none' });
    $('opacity').setStyle({  'display': 'none'  });
    }


