function getServer() {
    var href = document.location.href;

    if( href.indexOf( "http" ) == 0 ) {
        return href.substring( 0, href.indexOf( "/", 7 ) + 1 );
    }
}

function viewPicture( url, caption ) {
    var win = launchWindow( "", 370, ( ( arguments.length > 2 ) ? arguments[ 2 ] : 370 ) );
    var d = win.document;
    var b = d.getElementsByTagName( "body" ).item( 0 );
    var h = d.getElementsByTagName( "head" ).item( 0 );
    var p = d.createElement( "p" );
    var a = d.createElement( "a" );
    var i = d.createElement( "img" );
    var l = d.createElement( "link" );

    l.setAttribute( "type", "text/css" );
    l.setAttribute( "rel", "stylesheet" );
    l.setAttribute( "href", getServer() + "LookinOut/css/lookinout.css" );
    h.appendChild( l );

    i.setAttribute( "src", getServer() + url );
    i.setAttribute( "alt", caption );
    b.appendChild( i );

    p.appendChild( d.createTextNode( caption ) );
    b.appendChild( p );

    a.setAttribute( "href", "javascript:window.close()" );
    a.appendChild( d.createTextNode( "close" ) );

    p = d.createElement( "p" );
    p.style.textAlign = "right";
    p.appendChild( d.createTextNode( "[ " ) );
    p.appendChild( a );
    p.appendChild( d.createTextNode( " ]" ) );
    b.appendChild( p );
}
