var popWidth = 600;
var popHeight = 350;
var popX = (screen.availWidth - popWidth) / 2;
var popY = (screen.availHeight - popHeight) / 2;
function newWin(vURL) {
	window.open(vURL,'_blank','width=' + popWidth + ',height=' + popHeight + ',resizable,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,screenX=' + popX + ',screenY=' + popY + ',left=' + popX + ',top=' + popY);
}

var picWindow = null;
function mediaWin(url, width, height) {
  var options = "scrollbars=no,menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,top=0,left=0,marginLeft=0,marginTop=0,margin=0";
  var name = "mediaWin";
  if ( ! width ) width = 640;
  if ( ! height ) height = 480;
  if (!picWindow || picWindow.closed ) {
	//options = options + ",top=" + window.screenTop;
	//options = options + ",left=" + window.screenLeft;	
    picWindow = window.open( url, name, "width=" + width + ",height=" + height + "," + options );
  } else {
    picWindow.close();
    picWindow = window.open( url, name, "width=" + width + ",height=" + height + "," + options );
    picWindow.location = url;
    picWindow.focus();
  }
}
