
function validate_formmail(f)
 {				
	required = 0;
	wymagane = $(".required_field");
	$.each(wymagane, function () {
		title = $(this).attr('title');
		wartosc = $(this).val();
		if(wartosc.length < 3)
		 {
			alert('Wypelnij pole obowiązkowe: '+title);
			required++;
		 }				
	 });	 
	
	if(required > 0)
	 {
		return false;
	 }
 }

function MailIsValid(Email) 
{ 
	var Pattern = /^[a-z0-9-_]+(\.[a-z0-9-_]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; 
	return (Pattern.test(Email)) ? true : false; 
} 

function testuj_email(f) {			
  if (!MailIsValid(f.newsletter_add.value)) { alert("Niepoprawny adres e-mail"); return false; }			 
}

function usun (link)
{
	komunikat = "Czy napewno chcesz to zrobić?"
	if (confirm(komunikat))	document.location.href = link;
}

function ask (link, komunikat)
{
	
	if (confirm(komunikat))	document.location.href = link;
}

function tooltip()
 {
	
	xOffset = 10;
	yOffset = 20;
	
	$(".pokazOpis").hover(function(e){	
		alert("XXXXX");			  
		t = $(this).attr('title');
		baseTitle = t;
		$(this).removeAttr('title');
			  
		$("body").append("<p id='tooltipA'>"+ t +"</p>");
		
		$("#tooltipA")
		.css("top",(e.pageY - xOffset) + "px")
		.css("left",(e.pageX + yOffset) + "px")
		.fadeIn("fast");
		
		
	},
	function(){
		title = baseTitle;
		$(this).attr('title', title);
		$("#tooltipA").remove();				
				
	});	
	
	$(".pokazOpis").mousemove(function(e){
		$("#tooltipA")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});
 }

tooltip();