
(function($) {
	$.fn.showSurvey = function(options) {
		var settings = $.extend(
			{
			}, options);

		var $this = $(this);

		var load = function() {
			$.get(settings.url,
				function(data, status){
					if (status == "success") {
						$this.html(data);
						$this.show();
						register();
					}
			});
		};
				
		function register() {
			$("a", $this).each(function () {
				this.answer = function (value) {
					$.post(settings.url + value, 
						function(data, status) {
							if (status == "success") {
								$this.html(data);
							}						
						}
					);
					if (window.event) event.cancelBubble = true;
					return false ;
				}
			})				
		}

		load();

		return $this;
	};
}(jQuery));

