// Abrir Ventanas nuevas
function AbrirVentana_blank(lurl) 
{
	winprops = 'height='+screen.height+',width='+screen.width+',top=0,left=0,toolbar=yes,location=yes,directories=yes,menubar=yes,scrollbars=yes,resizable=yes,status=yes';

	var w = window.open(lurl,'',winprops);
	if (parseInt(navigator.appVersion) >= 4) { w.window.focus(); }
}	

// Coberturas
function BorrarTel(capa)
{
	document.getElementById(capa).value='';
}

function EsNumerico(idobj)
{
	var chr; 
	if	(idobj.value==null || idobj.value.length==0)
	{
		return false;
	}
	for	(var i=0;i<idobj.value.length;i++)
	{ 
		chr=idobj.value.substring(i,i+1); 
		if	(chr<"0"||chr>"9")
		{
			return false;
		}
	} 
	return true;
} 

function NumDigitos(idobj)
{
	var chr; 
	if	(idobj.value.length != 9)
	{
		return false;
	}
	else
	{
		return true;
	} 
} 

function cob_tel(capa)
{

	if	((document.getElementById(capa).value == '') ||
		(document.getElementById(capa).value == 'Nº Tlfno'))
	{ 
		alert('Por favor, introduzca un teléfono a consultar.'); 
		document.getElementById(capa).focus(); 
		return;
	}
	else if (!valida_telefono(document.getElementById(capa)) || valida_movil(document.getElementById(capa)))
	{
		alert('El número de teléfono de contacto es incorrecto');
		document.getElementById(capa).focus();
		return;
	}
	
	//AbreAsistente('https://www.movistar.es/on/io/recursos/emergente/index.htm?pagina_central=/on/io/es/pie/coberturas/consulta/imagenio_d.html&telefono='+document.getElementById(capa).value, '', '630', '270', '');

	top.document.location.href='https://www.movistar.es/on/io/navegacion/on.html?servicio=entrada&entrada=rd_coberturas_smd&menu_izq=1&uri=/on/io/es/pie/coberturas/consulta/imagenio.html&telefono='+document.getElementById(capa).value;
}

