$(document).ready(function() {
	chrome.storage.sync.get('disabled', function(obj){
		if (!obj['disabled']) {
			$('#btn').text('Click to disable');
		} else {
			$('#btn').text('Click to enable');
		}
	});
	
	document.getElementById('btn').onclick = function() {
		chrome.storage.sync.get('disabled', function(obj){
			if (obj['disabled']) {
				$('#btn').text('Click to disable');
				chrome.storage.sync.set({'disabled': false}, function(){});
			} else {
				$('#btn').text('Click to enable');
				chrome.storage.sync.set({'disabled': true}, function(){});
			}
		});
	}
});
