function pintar(elem) {
	elem.focus();
	elem.select();
}
function validEmail(str){
	var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!str.match(emailRegEx)) {
		return false;
	}
	else {
		return true;
	}
}
function notEmpty(str) {
	var re = /.+/;
	if(!str.match(re)) {
		return false;
	}
	else {
		return true;
	}
}
function validPass(str) {
	var re = /^\w{8,}$/;
	if(!str.match(re)) {
		return false;
	}
	else {
		return true;
	}
}
function validUsername(str) {
	var re = /^[a-z][\da-z_]{6,22}[a-z\d]$/;
	if(!str.match(re)) {
		return false;
	}
	else {
		return true;
	}
}
function pintarTrAlt(table) {
	var trs = $(table).find('tbody tr');
	for (i = 0; i < trs.length; i++) {
		if (i % 2 == 0) {
			$(trs[i]).addClass('alt');
		}
		else {
			$(trs[i]).removeClass('alt');
		}
	}
}
function modificarVinculos(elems, value) {
	$(elems).each(function(i){
		var href = $(this).attr("href");
		href += "&link="+value;
		$(this).attr("href", href);
	});
}