function setSectionCookie(name, value) 
{
	the_cookie = escape(value);
	document.cookie = name + "=" + escape(value);
	return the_cookie;
}


function setCookie(name, value, edate) 
{
	if((edate == "") || (edate == null))
	{
		document.cookie = name + "=" + escape(value) + "; path=/";
	} else if(edate == "tomorrow") 
	{
		var expdate = new Date();
		expdate.setTime(expdate.getTime() + (86400 * 1000 * 1));
		document.cookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString() + "; path=/";
	} else if(edate == "tomorrow2") 
	{
		var expdate = new Date();
		expdate.setTime(expdate.getTime() + (86400 * 500 * 1));
		document.cookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString() + "; path=/";
	} else if(edate == "tomorrowmorning") 
	{
		var expdate = getTodayReturnTomorrow();
		expdate.setHours(0);
		expdate.setMinutes(0);
		expdate.setSeconds(0);
// 		alert(expdate);
//		expdate.setTime(expdate.getTime() + (86400 * 500 * 1));
		document.cookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString() + "; path=/";
	} 
	else 
	{
		var expdate = new Date(edate);
		document.cookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString() + "; path=/";
	}
	//Set a cookie given a name and value  to expire tomorrow.
}
function getCookie(name) 
{
	var search;
	// Returns the value of the named cookie.
	search = name + "=";
	offset = document.cookie.indexOf(search);
	if (offset != -1) 
	{
		offset += search.length;
	    end = document.cookie.indexOf(";", offset);
		if (end == -1) end = document.cookie.length;
	    return unescape(document.cookie.substring(offset, end));
	}
	else return "";
}
function deleteCookie(name) 
{
	var expdate = new Date();
	// Delete the named cookie.
	expdate.setTime(expdate.getTime() - (86400 * 1000 * 1));
	setCookie(name, "", expdate);
}

