/*
This function opens a window centrally with options
*/
function open_window(url, windowWidth, windowHeight, opts, name)
{
	// set the default options if none are given
	if (!opts) opts = "scrollbars=yes, menubar=yes, toolbar=yes, location=yes, status=yes, resizable=yes";
	
	// set default name if not given
	if (!name) name = "new_window";
	
	// create full options with central positioning
	full_options = 'width=' + windowWidth + ', height=' + windowHeight + ', top=' + ((screen.availHeight/2)-(windowHeight/2)) + ', left=' + ((screen.availWidth/2)-(windowWidth/2)) + ', ' + opts;
	
	// open the window
	var new_window = window.open(url, name, full_options);
	
	// make sure the window appears on top of other windows
	new_window.focus();
}
