   
function feedback_form(){
	var like = 0;
	var topic = 0 ;
	var content = "";
	
	$("a[rel='feedback_form']").colorbox({
		opacity: 0.5,
		inline: true,
		href: "#myFeedbackForm",
		innerWidth: 600,
		innerHeight: 400,
		scrolling: false,
		overlayClose: false
	});
	
	
	$("a[class='fb_like']").click(function(){
		$("a[class='fb_like']").fadeTo("fast", 0.5);
		like = $(this).attr("auswahl");
		$(this).fadeTo("fast", 1.0);
			
		return false;
	});
	
	
	$("a[class='fb_topic']").click(function(){
		$("a[class='fb_topic']").fadeTo("fast", 0.5);
		topic = $(this).attr("auswahl");
		$(this).fadeTo("fast", 1.0);
		
		$("#textarea_topic").slideDown("slow", function(){
			$.fn.colorbox.resize();
			
			clearTimeout($.data(this, "timer"));
		    var ms = 700; //milliseconds
		    var val = this.value;
		    var wait = setTimeout(function() {
		      //set_focus();
			  $("#textarea_topic").focus();
		    }, ms);
		    $.data(this, "timer", wait);
		});
				
		return false;
	});
	
	
	$("#send_feedback").click(function() {
		$('#send_feedback').attr("disabled", true);
		
		content = $("#textarea_topic").val();
		
		//prüfe ob ausgefüllt
		if((like != 0) && (topic != 0) && (content != "")) {
			$.post("feedback_form/send_fb.php", { like: like, topic: topic, content: content }, function() {
				$("#myFeedbackForm").html("<div style=\"text-align: center; font-size: 2em; font-weight: bold; font-family:Georgia; margin-top: 200px; color: #777;\">Thank you for your feedback!</div><div style=\"text-align: center; font-size: 1em; font-family:Georgia; color: #999;\">(window will close in 2 seconds)</div>");
				
				clearTimeout($.data(this, "timer"));
			    var ms = 2000; //milliseconds
			    var val = this.value;
			    var wait = setTimeout(function() {
			      	//set_focus();
					$.fn.colorbox.close();  
			    }, ms);
			    $.data(this, "timer", wait);
			});	
		} else {
			$("#error_fb").html("");
		
			if(like == 0)
				$("#error_fb").html("Please select how you like MathRun<br />");
				
			if(topic == 0)
				$("#error_fb").html($("#error_fb").html()+"Please choose a feedback topic<br />");
				
			if(content == "")
				$("#error_fb").html($("#error_fb").html()+"Please post your feedback<br />");
		}
		
		return false;
	});
}