
function popPreview( img, w, h ) {
		 window.open(  img, "preview", "width=" + (w + 20) + ",height=" + (h + 25)  + ",status=no,menubar=no,top=50,screenY=50,left=50,screenX=50" );
}
function openAppWindow(name, shortLink)
{
	var url = "";
	var width = 1024;
	var height = 560;  // set to -1 to get maximum height on screen
	var replaceOption = false;
	if( typeof openAppWindow.winRefs == 'undefined' )  //thanks Peter Bailey and stackoverflow.com
	{
		openAppWindow.winRefs = {};
	}
	if ( typeof openAppWindow.winRefs[name] == 'undefined' || openAppWindow.winRefs[name].closed )
	{
		if( shortLink.indexOf('/') > 0 ) { url = shortLink; }
		else { url = "/redirect/" + shortLink; }
		//popapp_custwidth( name, url, 1024, true );
		if( height < 0 )
		{
			var h = Math.round( screen.height - (screen.height * 0.15) );
		}
		else
		{
			var h = height;
		}
		var x = Math.round( (screen.width - width) / 2 );
		var y = Math.round( (screen.height - h) / 4 );
		var winOptions = "width=" + width + ",height=" + h + ",top=" + y + ",left=" + x+ ",scrollbars=yes,menu=no,toolbar=no,status=yes,resizable=yes";
		if(window.location.toString().indexOf("/wb/") > 0) {
			url = "/wb" + url;
		}
		openAppWindow.winRefs[name] = window.open(url, name, winOptions, replaceOption);
	}
	else
	{
		openAppWindow.winRefs[name].focus();
	}
	return false;
}
function openConditions() { window.open( "/internet/clubmarine.nsf/File?Open&v=docs&s=ConditionsApply-Common", "", "width=490,height=310,menu=no,left=50,top=50" ); }

