if (!TT)
{
	var TT = {};
}
if (!TT.cookies)
{
	TT.cookies = new Cookies(TT);
}
function Cookies ( TT_obj )
{
	this.TT = TT_obj;
	return this;
}
Cookies.prototype.get = function( name )
{
	var cookie_str = "" + document.cookie;
	var result_1 = cookie_str.indexOf( name );
	if( result_1 == -1 || name == "" )
	{
		return false;
	}
	var result_2 = cookie_str.indexOf( ";", result_1 );
	if( result_2 == -1 )
	{
		result_2 = cookie_str.length;
	}
	var cookie = cookie_str.substring( result_1 + name.length + 1, result_2 );
	if (!cookie)
	{
		return false;
	}
	return unescape( cookie );
};

Cookies.prototype.set = function( name, value, expires, path, domain, secure )
{
	var curCookie = name + "=" + escape( value ) +
	( (expires) ? "; expires=" + this._get_expires( expires ) : "" ) +
	( (path) ? "; path=" + path : "; path=/" ) +
	( (domain) ? "; domain=" + domain : "" ) +
	( (secure) ? "; secure" : "" );
	document.cookie = curCookie;
	if( !this.get( name ) )
	{
		return false;
	}
	else
	{
		return true;
	}
};

Cookies.prototype._get_expires = function( num_days )
{
	if( num_days == "" )
	{
		return num_days;
	}
	var UTC_str;
	var second = new Date();
	num_milli = Date.parse( second );
	second.setTime( num_milli + ( num_days * 24 * 60 * 60 * 1000 ) );
	UTC_str = second.toUTCString();
	return UTC_str;
};
