function popup(url, w, h, name) {

screenw = screen.availWidth;
screenh = screen.availHeight;

if ((w == "") || (w == null)) {
// change the width and height of popup here, if those arguments are left out
if (name == "Chat") {
w = 735;
h = 500;
} else if (name == "Live") {
w = 782;
h = 500;
 }
}

var leftPos = (screenw-w)/2, topPos = (screenh-h)/2;
var params = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + w + ",height=" + h + ",top=" + topPos + ",left=" + leftPos;
//var params = "toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=" + w + ",height=" + h + ",top=" + topPos + ",left=" + leftPos;
newWindow=window.open(url,name, params);
if (newWindow.opener == null) newWindow.opener = self;
newWindow.focus();
}
