/*
 * file: vshared.js
 * date: wed 23 aug 15:41:55 2006
 * auth: two <two@tacc.at>
 */
var g_vimgwnd = 0;

function _vpop( n,w,h,url )
{
	var x = ((screen.width  - 25) - w) / 2;
	var y = ((screen.height - 34) - h) / 2;
	var win = window.open( url,n,
		'width='		+ w + ',' +
		'height='		+ h + ',' +
		'left='			+ x + ',' +
		'top='			+ y + ',' +
		'statusbar=0'   +     ',' +
		'status=0'      +     ',' +
		'resizable=0'	+	  ',' +
		'toolbar=0'		+     ',' +
		'scrollbars=0'	+     ',' +
		'location=0'	+     ',' +
		'dependant=1'	+     ',' +
		'menubar=0'
	);
	if (win && win.open && !win.closed)
	{
		win.opener = self;
		win.focus();
	}
	return win;
}
function _vimg( url,w,h,nojs )
{
	if (g_vimgwnd && g_vimgwnd.open)
	{
		g_vimgwnd.close();
		g_vimgwnd = 0;
	}
	var title = 'Image';
	var win = _vpop( 'vimage',w,h,'' );

	if (win && win.open && !win.closed)
	{
		win.document.write( '<html><head><title>'+title+'</title></head>' );
		win.document.write( '<body bgcolor="#000000" style="margin:0px;">' );
		if (!nojs) win.document.write( '<a href="javascript://">' );
		win.document.write( '<img width="'+w+'" height="'+h+'" src="'+url+'" border="0" ' );
		if (!nojs) {
			win.document.write( 'onclick="self.close();"></a>' );
		} else {
			win.document.write( '>' );
		}
		win.document.write( '</body></html>' );
		win.focus();
		g_vimgwnd = win;
	}
}
