/*
  main.js
  include file for steinecker.info website
  Author: TheGismo
  Copyright (c)2005 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="Steinecker_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 between screen boundaries
  if (w < 100) w=100;if (w > screen.width) w=screen.width
  if (h < 100) h=100;if (h > screen.height) h=screen.height
  t=(screen.height-h)/2
  l=(screen.width-w)/2
  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()
}
