



function abrirEnlaceExterno(enlace){
	
	if (startswith(enlace,'http://www.aviva.es')){
		window.open(enlace,'Aviva','resizable=yes,width=800, height=600, menubar=yes, location=yes, scrollbars=yes,status=yes,toolbar=yes');
	}else{
		ventana = window.open("/opencms/opencms/corporativa/comun/popupLeavingWeb.html?enlace="+enlace,
			 "LeavingWeb", "width=475, height=235, menubar=no, location=no, scrollbars=no");
		if(ventana==null)
		{
			
			if(confirm("La configuración de su explorador ha bloqueado una ventana emergente necesaria para el funcionamiento de esta web. ¿Desea más información?"))
			{
				document.location.href="/corporativa/utilidades/ayuda/instrucciones/index.html";
				
			}
		}
		else
		{
			ventana.focus();
		}
	}
	return false;
}

function abrirEnlaceInterno(enlace){
	if (endswith(enlace,'.pdf')){
		ventana= abrirEnlaceInternoPopup(enlace);
	}
	else{
		document.location.href=enlace;
	}
	return false;
}

function abrirEnlaceInternoPopup(enlace){
	ventana = window.open(enlace,"Aviva", "width=800, height=600, resizable=yes, menubar=yes, location=yes, scrollbars=yes");
	if(ventana==null)
		{
			
			if(confirm("La configuración de su explorador ha bloqueado una ventana emergente necesaria para el funcionamiento de esta web. ¿Desea más información?"))
			{
				document.location.href="/corporativa/utilidades/ayuda/instrucciones/index.html";
				
			}
		}
		else
		{
			ventana.focus();
		}
	return false;
}

function endswith(cadena,s) {
	return cadena.lastIndexOf(s)==cadena.length-s.length;
}

function startswith(cadena,s) {
	return cadena.indexOf(s)==0;
}

function abrirEnlaceAvivaOnline(enlace){
	ventana = window.open(enlace,"AvivaOnline");
	if(ventana!=null)
	{
		
		ventana.focus();
	}
	
	//return false;
}


