// This is for opening pop-up windows in a way that addresses usability complaints. Use this instead of target="_blank" 
// It guarentees that pop-up windows will be smaller than the parent window in both dimensions- mharen 7/13/01

// example usage: <a href="javascript:new_window('/video/corporate/','620','420','chrome=yes');">link</a> - with chrome
//                         <a href="javascript:new_window('/video/corporate/','620','420');"> - without chrome
function new_window(page, width, height, chrome)
{
if (chrome == "chrome=yes") {chrome="yes"} else {chrome="no"}
var w = width, h = height, docw = width, doch = height;
if (document.all) {
// the following is only available after onLoad
// get current window size for ie
  docw = document.body.clientWidth;
  doch = document.body.clientHeight;
}
// get window size for Netscape
else if (document.layers) {
   docw = window.innerWidth;
   doch = window.innerHeight;
}
if (docw <= w) {
w = (docw - 40)
}
if (doch <= h) {
h = (doch - 40)
}
var leftPos = (screen.width / 2) - (w / 2);
var topPos = (screen.height / 2) - (h / 2);    
OpenWin = this.open(page,"CtrlWindow","top="+topPos+",screenX="+topPos+", left="+leftPos+", screenY="+leftPos+",width="+w+",height="+h+", toolbar="+chrome+",menubar="+chrome+",location="+chrome+",status="+chrome+",scrollbars=yes,resizable=yes,");
}