<!-- 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 atags=document.getElementsByTagName('a'); 
  		for (i=0;i<atags.length;i++){ 
			if(document.getElementById('blank'+i) || document.getElementById('DOCblank'+i)){
			 if(document.getElementById('blank'+i)){
				  newBlank=document.getElementById('blank'+i);
				  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"
				  }
				   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;
			  		};
			 }
			 if(document.getElementById('DOCblank'+i)){
				 newBlank=document.getElementById('DOCblank'+i);
				 enlacesExternosDOC.push(newBlank.href)
				 newBlank.href="#";
				 newBlank.title=newBlank.title + ", abre en ventana nueva"
				 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;
			  		};
			 }
			 
			}
		}
	}
	
	
//-->
