// popup
function wPop(u, n, w, h, l, t, f) {
var p = window.open(u, n, 'width='+w+',height='+h+',resizable,'+f);
if (!p.opener) p.opener = window;

// setup
p.resizeTo(w, h);
if (l && t && screen) {
if (l < 0) l += screen.availWidth - w;
if (t < 0) t += screen.availHeight - h;
p.moveTo(l, t);
}
p.focus();
return p;
}

// media window
function mPop(u, n, w, h, l, t) {
return wPop(u, n, w + 12, h + 31, l, t);
}
