/*
 * These are the functions used to initialize, store and retrieve
 * user specified preferences for the website
 */

var preferences = JSON.parse(localStorage.getItem('preferences'));
if (preferences == null) {
	var preferences = {};
	
	// Initialize Preferences to default values
	preferences.showheadshot = true;
}

function setPref(key, value) {
	// Set the value in the preferences array
	preferences[key] = value;
	
	console.log(JSON.stringify(preferences));
	
	// Put the object into storage
	localStorage.setItem('preferences', JSON.stringify(preferences));
}
