
var prefs = {

    data: {},

    load: function () {
        var the_cookie = document.cookie.split(';');
		
		for(var i=0;i < the_cookie.length;i++) {
			
			var c = the_cookie[i];
			
			
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			
			var matchCookie = 'prefsGB=';
			
			if (c.indexOf(matchCookie) == 0){
				
				//this.data = JSON.parse(unescape(c.substring(matchCookie.length,c.length)));
				this.data = JSON.parse(unescape(c.substring(matchCookie.length,c.length)));
	
				return this.data;
			}
		}
		return null;	
    },

	save: function (expires, path) {

        var d = expires || new Date(2020, 02, 02);
        var p = path || '/';
        document.cookie = 'prefsGB=' + JSON.stringify(this.data)
                          + ';path=' + p;
                          //+ ';expires=' + d.toUTCString();						  
    }
}