
// This subroutine sets up and makes a cookie for the document and assigns and expiry date
// Call the routine in the form 
// setCookie("cookieName","cookieValue","cookiePath","cookieExpires"); 
// By inserting place holders in the last two you will set the current path and an expiry
// date of 6 months hence.


function setCookie(cookieName, cookieValue, cookiePath, cookieExpires)
{
	cookieValue = escape(cookieValue);
	if (cookieExpires == "")
	{
		var nowDate = new Date();
		nowDate.setMonth(nowDate.getMonth() + 6);
		cookieExpires = nowDate.toGMTString();
	}
	if (cookiePath != "")
	{
	cookiePath = ";Path=" + cookiePath;
	}
	document.cookie = cookieName + "=" + cookieValue + ";expires=" + cookieExpires + cookiePath;
	}