/********************************************************************************************
*		PROCEDEURE NAME:	openPage
*		USAGE:								This function opens a given page within the current browser window
*		ARGUMENTS:					strURL - The address of the page to be opened
*		DESCRIPTION:					Simple function that redirects to a new web address in the current window
*		WRITTEN BY:					DT - 09-05-03
*		MAINTENANCE:
********************************************************************************************/
function openPage(strURL) {
	//Open the new address
	location.href = strURL;
}
/********************************************************************************************
*		PROCEDEURE NAME:	imgSwap
*		USAGE:								This function performs image rollover functionality
*		ARGUMENTS:					imgName - The name of the image
*													actType - The type of rollover action (on/off)
*		DESCRIPTION:					Changes the image
*		WRITTEN BY:					DT - 01-07-02
*		MAINTENANCE:				DT - 0420-05 - Added image path argument
********************************************************************************************/
function navRoll(strImgPath,imgObjName, actType)
{
	//Get a hold of the image object
	objImg = eval('document.' + imgObjName)
	
	//Swap the image
	objImg.src = strImgPath + '/' + imgObjName + '_' + actType + '.jpg'
}
/********************************************************************************************
*		PROCEDEURE NAME:	getCookie
*		USAGE:								This function gets a cookie value
*		ARGUMENTS:					Name - The name of the cookie
*		DESCRIPTION:					Opens the values from a given cookie
*		WRITTEN BY:					TM - 01-05-05
*		MAINTENANCE:
********************************************************************************************/
function getCookie(Name) {          
	var search = Name + "="          
	if (document.cookie.length > 0) { 
		// if there are any cookies                    
		offset = document.cookie.indexOf(search)                     
		if (offset != -1) { 
		// if cookie exists                               
			offset += search.length                               
			// set index of beginning of value                              
			end = document.cookie.indexOf(";", offset)                               
			// set index of end of cookie value                             
			if (end == -1)                                         
			end = document.cookie.length                              
			return unescape(document.cookie.substring(offset, end))                    
		}
	}
}
/*******************************************************************************************************************
*		PROCEDEURE NAME:	getQSValue
*		USAGE:								This function returns the value of a given query string parameter
*		ARGUMENTS:					qsName - The name of the parameter
*													strQuery - The entire query string
*		DESCRIPTION:					Returns the value for the given parameter
*		WRITTEN BY:					DT - 09-05-04
*		MAINTENANCE:
*******************************************************************************************************************/
function getQSValue(qsName, strQuery)
{
	//Declarations
	var i;
	//Get the question mark off of the query string
	strQuery = strQuery.substring(1, strQuery.length)
	//Split the values into an array
	var arrQuery = strQuery.split('&');
	//Loop through the array and search for the given value
	for (i=0;i < arrQuery.length; i++)
	{
		//Check to see if the current parameter in the array is the same as the passed in value
		var currName = arrQuery[i].substring(0, arrQuery[i].indexOf('='))
		//If they are the same...
		if (qsName == currName)
		{
			//Get the value for the parameter
			var currVal = arrQuery[i].substring(arrQuery[i].indexOf('=') + 1, arrQuery[i].length)
			//Get rid of any invalid characters
			currVal = unescape(currVal);
			//Return the final value
			return currVal;
		}
	}
}
/*******************************************************************************************************************
*		PROCEDEURE NAME:	newWin
*		USAGE:								This function opens a given page within a new browser window instance
*		ARGUMENTS:					sURL - The address of the page to be opened
*													sName - The name of the window object
*													iWidth - Width of the new window
*													iHeight - Height of the new window
*													blnScroll - Yes/No to allow the window to have a scrollbar
*													blnResize - Yes/No to allow the window to be resizable
*													blnMenu - Yes/No to allow the window to have a maenu
*													blnTool -Yes/No to allow the window to have a scrollbar
*		DESCRIPTION:					Opens a new borwser window instance
*		WRITTEN BY:					DT - 09-05-03
*		MAINTENANCE:
*******************************************************************************************************************/
function newWin(sURL,sName,iWidth,iHeight,blnScroll,blnResize,blnMenu,blnTool)
{
	//Set the name of the winow (getting rid of any spaces)
	sWinNm = sName.replace(' ','')
	//Set up the options parameter
	opts = 'width=' + iWidth + ',height=' + iHeight + ',scrollbars=' + blnScroll + ',resizable=' + blnResize + ',menubar=' + blnMenu + ',toolbar=' + blnTool;     
	//Open the window and set it into a variable
	var win = window.open('', sWinNm,opts);
	//Set the window location
	win.location.href = sURL
	//Make sure the window is brought to the front
	win.focus()
}