		/****************************************************************************************
		Function:	 	getCookie
		Description: 	gets the value of a cookie (cookieName)
		Parameters:		cookieName (required) - the name of the cookie
		Returns: 		String
		****************************************************************************************/
		function getCookieValue(cookieName) 
		{
			var cookies = document.cookie.split("; ");
			for(var x = 0; x < cookies.length; x++) 
			{
				var curCookie = cookies[x].split("=");
				if(curCookie[0] == unescape(cookieName)) 
				{ 
					var cookieValue = curCookie[1] ? unescape(curCookie[1]) : '';		
					return cookieValue; 
				}
			}
			return null;
		}
		
		/****************************************************************************************
		Function:	 	setCookie
		Description: 	sets the value of a cookie (cookieName)
		Parameters:		cookieName (required) - the name of the cookie
						cookieValue (required) - the value of the cookie
						expires (optional) 	- lifetime of the cookie in seconds
											- if a negative value is passed, the cookie will be deleted
											- if null is passed, the cookie will expire when the browser is closed
						path (optional) - directory where the cookie is active.
						domain (optional) - domain the cookie should be sent.  Default is the domain of the page that sets it.
						isSecure (optional) - true will create a cookie only visible in https domain.  Default is false.
		Returns: 		boolean
		****************************************************************************************/
		function setCookie(cookieName, cookieValue, expires, path, domain, isSecure) 
		{
			if(!cookieName) 
			{ 
				return false; 
			}
			document.cookie = escape(cookieName) + "=" + escape(cookieValue) +
				(expires ? ";expires=" + (new Date((new Date()).getTime() + (1000 * expires))).toGMTString() : "") +
				(path ? ";path=" + path : "") + 
				(domain ? ";domain=" + domain : "") + 
				(isSecure ? ";secure" : "");
			
			/**check to see if the cookie has been set or deleted*/
			if(expires < 0) 
			{ 
				if(typeof(getCookieValue(cookieName)) == "string") 
				{ 
					return false; 
				} 
				return true; 
			}
			if(typeof(getCookieValue(cookieName)) == "string") 
			{ 
				return true; 
			} 
			return false;
		}

		/****************************************************************************************
		Function:	 	encodeString
		Description: 	encodes stringValue in unicode format and escapes the return value
		Parameters:		stringValue (required) - the string that is to be encoded				
		Returns: 		string
		Notes:			The offSet value will "shift" each characters unicode value by that number.  
						The offSet value will be appended to the end of the encoded string and is required
						by the "decodeString" function to properly decode the string.  The value must be
						a single digit and should greater than 1. A value of 0 will simply return an
						escaped string which may still be human readable.
		****************************************************************************************/
		function encodeString(stringValue)
		{
			var offSet = Math.floor(Math.random()*9) + 1; 
			var tmpArray = new Array();
			for(x=0; x<stringValue.length; x++)
			{
				tmpArray[x] = stringValue.charCodeAt(x) + offSet;
			}
			return "" + eval("String.fromCharCode("+tmpArray+")") + offSet;
		}
		
		/****************************************************************************************
		Function:	 	decodeString
		Description: 	decode and unescape stringValue
		Parameters:		stringValue (required) - the encoded string that is to be decoded
		Returns: 		string
		Notes:			The offSetValue is assumed to be the last byte of stringValue.  
						It is set by the encodeString function.
		****************************************************************************************/
		function decodeString(stringValue)
		{
			var offSetValue = stringValue.substr(stringValue.length-1,1);
			var stringValue = stringValue.substr(0,stringValue.length-1);
			var decodedStringValue = '';
			for(x=0; x<stringValue.length; x++)
			{
				decodedStringValue += String.fromCharCode(stringValue.charCodeAt(x) - offSetValue);
			}
			return decodedStringValue;
		}
