//flowplayer("player", "flowplayer/flowplayer-3.1.4.swf"); 

$(function() {

	$("#submit").click(function() {
			var text = $("#fcomment").val();
			var name = $("#fname").val();
			var code = $("#captcha_code").val();
			var comm = $(this).attr("comment");
			var dept = $(this).attr("dept");
			$.post("query.php", { method: "comment", page: "1", fcomment: text, fname: name, captcha_code: code, cid: comm, did: dept}, 
			function(data) {
				if (data == "success") {
					$("#feedback").html("Comentario enviado com sucesso. Por favor, aguarde ate que um de nossos administradores revisem seu comentario.<br><a href='#' id='again'>Enviar outro comentario.</a>");
					$("#fcomment").val(" ");
					$("#fname").val(" ");
					$("#captcha").attr("src","securimage/securimage_show.php?" + Math.random());
					$("#form").hide();
				}
				else if (data == "emptyerror") {
					$("#feedback").html("Por favor, preencha todos os campos antes de enviar seu comentario.");
				}
				else if (data == "captchaerror") {
					$("#feedback").html("The text doesnt match the image.");
				}
				else {
					$("#feedback").html(data);
				}
			});
			$("#captcha").attr("src","securimage/securimage_show.php?" + Math.random());
			return false;
		});
	
	/*$(".list1").hide();
	
	$(".thumb").hover(
		function() {
			$(this).parent().parent().children("ul").show();
			//console.log("bla");
			return false;
		},
		function() {
			$(this).parent().parent().children("ul").hide();
			return false;
		}
	);*/
	/*var idd = $("#video").attr("title");
	$("#video").flash({
		src: "livevideo.swf",
		width: "550px",
		height: "350px",
		expressInstall: true,
		flashvars: {videosrc: idd}
	});
	
	$(".thumb").hover(
		function() {
		var title = $(this).attr("title");
		var author = $(this).attr("author");
		var desc = $(this).attr("description");
		var date = $(this).attr("date");
		var thumb = "";
			$(".content").html("<h2>"+title + "</h2><p>" + desc + "</p><i>" + author + "<br>"+ date+"</i>");
			return false;
	},
		function () {
			return false;
	});*/
	
	
});