// JavaScript Document
window.onload = cargaPrevia;
function cargaPrevia(){
	externalLinks();
}
function externalLinks(){
	if (!document.getElementsByTagName) return;
	var links = document.getElementsByTagName("a");
	for (var i=0; i<links.length; i++){
		var vinculo = links[i];
		if (vinculo.getAttribute("href") && vinculo.getAttribute("rel") == "externo"){
			vinculo.target = "_blank";
			if (vinculo.title!=""){
				vinculo.title = vinculo.title+" (este enlace se abrirá en una nueva ventana)";
			}else{
				vinculo.title = "este enlace se abrirá en una nueva ventana";
			}
		}
	}
	
	var eTexto = document.getElementsByTagName("input");
	for (var i=0; i<eTexto.length; i++){
		var etiqueta = eTexto[i];
		if (etiqueta.getAttribute("type") == "text"){
			if (etiqueta.getAttribute("readonly")){
				if (!etiqueta.id){
					etiqueta.id = etiqueta.name;
				}
				document.getElementById(etiqueta.id).style.background = '#EEEEEE';
			}
		}
	}
}