/* 
===============================================================
Launch Centred Popup Window
===============================================================
AUTHOR			: Christian Wach <needle@haystack.co.uk>
LAST MODIFIED	: 28/08/2005
---------------------------------------------------------------
NOTES
=====

Implemented for Help Links

---------------------------------------------------------------
USAGE
=====

<script type="text/javascript" src="js/popup.js" language="javascript"></script>

<a href="test.html" target="mywindow" onclick="javascript:popup('test.html','mywindow','300','200');">link</a>

===============================================================
*/



var newwin;



function popup( win_url, win_name, win_width, win_height ) {
	
	// Configure Window
	screen_width = screen.width;
	screen_height = screen.height;
	
	
	left_margin = (screen_width - win_width)/2;
	top_margin = (screen_height - win_height)/2;
	
	// define window
	window_props = "scrollbars=yes,menubars=no,toolbars=no,resizable=yes,left=" + left_margin + ",top=" + top_margin + ",width=" + win_width + ",height=" + win_height;

	// open it
	newwin = window.open(win_url, win_name, window_props);
	
	// give it time to draw
	setTimeout('newwin.focus();', 250);
	
	return false;
	
}

