addEvent(window,'load',inicializarEventos,false);

function inicializarEventos()
{
  var ob;
  
  for(f=1;f<=1;f++)
  {
	//rgroup=document.getElementById('radPortatil');
	//for (var i=0; i<rgroup.length; i++)
	for (var i=0; i<5; i++)
	{
		//ob=rgroup[i];
		ob=document.frmPortatil.radPortatil[i];
		addEvent(ob,'click',presionEnlace, false);
	}
  }
}

function presionEnlace(e)
{
	var tipolaptop;
	//alert('aqui');
  if (window.event)
  {
		//alert('aqui 2');
		//rgroup=document.getElementById('radPortatil');
		//for (var i=0; i<rgroup.length; i++)
		for (var i=0; i<5; i++)
		{
			//if (rgroup[i].checked) {
			if (document.frmPortatil.radPortatil[i].checked) {
				//tipolaptop = rgroup[i].value;
				tipolaptop = document.frmPortatil.radPortatil[i].value;
			}
		}

		//window.event.returnValue=false;
		//    var url=window.event.srcElement.getAttribute('href');
		//var parametro = document.getElementById('str_login_SUAT').value;
		var url="http://servicios.speedy.com.pe/duostrios/laptops/ajaxcuotapedido.asp?strTipoLatop=" + tipolaptop;
		habilitagrp(tipolaptop);
		cargarHoroscopo(url);
		
  }
  else
    if (e)
    {
		//alert('aqui 3');
		//alert('aqui 1');
		//rgroup=document.getElementById('radPortatil');
		//for (var i=0; i<rgroup.length; i++)
		for (var i=0; i<5; i++)
		{
			//if (rgroup[i].checked) {
			if (document.frmPortatil.radPortatil[i].checked) {
				//tipolaptop = rgroup[i].value;
				tipolaptop = document.frmPortatil.radPortatil[i].value;
			}
		}   
		//alert(tipolaptop);
		//e.preventDefault();
		//var url=e.target.getAttribute('href');
		//var parametro = document.getElementById('str_login_SUAT').value;
		var url="http://servicios.speedy.com.pe/duostrios/laptops/ajaxcuotapedido.asp?strTipoLatop=" + tipolaptop;
		habilitagrp(tipolaptop);
		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('cuotapedido');
  //alert(navigator.appName);
  //alert(conexion1.readyState);
  if (navigator.appName == 'Netscape') {
		if(conexion1.readyState == 4)
		{
			detalles.innerHTML = conexion1.responseText;
		} 
		else 
		{
			if (conexion1.status == 200) detalles.innerHTML = conexion1.responseText;
			else detalles.innerHTML = 'Cargando...';
		}
  }
  else {
		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;
}