/**
 * ustawia tooltipa dla ikonek pomocy
 */
function help()
{
	$('a.help').cluetip({splitTitle: '|', positionBy: 'mouse', dropShadow: false, showTitle: false});
}
function help2()
{
	$('a.help2').cluetip({splitTitle: '|', positionBy: 'bottomTop', dropShadow: false, showTitle: false});
}

function zliczajZnaki(opis, znak, max) 
{
   var i = $('#'+opis);
   var z = $('#'+znak);
   if(i.val().length<=max) 
   {
      a=i.val().length;
      b=max;
      c=b-a;
      z.html(c);
   } 
   else 
   {
      alert('Przekroczono dozwolona ilosc znakow !!!');
   }
}

function show_message(text)
{
	var message = window.parent.document.createElement("div");
	window.parent.document.getElementById('wrap').appendChild(message);
	message.style.top = document.documentElement.scrollTop+'px';
	message.style.display = 'none';
	$(message).html(text);
	$(message).addClass('messageDiv');
	$(message).attr('id', 'show_message');

	$(message).show('slow');
	window.setTimeout('$("#show_message").hide();',7000);			
}

function inform_friend()
{
	$.ajax({
	  type: "POST",
	  url: HOST_MAIN+"/inform_friend/inform",
	  data: "email="+$('#inform_email').val()+"&text="+$('#inform_text').val(),
	  beforeSend: function() {$("#inform_loader").show(); },
	  success: function(msg){
		$('#inform_message').html(msg);
		$('#inform_loader').hide();

	}}); 	
}