function chkEmail(email) 
{
	var regEmail = /^([a-zA-Z0-9._-]{1,})@([a-zA-Z0-9._-]{1,})\.([a-zA-Z]{1,4})$/;
	if (!regEmail.test(email)) return false;
	else return true;
}

function Email(Name,what) 
{
	Form = document.getElementById("fNewsletter");
	/*Form = $(Name);*/
	if (!chkEmail(Form.email.value)) 
	{
		document.getElementById("komunikat").innerHTML = "Adres email jest niepoprawny!";
		/*$('komunikat').innerHTML = "Adres email jest niepoprawny!";*/
    }
	else 
	{
		advAJAX.get({
			url: "index.php?ajax=1&module=newsletter&akcja="+what+"&email="+Form.email.value,
			onInitialization : function() 
			{
				document.getElementById("komunikat").innerHTML = 'zapisujê';    
			},
			onSuccess : function(obj) 
			{
				document.getElementById("komunikat").innerHTML = obj.responseText;
				Form.email.value = '';
			},
			onError : function(obj) 
			{ 
				alert("Error: " + obj.status); 
			}
		});
    
    }
	
	return false;
}

function newsletter(oBj) 
{
	return false;
}

function clean(oBj) 
{
	oBj.value = '';
}