function setCookie(inName, inValue, inExpdays, inSecure)
{
	var expdate = new Date();
	
	expdate.setTime(expdate.getTime() + inExpdays * 24 * 60 * 60 * 1000);

	document.cookie = 
					inName + "=" +
					escape(inValue) +
					"; expires=" + expdate.toGMTString() +
					"; path=/" +
					(inSecure? ";secure" : "");
					
	return;
}

function getCookie(inName)
{
	var theCookieValue;
	
	if (document.cookie.length > 0) 
	{
		var theSearchString = inName + "=";
		var theOffset = document.cookie.indexOf(theSearchString);
		if (theOffset != -1)
		{
			theOffset += theSearchString.length;

			var theEndPosn = document.cookie.indexOf(";", theOffset);

			if (theEndPosn == -1) 
				theEndPosn = document.cookie.length;
				
			theCookieValue = unescape(document.cookie.substring(theOffset, theEndPosn))
		} 
	}
	
	return theCookieValue;
}

function getCookieOrBlank(inName)
{
	var theValue = getCookie(inName);
	if (typeof theValue == "undefined")
		theValue = "";
	
	return theValue;
}
