addEvent(window,'load',inicializarEventos,false);

function inicializarEventos()
{
  var ob;
  for(f=1;f<=12;f++)
  {
    ob=document.getElementById('enlace'+f);
    addEvent(ob,'click',presionEnlace,false);
  }
}

function presionEnlace(e)
{
  if (window.event)
  {
    window.event.returnValue=false;
    var url=window.event.srcElement.getAttribute('href');
    cargarHoroscopo(url);     
  }
  else
    if (e)
    {
      e.preventDefault();
      var url=e.target.getAttribute('href');
      cargarHoroscopo(url);     
    }
}


var conexion1;
function cargarHoroscopo(url) 
{
  if(url=='')
  {
    return;
  }
  conexion1=crearXMLHttpRequest();
  conexion1.onreadystatechange = procesarEventos;
  conexion1.open("GET", url, true);
  conexion1.send(null);
}

function procesarEventos()
{
  var detalles = document.getElementById("detalles");
  if(conexion1.readyState == 4)
  {
    detalles.innerHTML = conexion1.responseText;
  } 
  else 
  {
    detalles.innerHTML = 'Cargando...';
  }
}

//***************************************
//Funciones comunes a todos los problemas
//***************************************
function addEvent(elemento,nomevento,funcion,captura)
{
  if (elemento.attachEvent)
  {
    elemento.attachEvent('on'+nomevento,funcion);
    return true;
  }
  else  
    if (elemento.addEventListener)
    {
      elemento.addEventListener(nomevento,funcion,captura);
      return true;
    }
    else
      return false;
}

function crearXMLHttpRequest() 
{
  var xmlHttp=null;
  if (window.ActiveXObject) 
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  else 
    if (window.XMLHttpRequest) 
      xmlHttp = new XMLHttpRequest();
  return xmlHttp;
}
//****************************************************
// Funciones para cargar los números de las fotos en el home
//****************************************************
var valor='0';

function writeEnlaces()
{
		document.write(''+
		'<link href="css/estilos.css" rel="stylesheet" type="text/css">'+
		'<table width="300">'+
		'<tr>'+
		'<td width="250">'+
		'Noticias m&aacute;s Relevantes'+
		'</td>'+
		'<td class="menu"><a href="includes/index_multinot.asp?cod=1" id="enlace1" width="10">1</a></td>'+
		'<td class="menu"><a href="includes/index_multinot.asp?cod=2" id="enlace2" width="10">2</a></td>'+
		'<td class="menu"><a href="includes/index_multinot.asp?cod=3" id="enlace3" width="10">3</a></td>'+
		'<td class="menu"><a href="includes/index_multinot.asp?cod=4" id="enlace4" width="10">4</a></td>'+
		'<td class="menu"><a href="includes/index_multinot.asp?cod=5" id="enlace5" width="10">5</a></td>'+
		'</tr>'+
		'<tr>'+
		'<td>'+
		'</td>'+
		'</tr>'+
		'</table>'+
		'<div id="detalles">'+
		'<div class="detalles">');
		writeNota();
		document.write(''+
		'</div>'+
		'</div>'+
		'');
}