vcVideoFormat1 = "480x276"; vcVideoFormat2 = "320x188"; vcVideoFormat3 = "240x148"; function openVideoPopup(strVideoFile, strSize) { if (strSize.substring(0, 6) == 'format') { var iSize = strSize.substring(6); if (typeof eval("vcVideoFormat" + iSize) == 'undefined') { var iWidth = 600; var iHeight = 400; } else { var strFormat = eval("vcVideoFormat" + iSize); var iWidth = parseInt(strFormat.substring(0, strFormat.indexOf('x'))) + 40; var iHeight = parseInt(strFormat.substring(strFormat.indexOf('x')+1)) + 80; } } else { var strFormat = strSize; var iWidth = parseInt(strFormat.substring(0, strFormat.indexOf('x'))) + 40; var iHeight = parseInt(strFormat.substring(strFormat.indexOf('x')+1)) + 80; } var strWinName = "videoPlayerPopup"; var openWin = true; var strURL = "/scripts/popupvideoplayer.php?strVideoFile=" + escape(strVideoFile) + "&iSize=" + iSize; var popleft = (screen.width - iWidth) / 2; var poptop = (screen.height - iHeight) / 2; var strParameters = "width=" + iWidth + ",height=" + iHeight + ",resizable=1,scrollbars=1,status=0,left="+ popleft+",top="+poptop+",screenX="+popleft+ ",screenY="+poptop+",toolbar=0"; var videoPlayerWin = window.open(strURL, strWinName, strParameters); }