function goUrl(url) {
	if (url.indexOf('http') == 0) {
		window.location.href = url;
	} else {
		window.location.href = baseurl + url;
	}	
}

function askGoUrl(url, msg) {
	if (confirm(msg)) {
		if (url.indexOf('http') == 0) {
			window.location.href = url;
		} else {
			window.location.href = baseurl + url;
		}
	}
}

function popUp(url, width, height) {
	var options = 'location=no,menubar=no,resizable=yes,scrollbars=yes,status=0,toolbar=no,width=' + width + ',height=' + height;
 
	PosX = (screen.width - width) / 2;
	PosY = (screen.height - height) / 2;

	if (url.indexOf('http') == 0) {
		win = window.open(url, 'PopUp', options);
	} else {
		win = window.open(baseurl + url, 'PopUp', options + ",left=" + PosX + ",top=" + PosY+",screenX=" + PosX +",screenY=" + PosY);
	}	
}

function waitSend(button) {
	if(button.form.onsubmit()) {
		button.disabled = true;
		button.value = 'Invio in corso...';
	    button.form.submit();
	}
}

function showMessages(msgs) {
	alert(msgs);
}

function showErrors(errors) {
	alert('Si sono verificati degli errori:\n' + errors);
}
