﻿
    function popup (t,n,w,h,x,y)
    {
	    var p,q,n,x,y,w,h
		
	    w = w ? w : 400
	    h = h ? h : 200
	    x = x ? x : window.screen.width/2 - w/2
	    y = y ? y : window.screen.height/2 - h/2
		
	    if (self.p == null)
	    {
		    self.p = window.open (t,n,'scrollbars=no,location=no,status=yes,menubar=0,directories=no,top=' + y + ',left=' + x + ',width=' + w + ',height=' + h + ',titlebar=no')
		    self.p.focus ()
	    }
	    else
	    {
		    self.p.close ()
		    self.p = null
		    popup (t,n,w,h,x,y)
	    }
    }
	
    function closePopup ()
    {
	    if (self.p) self.p.close()
    }