// Set/get cookies
// Alex Hawryschuk : 11/12/2007
var Cookie = {
	get:function(name){
		return this.cookies()[name] || '';
	},
	cookies:function(){
		return document.cookie.split(/; ?/).inject({},function(h,p){
			p = p.split('=');
			h[p[0]] = unescape(p[1]);
			return h;
		});
	},
	set:function(name,value,expires, path, domain, secure ) {
		if (!path) path='/';
		document.cookie = name + "=" + escape(value)
			+ ((expires) ? ";expires=" + new Date( new Date().getTime() + (expires||0)*1000*60*60*24 ).toGMTString() : "" )
			+ ((path) ? ";path=" + path : "" )
			+ ((domain) ? ";domain=" + domain : "" )
			+ ((secure) ? ";secure" : "" );
	}
}
