<!--
// Version 2001-11-15 copyright Com. Visual Arkipo

// CookieSetvar (varnom, value, limit)
// CookieGetvar (varnom)
// CookieDeletevar (varnom)
// CookieDeleteall ()

// History
// 

function CookieSetvar (varnom, value, limit)
{
	if (limit)
	{
		var limitdate = new Date();
		limitdate.setTime (limitdate.getTime() + limit);
		document.cookie = varnom + "=" + escape(value) + "; expires=" + limitdate.toGMTString() + ";";
	}
	else 
	{
		document.cookie = varnom + "=" + escape(value) + ";";
	}


}

function CookieGetvar (varnom)
{
	var myCookie = document.cookie;
	if (!myCookie) return ("");
	
	var pos = myCookie.indexOf(varnom+'=');
	if (pos != -1)
	{
		var pos1 = myCookie.indexOf("=", pos);
		//if (pos1 != (pos + varnom.length)) return ("");
		var pos2 = myCookie.indexOf(";", pos)-1;
		if (pos2 == -2) pos2 = myCookie.length;
		//alert(varnom+':'+unescape(myCookie.substring(pos1+1,pos2+1)));
		return(unescape(myCookie.substring(pos1+1,pos2+1)));
	}
	else 
	{
		alert(varnom+': notty');	
		return ("");
	}
}

function CookieDeletevar (varnom)
{
	document.cookie = varnom + "=NULL; expires=Friday, 23-May-80 00:00:00 GMT";	
}


function CookieDeleteall ()
{
	document.cookie = null;
}
//-->

