$(function() {
	$('.blank').click(function() {
		window.open($(this).attr('href'));
		return false;
	});
});

function trim(stringa) {
    while (stringa.substring(0, 1) == ' ') {
        stringa = stringa.substring(1, stringa.length)
    }
    while (stringa.substring(stringa.length - 1, stringa.length) == ' ') {
        stringa = stringa.substring(0, stringa.length - 1)
    }
    return stringa
}
function validEmail(text) {
    if (text.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/)) return true;
    return false
}
function validPhone(text) {
    if (text.match(/^\+?[0-9\.-\/ ]+$/)) return true;
    return false
}
function validNumeric(text) {
    if (text.match(/^[0-9]+$/)) return true;
    return false
}
function validPrice(text) {
    if (text.match(/^[0-9]+[\.,]{0,1}[0-9]+$/)) return true;
    return false
}
function validString(text) {
    if (text.match(/^[a-zA-Z]+$/)) return true;
    return false
}
function isNumeric(text) {
    if (text.match(/^[0-9]+$/)) return true;
    return false
}
function verifyD(textVuoto, textError) {
	if($.trim($('#emailForm').val()) == '') {
		alert(textVuoto);
		$('#emailForm').focus();
		return false;
	}
	else if(!validEmail($('#emailForm').val())) {
		alert(textError);
		$('#emailForm').focus();
		return false;
	}
	$('#sendMailing').submit();
}