// --------------------------------------------------
// FUNCTION::GetBrowserWidth
// --------------------------------------------------
function GetBrowserWidth()
{
	if (navigator.userAgent.indexOf("MSIE") > 0)
	{
		return(document.body.clientWidth);
	}
	else
	{
		return window.outerWidth;
	}
}

// --------------------------------------------------
// FUNCTION::GetBrowserHeight
// --------------------------------------------------
function GetBrowserHeight()
{
	if (navigator.userAgent.indexOf("MSIE") > 0)
	{
		return(document.body.clientHeight);
	}
	else
	{
		return(window.outerHeight);
	}
}

// --------------------------------------------------
// FUNCTION::LaunchWindow
// --------------------------------------------------
function LaunchWindow(strURL, strName, lngWidth, lngHeight, strParameters, blnCenter)
{
	/*
	
	--------------		--------	------------------------------------------------------------
	Parameter Text		Variable	Type Function
	--------------		--------	------------------------------------------------------------
	toolbar			boolean		display a toolbar (i.e. yes or no)
	location		boolean		display the location text box 
	directories		boolean		display the special link buttons 
	status			boolean		display a status bar 
	menubar			boolean		display the menus at the top of the window 
	scrollbars		boolean		display scrollbars if the document is larger than the window 
	resizable		boolean		allow the window to be resized 
	width			integer		the width of the window (in pixels) 
	height			integer		the height of the window (in pixels) 
	top			integer		the top position of the window (in pixels) 
	left			integer		the left position of the window (in pixels)
	
	*/
	
	// Attempt to open the new window
	try
	{
		// Get screen resolution to center
		if (blnCenter == true)
		{
			// get center of browser window
			var lngBrWidth = GetBrowserWidth() / 2
			var lngBrHeight = GetBrowserHeight() / 2
			
			// Set the new window parameters
			strParameters = strParameters + "," +
			               "width=" + lngWidth + "," +
			               "height=" + lngHeight + "," +
			               "top=" + (window.screenTop + (lngBrHeight - (lngHeight/2))) + "," +
			               "left=" + (window.screenLeft + (lngBrWidth - (lngWidth/2)));
			
			// Declare window object
			var objWin = new Object();
			
			// Set window parameters
			objWin = window.open(strURL, strName, strParameters);
			
			// Set focus on the new window
			objWin.focus();
		}
	}
	catch(e)
	{
		alert("[" + String(e.number) + "] " + String(e.description));
	}
}

// --------------------------------------------------
// FUNCTION::PrintThis
// --------------------------------------------------
function PrintThis()
{
	try
	{
		window.print();
	}
	catch(e)
	{
		alert("[" + String(e.number) + "] " + String(e.description));
	}
}

// --------------------------------------------------
// FUNCTION::ValidateEmailAddr
// --------------------------------------------------
function ValidateEmailAddr(strInput)
{
	var emReg = new RegExp();
		emReg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	if(emReg.test(strInput))
	{
		return(true);
	}
	else
	{
		return(false);
	}
}

