var WindowObjectReference; function launchDemo(demo) { if(WindowObjectReference == null || WindowObjectReference.closed) { var w = 880; var h = 685; var wleft = (screen.width - w) / 2; var wtop = (screen.height - h - 95) / 2; if (wleft < 0) wleft = 0; if (wtop < 0) wtop = 0; var url = "http://epmconnect.vlabcenter.com/launchdemo.aspx?demo="+demo+"&w="+screen.width; WindowObjectReference = window.open(url, "vlabCenterConsole", "height="+h+",width="+w+",left="+wleft+",top="+wtop+",scrollbars=yes,status=1,resizable=1",true); } else { WindowObjectReference.focus(); } }