// XWindow

function xWindow(name, w, h, x, y, loc, men, res, scr, sta, too)
{
  var e='',c=',',xf='left=',yf='top='; this.n = name;
  if (document.layers) {xf='screenX='; yf='screenY=';}
  this.f = (w?'width='+w+c:e)+(h?'height='+h+c:e)+(x>=0?xf+x+c:e)+
    (y>=0?yf+y+c:e)+'location='+loc+',menubar='+men+',resizable='+res+
    ',scrollbars='+scr+',status='+sta+',toolbar='+too;
  this.opened = function() {return this.w && !this.w.closed;};
  this.close = function() {if(this.opened()) this.w.close();};
  this.focus = function() {if(this.opened()) this.w.focus();};
  this.load = function(sUrl) {
    if (this.opened()) this.w.location.href = sUrl;
    else this.w = window.open(sUrl,this.n,this.f);
    this.focus();
    return false;
  };
}

// Para fechar, usar um link com: onclick='winToys.close()' 
// Paara dar o focus,  usar um link com: onclick='winToys.focus()'

//  Definicoes das Janelas XWindow:  (name, w, h, x, y, loc, men, res, scr, sta, too) 

/*
<a target="ADMVisualizar"  href="view-entrevistas.php?idEntrevistas=<? echo $RsEditar['identrevistas']; ?>"  
onclick="return ADMVisualizar.load(this.href)"><b>Visualizar</b></a>
*/

// POPUPS ADM
var Livro = new xWindow('Livro',800,500,200,150,0,0,0,1,0,0);



