// Redirecciona a la url dada en el destino dado.
function redireccionar(url, destino) {
	if(!destino)	// Valor por defecto.
		eval('location.href = "' + url + '"');
	else
		eval(destino + '.location.href = "' + url + '"');
}

// Muestra el numero de caracteres que nos quedan al escribir un SMS.
function numCaracteresSMS(campo_texto, span_mensaje) {
	if(campo_texto.value.length > 160) {
		campo_texto.value = campo_texto.value.substr(0, 160);
	}
	
	var caracteres_restantes = 160 - campo_texto.value.length;
	document.getElementById(span_mensaje).innerHTML = caracteres_restantes;
}

// Carga un iFrame
function cargarIFrame(nombre_iframe, url) {
	document.getElementById(nombre_iframe).src = url;
}
