function attachEventListener(target, eventType, functionRef, capture) {
    if (typeof target.addEventListener != "undefined") {
        target.addEventListener(eventType, functionRef, capture);
    } else if (typeof target.attachEvent != "undefined") {
        target.attachEvent("on" + eventType, functionRef);
    } else {
        return false;
    }
    return true;
}

function target_blank() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	var i, enlace;
	for (i = 0; i < anchors.length; i++) {
		if (anchors[i].getAttribute("href") && anchors[i].getAttribute("rel") == "external") anchors[i].target = "_blank";
	}
}

attachEventListener(window, "load", target_blank, false);

// Imágenes en bloqueo (ampliaciones)
/*
$(document).ready( function() {
	$("a.bloqueo").click( function() {
		$.blockUI.defaults = { message: null, css: { padding: '0, 0, 0, 0', margin:	'0 0 0 0', width: '100%', height: '100%', top: '0', left: '0', textAlign: 'left', color: '#000', border: 'none', backgroundColor:'transparent', cursor: 'pointer' }, overlayCSS: { backgroundColor:'#000', opacity: '0.75'}, baseZ: 1000, centerX: true, centerY: true, allowBodyStretch: true, constrainTabKey: true, fadeOut: 400, applyPlatformOpacityRules: true };
		$.blockUI({ message: '<table width="100%" height="100%" onclick="$.unblockUI(); return false;"><tr><td width="100%" height="100%" valign="middle"><p style="text-align: center;"><img src="' + $(this).attr("href") + '" alt="" style="border: 10px solid #fff" /></p></td></tr></table>'});
	});
});
*/