$.fn.spin = function(opts) {
	this.each(function() {
		var $this = $(this),
			data = $this.data();
		
		if (data.spinner) {
			data.spinner.stop();
			delete data.spinner;
		}
		if (opts !== false) {
			data.spinner = new Spinner($.extend({color: $this.css('color')}, opts)).spin(this);
		}
	});
	return this;
};

function update() {
	var opts = {
		lines: 10,				// The number of lines to draw
		length: 10,				// The length of each line
		width: 3,				// The line thickness
		radius: 10,				// The radius of the inner circle
		color: '#b2b2b2',		// #rbg or #rrggbb
		speed: 1.5,				// Rounds per second
		trail: 50,				// Afterglow percentage
		shadow: false			// Whether to render a shadow
	};
	
	$('.preloader').spin(opts);
}
