
var dom = document.domain;

function getCookie(theName){
	theName += "=";
	theCookie = document.cookie + ";";
	start = theCookie.indexOf(theName);
	if(start != -1)
	{
		end = theCookie.indexOf(";", start);
		return unescape(theCookie.substring(start + theName.length, end));
	}
	return("");
}

function setCookie(theName,theValue){
	if((theName != null) && (theValue != null)){
		theCookie = theName + "=" + escape(theValue) + ";path=/;";
		if(dom != ""){
			theCookie += "domain=" + dom + ";";
		}
		document.cookie = theCookie;
		return true;
	}
	return false;
}

function delCookie(theName){
	theCookie = theName + "=;";
	theCookie += "expires=Thu, 01-Jan-1970 00:00:01 GMT;";
	theCookie += "path=/;";
	if(dom != ""){
		theCookie += "domain=" + dom + ";";
	}
	document.cookie = theCookie;
	return true;
}

