!function( $ ) {
	
	$.fn.spin = function(opts) {
		this.each(function() {
			var $this = $(this),
			data = $this.data();
			
			if (data.spinner) 

			if (opts !== false) {
				data.spinner = new Spinner($.extend({color: $this.css('color')}, opts)).spin(this);
			}
		});
		return this;
	};
	
	"use strict"
	
	
	var opts = {
		lines: 7,
		length: 3,
		width: 6,
		radius: 7,
		rotate: 54,
		color: '#000',
		speed: 1.7,
		trail: 36,
		shadow: true,
		hwaccel: false,
		className: 'spinner',
		zIndex: 2e9,
		top: 'auto',
		left: 'auto'
	};
	
	$("#spin").spin(opts);
	
	$('.carousel').carousel({
		interval: 9999999
	});
	
	$('.carousel').bind('slid', function() {
		$('#ans-buttons').toggle();
	});
	
	$('#btn-switch').click(function() {
		$('.carousel').carousel('next');
		return false;
	});
	
	KeyboardJS.bind.key('left, right, up, down',
		function() {},
		function() {
			$('.carousel').carousel('next');
		}
	)
	
	KeyboardJS.bind.key('a',
		function() {},
		function() {
			if ($('#ans-buttons').css('display') != 'none') {
				$('#btn-no').click();
			}
		}
	)
	
	KeyboardJS.bind.key('s',
		function() {},
		function() {
			if ($('#ans-buttons').css('display') != 'none') {
				$('#btn-yes').click();
			}
		}
	)
	
	$("#ans-buttons input").click(function() {
		return false;
	});
	
	// add
	$("#text-front").bind('keyup', function() {
		$("#front-result").html($("#text-front").val())
	});
	
	$("#text-back").bind('keyup', function() {
		$("#back-result").html($("#text-back").val())
	});
	
}( window.jQuery );

{
				data.spinner.stop();
				delete data.spinner;
			}