$( function() {

/* Invio di un nuovo commento */
$("a.invia_commento").click(function(){
		
		$("#opaco").css("display", "block").css("opacity", 0.7).css("width", $(document).width()).css("height", $(document).height());
		$("#attesa_invio_commento").css("opacity", 0.85).fadeIn("slow").css("top",Mytopmargin($("#attesa").height()) + "px").css("left", Myleftmargin($("#attesa").width()) + "px");

		
		var obj_type = $("#obj_type").attr("value");
		var obj_ID = $("#obj_ID").attr("value");
		var commento = $("#campo_commento").val();
		
		$.post("/interattivi/sendcomment.asp", { obj_type: obj_type, obj_ID: obj_ID, commento: commento },
			  function(data){
				if (data == 'OK')
				{
					$("#attesa_invio_commento").fadeOut("fast");
					$("#opaco").fadeOut("fast");
					location.reload();
				}
				else
				{
					$("#attesa_invio_commento").fadeOut("fast");
					$("#opaco").fadeOut("fast");
				}					
		  });
		
		$("#campo_commento").attr("value", "");
		return false;
   });

});
