<!--
function G_WindowOpen(sURL, sTitle, sWidth, sHeight, sLocation, sMenubar, sStatus, sToolbar, sDirectories, sScrollbars, sResizable, bDebug) {
/*
========================================================================
			G_WindowOpen
========================================================================

Opens a new window.

Usage :  objNewWindow = G_WindowOpen(document.form1.txt1.value, false)

	Inputs:
		See Below for window values
		bDebug	- Set to true to show incoming and exiting values
		
	Outputs:
		objNewWindow	- returns a handle to a new window object
--------------------------------------------------------------------------

alert(sURL)


	

	[NS]	alwaysLowered	- [yes] creates a window that always floats below other windows
	[NS]	alwaysRaised	- [yes] creates a window that always floats above other windows
	[IE]	channelmode		- [Yes} window appears in channel mode
	[NS]	dependent		- [yes] creates a child (closes when the parent window closes and does not appear on the task bar on Windows platforms) of the current window
	[IE,NS]	directories		- [yes] includes standard directory buttons
	[IE]	fullscreen		- [Yes} new window will appear in full screen
	[IE,NS]	height			- height in pixels
	[NS]	hotkeys			- [no] disables use of hotkeys (except security and quit hotkeys) in a window without a menubar. 
	[NS]	innerHeight		- inner height in pixels 
	[NS]	innerWidth		- inner width in pixels 
	[IE,NS]	location		- [yes] includes Location field (Default = no). 
	[IE,NS]	menubar			- [yes] creates a menu bar (File, Edit, View, etc.). 
	[NS]	outerHeight		- outer height in pixels. 
	[NS]	outerWidth		- outer width in pixels. 
	[IE,NS]	resizable		- [no] stops user resizing 
	[NS]/[IE] screenX/Left	- creates a window X pixels from left of screen 
	[NS]/[IE] screenY/Top	- creates a window Y pixels from left of screen
	[IE,NS]	scrollbars		- [yes] creates horizontal and vertical scrollbars when needed 
	[IE,NS]	status			- [yes, creates status bar 
	[NS]	titlebar		- [yes] creates title bar 
	[IE,NS]	toolbar			- [yes] creates tool bar (Back, Forward, etc.)
	[IE,NS]	width			- width in pixels
	[NS]	z-lock			- [yes] prevents new window from rising above other windows when it gets focus 


	
	
	****************************
	*  Start - Setup defaults  *
	****************************
	*/
	
	// Pass only width as interger
	//nWidth = parseInt(sWidth.value)
	//if (isNaN(nWidth)) {sWidth = '690'} else {sWidth = nWidth.toString()}
		
		
	// Pass only Height as interger
	//nHeight = parseInt(sHeight.value)
	//if (isNaN(nHeight)) {sHeight = '690'} else {sHeight = nHeight.toString()}
	
	//Default Common Objects
	if (sLocation == true || sLocation == 'yes') {sLocation = 'yes'} else {sLocation = 'no'}
	if (sMenubar == true || sMenubar == 'yes') {sMenubar = 'yes'} else {sMenubar = 'no'}
	if (sStatus == true || sStatus == 'yes') {sStatus = 'yes'} else {sStatus = 'no'}
	if (sToolbar == true || sToolbar == 'yes') {sToolbar = 'yes'} else {sToolbar = 'no'}
	if (sDirectories == true || sDirectories == 'yes') {sDirectories = 'yes'} else {sDirectories = 'no'}
	if (sScrollbars == false || sScrollbars == 'no') {sScrollbars = 'no'} else {sScrollbars = 'yes'}
	if (sResizable == false || sResizable == 'no') {sResizable = 'no'} else {sResizable = 'yes'}
	
	
	
	
	//Make Sure sTitle is safe - space or %20 can't be used.
	//sTitle = sTitle.replace(' ','_')
	//sTitle = sTitle.replace('%20','_')
	
	

	/*
	****************************
	*  End - Setup defaults  *
	****************************
	*/

	PeramList = "width=" + sWidth + ", height=" + sHeight + ", resizable=" + sResizable + ", location=" + sLocation + ", menubar=" + sMenubar + ", status=" + sStatus + ", toolbar=" + sToolbar + ", scrollbars=" + sScrollbars + ", directories=" + sDirectories

	if (sTitle.length == 0) {
		window.open(sURL, "_blank" , PeramList );
	}
	else {
		while (sTitle.indexOf(' ') != -1) {
			sTitle = sTitle.replace(' ', '_');
		}
		var w = window.open(sURL, sTitle , PeramList );
		w.focus();
	}




}


/*
========================================================================
			/ G_WindowOpen
========================================================================
*/







/*
========================================================================
			G_OpenParent
========================================================================

Opens or brings to the front the parent that opened it.

Usage :  G_OpenParent('MyPage.asp?QS=var')


--------------------------------------------------------------------------
*/

function G_OpenParent(sURL) {

	if (window.opener && !window.opener.closed) {
		if (sURL.length > 0) {window.opener.document.location.href = sURL;}
		window.opener.focus();
	}
	else
	{
		alert('The requested window in not avaliable.')	
	}		

}


/*
========================================================================
			/ G_OpenParent
========================================================================
*/













function G_EncodeSafeForURL(sVal, bDebug) {

/*
*********************************************************************
						START - G_EncodeSafeForURL
*********************************************************************

Encripts a string for safe use in URL for a value that might contain
unsafe or restricted characters.

Usage :  sVal = G_EncodeSafeForURL(document.form1.txt1.value, false)

	Inputs:
		sVal	- Incoming String Value to be Checked
		bDebug	- Set to true to show incoming and exiting values
		
	Outputs:
		sVal	- returned encoded for safe use in URL
=====================================================================
*/


		if (bDebug == true) {alert("G_EncodeSafeForURL\n\nIncoming value :\n\n" + sVal)}

		//Encode unsafe characters - Do % first cuz encoding uses % to encode.
			sVal = sVal.replace('%', '%25') //Percent character ("%")
			sVal = sVal.replace(' ', '%20') //Space
			sVal = sVal.replace('"', '%22') //Quotation marks
			sVal = sVal.replace('<', '%3C') //Less Than symbol ("<")
			sVal = sVal.replace('>', '%3E') //Greater Than symbol (">") 22
			sVal = sVal.replace('#', '%23') //Pound character ("#")
			sVal = sVal.replace('{', '%7B') //Left Curly Brace ("{")
			sVal = sVal.replace('}', '%7D') //Right Curly Brace ("}")
			sVal = sVal.replace('\\', '%5C') //Backslash ("\")
			sVal = sVal.replace('^', '%5E') //Caret ("^")
			sVal = sVal.replace('~', '%7E') //Tilde ("~")
			sVal = sVal.replace('[', '%5B') //Left Square Bracket ("[")
			sVal = sVal.replace(']', '%5D') //Right Square Bracket ("]")
			sVal = sVal.replace('`', '%60') //Grave Accent ("`") 

		//Encode restricted characters
			sVal = sVal.replace('$', '%24') //Dollar ("$")
			sVal = sVal.replace('&', '%26') //Ampersand ("&")
			sVal = sVal.replace('+', '%2B') //Plus ("+")
			sVal = sVal.replace(',', '%2C') //Comma (",")
			sVal = sVal.replace('/', '%2F') //Forward slash/Virgule ("/")
			sVal = sVal.replace(':', '%3A') //Colon (":")
			sVal = sVal.replace(';', '%3B') //Semi-colon (";")
			sVal = sVal.replace('=', '%3D') //Equals ("=")
			sVal = sVal.replace('?', '%3F') //Question mark ("?")
			sVal = sVal.replace('@', '%40') //'At' symbol ("@")

			if (bDebug == true) {alert("G_EncodeSafeForURL\n\nEncoded for safe use in URL :\n\n" + sVal)}
			return sVal;
/*
*********************************************************************
						END - G_EncodeSafeForURL
*********************************************************************
*/
}






//-->
 