var Cookie = {

	options: {
		domain: false,
		path: false,
		duration: false,
		secure: false
	},

	set: function(key, value, options){
		options = $H(this.options).merge(options);
		value = value ? encodeURIComponent(value) : '';
		if (options.domain) value += '; domain=' + options.domain;
		if (options.path) value += '; path=' + options.path;
		if (options.duration){
			var date = new Date();
			date.setTime(date.getTime() + options.duration * 24 * 60 * 60 * 1000);
			value += '; expires=' + date.toGMTString();
		}
		if (options.secure) value += '; secure';
		document.cookie = key + '=' + value;
	},

	get: function(key){
		var value = document.cookie.match('(?:^|;)\\s*' + key.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1') + '=([^;]*)');
		return value ? decodeURIComponent(value[1]) : false;
	},

	remove: function(cookie, options){
		if (typeof(cookie).toLowerCase() == 'object') this.set(cookie.key, '', $H(cookie).merge({duration: -1}));
		else this.set(cookie, '', $H(options).merge({duration: -1}));
	},
	
	accept: function() {
    if (typeof navigator.cookieEnabled == 'boolean') {
      return navigator.cookieEnabled;
    }
    Cookie.set('_test', '1');
    if(Cookie.get('_test') == '1') {
	   Cookie.remove('_test');
		return true;
	 } else {
		return false;
	 }
  }
};