var cookie = {
set: function(key, value, days) {
document.cookie = 'tomato_' + key + '=' + value + '; expires=' +
(new Date(new Date().getTime() + ((days ? days : 14) * 86400000))).toUTCString() + '; path=/';
},
get: function(key) {
var r = ('; ' + document.cookie + ';').match('; tomato_' + key + '=(.*?);');
return r ? r[1] : null;
},
unset: function(key) {
document.cookie = 'tomato_' + key + '=; expires=' +
(new Date(1)).toUTCString() + '; path=/';
}
};