$(document).ready(function(){

$("#scoll").show("slow").load("infusions/textual_greeting_panel/js/textual_panel.php");

$(function(){ 
$("#dialog").dialog({ 
autoOpen: false, 
modal:true,
title: 'Dodaj pozdrowienie',
show: 'slide',
height: 'auto',
width: 'auto'
});
});



$("#opener").click(function(){
$("#dialog").dialog("open"); 
});


$("#add").click(function(){

captcha_code = $("#captcha_code").val();
tresc = $("#tresc").val();


 $.ajax({
   type: "POST",
   url: "infusions/textual_greeting_panel/js/textual.php",
   data: {
   tresc: tresc,
   captcha_code: captcha_code
   },
   success: function(msg){
     $("#open1").html(msg);
     
$("#scoll").show("slow").load("infusions/textual_greeting_panel/js/textual_panel.php");

      
   }
 });

$("#dialog").dialog("close");


});



$(function(){     
	$("#ticker01").liScroll(); 
	}); 

var limit = 50;

$("#tresc").keyup(
		function()
		{
			var count_chars = $(this).val().length;
			if (count_chars > limit)
			{
				var new_value = $(this).val().substring(0, limit);
				$(this).val(new_value)
			}
			$("#key").html(""+limit - $(this).val().length+"");
		});




});

