function dologout(url)
{
	$.post(url + "/dologin.php", {"action":"logout"},function (data) { window.location.href = url + '/index.php'; });
}

function submitlogin()
{
	$('#loginform').submit();
}

function getSottocategoria()
{
	$('#sottocat').text('');
	$("#sottocat").load("categorie.php",{"action":"sottocategoria","name":$('#macrocat')[0].value,"index":$('#macrocat')[0].selectedIndex} );
}

function getProvincia()
{
	$.post("pagineprofessionisti.php", {"action":"provincia","name":$('#regione')[0].value},function(data)
			{
				$('#provincia').html(data);
			});

	return;
}

function getTipologia()
{
	$('#tipologia').text('');
	$("#tipologia").load("macrotipologie.php",{"action":"tipologia","name":$('#macrotipologia')[0].value,"index":$('#macrotipologia')[0].selectedIndex} );
}

function commenticb(response)  
{ 
	$('#testo')[0].value = '';
	window.location.reload();	
} 

function checkEmail(email) 
{
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if (filter.test(email))
		return true;

	return false;
}

function confirmdeletion()
{
	return(confirm("Sei sicuro di voler cancellare questo elemento?"));
}

