/*
<b>PopoffWindow(windowName,windowWidth,windowHeight,URL,shouldResize,shouldScroll) </b>
written by Matt Pressnall 10/24/03

<b>What does it do?</b>
Pops off (or up) a window.  If the window has been called and resides in the background and someone calls it again, it brings the window to the forefront (which most popup code doesn't do).

<b>How do I use it?</b>
(call to JS file needs to be on a page only once)
&lt;script src="/js/standardFunctionality/PopoffWindow.js"&gt;&lt;/script&gt; 
&lt;a href="javascript:PopoffWindow('test',300,300,'http://www.pressnall.com','no','no')"&gt;text&lt;/a&gt;

<i>Parameters:</i>
windowName - the name of the window.  Alphabetic characters only!
windowWidth	
windowHeight
URL
shouldResize - yes|no
shouldScroll - yes|no
*/


function PopoffWindow(windowName,windowWidth,windowHeight,URL,shouldResize,shouldScroll) {
	var availableWidth = screen.availWidth;
   	var availableHeight = screen.availHeight;

   	var windowLeft = (availableWidth - windowWidth) / 2;
   	var windowTop = ((availableHeight - windowHeight) / 2) - 16;
   		
	newWindow = window.open(URL,windowName,"width=" + windowWidth + ",height=" + windowHeight + ",left=" + windowLeft + ",top=" + windowTop + ",location=no,resizable=" + shouldResize + ",scrollbars=" + shouldScroll + ",toolbar=no");
	newWindow.focus();
}
