/*
**
** save cookie to client browser cookie cache
**
******************************************************************/
function SaveCookie(sName,sValue)
{
	document.cookie = sName + "=" + escape(sValue) + "; expires=Mon, 31 Dec 2099 23:59:59 UTC;";
	if (document.all.item("confirmation") != null)
	{
		document.all.confirmation.innerText = "Thank you "+sValue;
	}
}


/*
**
** retrieve cookie #value# with specified name
**
******************************************************************/
function GetCookie(sName)
{
	var aCookie = document.cookie.split("; ");
	var i;
	
	for (i =0 ; i < aCookie.length; i++ )
	{
		var aCrumb = aCookie[i].split("=");
		if (sName = aCrumb[0])
		{
			//update with cookie (username) the relivant pages <P> inner text.

			if (document.all.item("username_holder") != null)
			{ 
				document.all.username_holder.innerText = unescape( aCrumb[1] );
			}
			if (document.all.item("confirmation") != null)
			{
				document.all.confirmation.innerText = "Welcome back " + unescape( aCrumb[1] );
			}
			if (document.all.item("username") != null)
			{
				document.all.username.innerText = unescape( aCrumb[1] );
			}
		}
	}
}

