   
/* Copyright Eric King : http://www.ericking.us/ - &copy; 2000 - 2004
This script is free to use for any non profit website as long as this info is left in  */
function NewWindow(u,n,w,h,f,p,x,y) 
{
	var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,W=(w)?w:sw,H=(h)?h:sh,T=(p==C&&ws||!p)?(sh-H)/2:(p==R&&ws)?(m.floor(m.random()*(sh-H))):(p==M&&h!=sh)?y:0,L=(p==C&&ws||!p)?(sw-W)/2:(p==R&&ws)?(m.floor(m.random()*(sw-W))):(p==M&&w!=sw)?x:0,s='width='+W+',height='+H+',top='+T+',screeny='+T+',left='+L+',screenx='+L;s+=(!f||f=='')?'':','+f;
	var win=window.open((u)?u:'http://www.ericking.us/',(n)?n:'',s);
	if(win && !win.closed){win.focus();return win;}
	if(!win)document.location=u;
	return null;
}

function maxWindow()
{
  window.moveTo(0,0);
  if (document.all)
  {
    top.window.resizeTo(screen.availWidth,screen.availHeight);
  } 
  else if (document.layers||document.getElementById)
  {
    if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
    {
      top.window.outerHeight = screen.availHeight;
      top.window.outerWidth = screen.availWidth;
    }
  }
}
