<!-- Coments for explorers under 4 versions
/****************************************************

	FUNDACIÓN TELEFÓNICA
	Init 9-2008
	
	Author: Daniel Segovia
	Company: RENOVATIO COMUNICACION
			 www.renovatio-comunicacion.com

*****************************************************/

/*####################################################################

	Funciones para DIV Objects

#####################################################################*/
	
		
	/*--------------------------------------------------------
		Añadimos el evento de inicio
	---------------------------------------------------------*/
	function addEvent(obj, evType, fn){
		 if (obj.addEventListener){
		   obj.addEventListener(evType, fn, false);
		   return true;
		 } else if (obj.attachEvent){
		   var r = obj.attachEvent("on"+evType, fn);
		   return r;
		 } else {
		   return false;
		 }
	}
	addEvent(window, 'load', ponBlank);
	
	/*--------------------------------------------------------
		Función para abrir una página en blank
	---------------------------------------------------------*/
	var enlacesExternos=new Array();
	var enlacesExternosDOC=new Array();
	function ponBlank()
	{
		var cuantosB=0;
		var cuantosBDOC=0;
		var atags=document.getElementsByTagName('a'); 
  		for (i=0;i<atags.length;i++){ 
			if(atags[i].id.indexOf("blank")!=-1){
				if(atags[i].id.indexOf("DOC")!=0){
					atags[i].id="blank"+cuantosB;
					newBlank=document.getElementById("blank"+cuantosB);
					enlacesExternos.push(newBlank.href)
					newBlank.href="#";
					if(newBlank.title.indexOf(":")>0){
						  newBlank.title=newBlank.title.substr(0,newBlank.title.indexOf(":")) + " en ventana nueva:" + newBlank.title.substr(newBlank.title.indexOf(":")+1,newBlank.title.length);
					  }else{
						  newBlank.title=newBlank.title + " en ventana nueva"
					}
					cuantosB++;
					newBlank.onclick=function(){
						num=this.id.substr(this.id.indexOf("k")+1,this.id.length)
						//Esto es más elegante pero no funciona en FireFox:
						//window.open(eval(this.id+".href")) 
						//Abrimos una nueva ventana 
						window.open(enlacesExternos[num])
						return false;
				  	};		
				}else{
					 atags[i].id="DOCblank"+cuantosBDOC;
					 newBlank=document.getElementById("DOCblank"+cuantosBDOC);
					 enlacesExternosDOC.push(newBlank.href)
					 newBlank.href="#";
					 newBlank.title=newBlank.title + ", abre en ventana nueva"
					 cuantosBDOC++;
					 newBlank.onclick=function(){
						num=this.id.substr(this.id.indexOf("k")+1,this.id.length)
						//Esto es más elegante pero no funciona en FireFox:
						//	window.open(eval(this.id+".href")) 
						//Abrimos una nueva ventana 
						window.open(enlacesExternosDOC[num])
						return false;
					};
				}
			}
		
		}
	}
	
	
//-->
