function getCookie(name)
{
	var theValue = null;
	var allcookies = document.cookie;
	var pos = allcookies.indexOf(name+'=');

	// if there is a cookie by this name, extract the value
	if (pos != -1)
	{
		var start = pos+(name.length+1);
		var end = allcookies.indexOf(";",start);
		if (end == -1) end = allcookies.length;
		var value = allcookies.substring(start,end);
		value = unescape(value);
		theValue = value;
	}
	//alert(theValue);
	return theValue;
}

function setCookie(name,value,expires,path,domain,secure) 
{
        document.cookie = name + "="  + value +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

