/*
  gospel.js
  include file for gospelsingers.at website
  Author: TheGismo
  Copyright (c)2004 by OmanBros.com. All rights reserved.

  Contents:
	function DoOpenExtWin
*/

/* -------------------------------------------------------------------
  function DoOpenExtWin

  Opens a popup window in the center of the screen in w x h resolution
  and inserts a document from an url.
  w represents the first parameter (width)
  h represents the second parameter (height)
  n represents the third parameter (name of the window)
  s represents the fourth parameter (scrollbar+resizeable yes/no)
*/
function DoOpenExtWin(anurl) {
var ns4=(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==4)
var w=500,h=500,s='no'
var n="Gospel_ExternalWindow",args=DoOpenExtWin.arguments,argslen=args.length
  if (argslen > 1) {w = args[1]}
  if (argslen > 2) {h = args[2]}
  if (argslen > 3) {n = args[3]}
  if (argslen > 4) {s = args[4]}
  // we check that coordinates are in screen boundaries
  if (w > screen.width) w=screen.width
  if (h > screen.height) h=screen.height
  t=(screen.height-h)/2
  if (t < 0) {h=screen.height; t=0}
  l=(screen.width-w)/2
  if (l < 0) {w=screen.width; l=0}
  newwin=window.open(
    anurl,
    n,
    'height='+h+',width='+w+','+
    'toolbar=no,'+
    'location=no,'+
    'directories=no,'+
    'status=no,'+
    'menubar=no,'+
    'scrollbars='+s+','+ 
    'resizable='+s+','+
    'copyhistory=no,'+
    'top='+t+',left='+l
  )
  newwin.focus()
}
