var bIsIE =( window.ActiveXObject != null );

function ShowDialog( iDialog, strParam )
{
	var strURL = '';
	var iWidth = 0;
	var iHeight = 0;
	switch( iDialog )
	{
		case 7:
			strURL = './dlg_memberselect.php';
			iWidth = 340;
			iHeight = 520;
			break;
			
		case 6:
			strURL = './gallery_show.html';
			iWidth = 600;
			iHeight = 475;
			break;
			
		case 5:
			strURL = './dlg_clubselect.php';
			iWidth = 340;
			iHeight = 300;
			break;
			
		case 4:
			strURL = './dlg_member_search.php';
			iWidth = 500;
			iHeight = 322;
			break;
			
		case 3:
			strURL = './dlg_kondolenz.php';
			iWidth = 400;
			iHeight = 300;
			break;
			
		case 2:
			strURL = './dlg_upload.php';
			iWidth = 400;
			iHeight = 190;
			break;
			
		case 1:
		default:
			strURL = './dlg_pwd.php';
			iWidth = 400;
			iHeight = 190;
			break;
	}
	
	if( strParam != '' )
	{
		strURL += '?' + strParam;
	}
	
	var iWndHeight = -1;
	var iWndWidth = -1;
	if( window.innerHeight )
	{
		// FF knows document.body.offsetHeight -> but correctly the result is height of real body and not available window...
		iWndHeight = window.innerHeight;
		iWndWidth = window.innerWidth;
	}
	else if( document.body && document.body.offsetHeight )
	{
		// IE don't know window.innerHeight
		iWndHeight = document.body.offsetHeight - 4;
		iWndWidth = document.body.offsetWidth - 4;
	}
	
	if( iWndHeight < 0 || iWndWidth < 0 )
	{
		return false;
	}
	
	var strOpacity = '		opacity: 0.5;  ';
	if( bIsIE )
	{
		// OK, we're running in IE :-(
		strOpacity = '		filter:alpha(opacity=50);  ';
	}
	
	var iLeft = ( iWndWidth - iWidth	) / 2;
	var iTop = ( iWndHeight - iHeight	) / 2;
	if( strURL != '' && iWidth > 0 && iHeight > 0 )
	{
		var strBckGnd = '<div 	style="	border: 0pt none ; ' +
						'		margin: 0pt; ' +
						'		padding: 0pt;  ' +
						'		background-color: rgb(255, 255, 255);  ' +
						'		background-image: none;  ' +
						'		position: absolute;  ' +
						strOpacity +
						'		z-index: 11000;  ' +
						'		top: 0px; left: 0px; ' +
						'		width: ' + iWndWidth + 'px;  ' +
						'		height: ' + iWndHeight + 'px;"> ' +
						'</div> ';
						
		var strIFrame = '<iframe src="' + strURL + '" ' +
						'		style="	border: 1pt solid ; ' +
						'		margin: 0pt; ' +
						'		padding: 0pt; ' +
						'		background-color: transparent; ' +
						'		background-image: none; ' +
						'		position: absolute; ' +
						'		top: ' + iTop + 'px; ' +
						'		left: ' + iLeft + 'px; ' +
						'		width: ' + iWidth + 'px; ' +
						'		height: ' + iHeight + 'px; ' +
						'		z-index: 11001;" ' +
						'	frameborder="0">' +
						'</iframe>';
		
		var dlg = document.getElementById( 'dialog' );
		if( dlg != null )
		{
			// alert( 'Test' );
			dlg.innerHTML = strBckGnd + strIFrame;
		}
	}

	return false;
}
