function p6new_br ( purl , pwinname , pwintyp , pwinw , pwinh)
{
	/*
	Function p6new_br	Open a new browser window.

	Arguments:	purl     = URL to open. Required.

				pwinname = Name for window. Defaults to "_blank" which opens a new, unnamed window.

				pwintyp  = Type of window to open. Must be one of the following:

							f = Regular, fully functioning browser complete with toolbars etc.
							u = Regular, browser window without a URL text box. Such a windows
							    can be used to navigate only via embedded links.
							t = Resizable window with scrollbars but no toolbars, menu, or URL text box.
							    This is good for displaying a page that contains no links.
							x = Fixed size windows without toolbar, menu, or URL text box.
							    This is good for displaying a small amount of fixed text such as a
							    message, with maybe a close button, or a picture.

						   If the value given is invalid or blank, treat as f.

				pwinw    = Width of window in pixels. Defaults to 640.

				pwinh    = Height of window in pixels. Defaults to 480.

	Author:		David A. Gray of P6 Consulting

	Created:	07-08 February 2001

	Copyright 2001, P6 Consulting. All rights reserved worldwide.

	Modification history:

	Date	   Who What was done.
	---------- --- ----------------------------------------------------------------------------------------------------
	02/07/2001 DAG Created and tested original feature set.
	to 02/08

	*/

	// Declare variables.

	var fullwinopts ;
	var height ;
	var p6newwin ;
	var width ;
	var windowname ;
	var winpots ;

	// Set defaults for everything except the URL if values are not supplied in the argument list.

	// Window name.

	if ( pwinname == "" ) {
		windowname = "_blank" ;
	} else {
		windowname = pwinname ;
	}

	// Windows options for toolbars, menubars, a URL textbox, scrollbars, resize button.

	switch ( pwintyp ) {
		case "f" :
			winpots = "toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1" ;
			break ;
		case "u" :
			winpots = "toolbar=1,location=0,directories=1,status=1,menubar=1,scrollbars=1,resizable=1" ;
			break ;
		case "t" :
			winpots = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1" ;
			break ;
		case "x" :
			winpots = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0" ;
			break ;
		default :
			winpots = "toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1" ;
	}
	if ( pwinw == "" ) {
		width = "640" ;
	} else {
		width = pwinw ;
	}
	if ( pwinh == "" ) {
		height = "480" ;
	} else {
		height = pwinh
	}

	// Put it all togehter and open the window.

	fullwinopts = winpots + ",width=" + pwinw + ",height=" + pwinh ;
	p6newwin = window.open ( purl , windowname , fullwinopts ) ;
}

function p6closewin ( )
{
	/*
	Function p6closewin		Close the current window or a named window.

	Arguments:	None.

	Author:		David A. Gray of P6 Consulting

	Created:	07 February 2001

	Copyright 2001, P6 Consulting. All rights reserved worldwide.

	Modification history:

	Date	   Who What was done.
	---------- --- ----------------------------------------------------------------------------------------------------
	02/07/2001 DAG Created and tested original feature set.

	*/
	self.close() ;
}

function p6statusmsg ( pmsg )
{
	/*
	Function p6statusmsg		Display the status message in the window unless the message string is empty.

	Arguments:	pmsg	= Message text to display in status bar.

	Author:		David A. Gray of P6 Consulting

	Created:	12 April 1999

	Copyright 2001, P6 Consulting. All rights reserved worldwide.

	Modification history:

	Date	   Who What was done.
	---------- --- ----------------------------------------------------------------------------------------------------
	04/12/1999 DAG Create and test.
	04/18/2001 DAG Incorporate into p6winlib.js library of JavaScript code for window operations and format to be
	               consistent with other code in this module.
	04/18/2001 DAG Renam argument msg to pmsg to be consistent with our naming standards for JavsScript variables.
    08/18/2003 DAG Add explict return TRUE, per documentation of onMouseOver event as set forth with respect to JavaScript 1.1
	               at http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/handlers.html#1120822.
	*/
	if ( pmsg ) {
		window.status = pmsg ;
	} else {
		window.status = 'Move the mouse over a link.' ;
	}
	return true ;
}

function p6SetHash ( pwinname ,  purl , pHash )
{
	/*
	Function p6SetHash	Set the hash (anchor) property of a window.

	Arguments:	pwinname = Name for window. Defaults to "" which sets the anchor of the active window.

				purl	 = URL to set as window location, or null to set only the anchor.

				pHash	 = Name of anchor (hash) to set.



	Author:		David A. Gray of P6 Consulting

	Created:	30 April-01 May 2001

	Copyright 2001, P6 Consulting. All rights reserved worldwide.

	Modification history:

	Date	   Who What was done.
	---------- --- ----------------------------------------------------------------------------------------------------
	05/01/2001 DAG Created and tested original feature set.

	*/

	// Setting only the hash avoids reloading the document.

	if ( pwinname ) {
		if ( purl ) {
			pwinname.location.href = purl
		} else {
			pwinname.location.hash = pHash
		}
	} else {
		if ( purl ) {
			window.location.href = purl
		} else {
			window.location.hash = pHash
		}
	}
}

function p6gotopgxofy ( purlprefix , purlsuffix , ppageone , pnpages , pgotopage )
{
	/*
	Function p6gotopgxofy	Validate input of page number against number of pages in document collection
							and jump to specified page if so or throw an error message if out of range.

	Arguments:	purlprefix	= Portion of URL preceding the page number (REQUIRED).
				purlsuffix  = Portion of URL following the page number, or ".html" if null.
				ppageone	= URL of page 1, or "index.html" if null.
				pnpages		= Total number of pages in collection against which to test value of pgotopage (REQUIRED).
				pgotopage		= Number of page to display, taken from text box in form (REQUIRED).

	Author:		David A. Gray of P6 Consulting

	Created:	11 August 2001

	Copyright 2001, P6 Consulting. All rights reserved worldwide.

	Modification history:

	Date	   Who What was done.
	---------- --- ----------------------------------------------------------------------------------------------------
	08/11/2001 DAG Created and tested.
	09/08/2001 DAG Changed alerts for non-numeric and out of bounds inputs to say "INPUT ERROR!" rather than "ABORTING"
	               to clarify that the message box is about a user error rather than a programming error.
	09/10/2001 DAG Simplified the out of bounds page number error message per recommendation of Sue.

	*/
	var abortflag ;
	var intgotopage ;
	var intnumpages ;
	var msgtext ;
	var fullurl ;
	if ( !purlprefix ) {
		msgtext = "ABORTING!" + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
		msgtext = msgtext + "Required argument purlprefix is null." + String.fromCharCode ( 10 ) ;
		msgtext = msgtext + "Fix call to JavaScript function p6gotopgxofy in thia page." ;
		window.alert ( msgtext ) ;
		abortflag = 1 ;
	}
	if ( !purlsuffix ) {
		purlsuffix = ".html" ;
	}
	if ( !ppageone ) {
		ppageone = "index.html" ;
	}
	if ( !pnpages ) {
		msgtext = "ABORTING!" + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
		msgtext = msgtext + "Required argument pnpages is null." + String.fromCharCode ( 10 ) ;
		msgtext = msgtext + "Fix call to JavaScript function p6gotopgxofy in thia page." ;
		window.alert ( msgtext ) ;
		abortflag = 1 ;
	} else {
		if ( typeof ( pnpages ) != "string" ) {
			msgtext = "ABORTING!" + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
			msgtext = msgtext + "Value for required argument pnpages must be a string." + String.fromCharCode ( 10 ) ;
			msgtext = msgtext + "The variable passed to it is of type " + typeof ( pnpages ) + "." + String.fromCharCode ( 10 ) ;
			msgtext = msgtext + "Fix call to JavaScript function p6gotopgxofy in thia page." ;
			window.alert ( msgtext ) ;
			abortflag = 1 ;
		} else {
			intnumpages = parseInt ( pnpages , 10 )
			if ( isNaN ( intnumpages ) ) {
				msgtext = "ABORTING!" + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
				msgtext = msgtext + "Value of " + pnpages + " for required argument pnpages must be numeric." + String.fromCharCode ( 10 ) ;
				msgtext = msgtext + "Fix call to JavaScript function p6gotopgxofy in thia page." ;
				window.alert ( msgtext ) ;
				abortflag = 1 ;
			}
		}
	}
	if ( !pgotopage ) {
		msgtext = "ABORTING!" + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
		msgtext = msgtext + "Required argument pgotopage is null." + String.fromCharCode ( 10 ) ;
		msgtext = msgtext + "Fix call to JavaScript function p6gotopgxofy in thia page." ;
		window.alert ( msgtext ) ;
		abortflag = 1 ;
	} else {
		if ( typeof ( pgotopage ) != "string" ) {
			msgtext = "ABORTING!" + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
			msgtext = msgtext + "Value for required argument pgotopage must be a string." + String.fromCharCode ( 10 ) ;
			msgtext = msgtext + "The variable passed to it is of type " + typeof ( pgotopage ) + "." + String.fromCharCode ( 10 ) ;
			msgtext = msgtext + "Fix call to JavaScript function p6gotopgxofy in thia page." ;
			window.alert ( msgtext ) ;
			abortflag = 1 ;
		} else {
			intgotopage = parseInt ( pgotopage , 10 )
			if ( isNaN ( intgotopage ) ) {
				msgtext = "INPUT ERROR!" + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
				msgtext = msgtext + "You asked to go to page " ;
				msgtext = msgtext + String.fromCharCode ( 34 ) + pgotopage + String.fromCharCode ( 34 ) ;
				msgtext = msgtext + " which is not numeric."  + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
			 	msgtext = msgtext + "Please enter a number between 1 and " + pnpages + "." ;
				window.alert ( msgtext ) ;
				abortflag = 1 ;
			}
		}
	}
	if ( !abortflag ) {
		if ( pgotopage == "1" ) {
			fullurl = ppageone ;
		} else {
			if ( intgotopage > intnumpages ) {
				msgtext = "INPUT ERROR!" + String.fromCharCode ( 10 ) + String.fromCharCode ( 10 ) ;
				msgtext = msgtext + "You requested page " + pgotopage + "." + String.fromCharCode ( 10 ) ;
			 	msgtext = msgtext + "Please enter a number between 1 and " + pnpages + "." ;
				window.alert ( msgtext ) ;
			} else {
				fullurl = purlprefix + pgotopage + purlsuffix ;
				window.location.href = fullurl ;
			}
		}		
	}
}

function p6goback ( )
{
	/*
	Function p6goback	Go back one URL in the browser history.

	Arguments:	None.

	Author:		David A. Gray of P6 Consulting

	Created:	12 May 2003

	Copyright 2003, P6 Consulting. All rights reserved worldwide.

	Modification history:

	Date	   Who What was done.
	---------- --- ----------------------------------------------------------------------------------------------------
	08/18/2003 DAG Replace Back method of Window object with Go method of History object, which seems to actually work.
	12/30/2004 DAG Add code to go back an arbitarry number of slots in the history.

	*/
	var xTarget ;
	var xGoback ;
	if ( arguments.length >= 1 ) {
		xTarget = arguments [ 0 ] ;
		xGoback = -1 * xTarget ;
		history.go ( xGoback ) ;
	} else {
		history.go ( -1 ) ;
	}
}
function p6goback2pg ( purl )
{
	/*
	Function p6goback	Go back to specified URL in the browser history.

	Arguments:	None.

	Author:		David A. Gray of P6 Consulting

	Created:	Tuesday, 16 March 2004

	Copyright 2004, P6 Consulting. All rights reserved worldwide.

	Modification history:

	Date	   Who What was done.
	---------- --- ----------------------------------------------------------------------------------------------------

	*/
	history.go(purl)
}
