<!--/*--><![CDATA[//><!--
var READY_STATE_UNINITIALIZED = 0;
var READY_STATE_LOADING = 1;
var READY_STATE_LOADED = 2;
var READY_STATE_INTERACTIVE = 3;
var READY_STATE_COMPLETE = 4;
var peticion_http;
var idProducto;
var idContainer;

function cargaContenido(url, metodo, funcion) 
{
	peticion_http = inicializa_xhr();
	if(peticion_http) 
	{
		peticion_http.onreadystatechange = funcion;
		peticion_http.open(metodo, url, true);
		//peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		//var query_string = obtenerQueryString();
		peticion_http.send(null);
	}
}

function inicializa_xhr() 
{
	if(window.XMLHttpRequest) 
	{
		return new XMLHttpRequest();
	}
	else if(window.ActiveXObject) 
	{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function procesaRespuesta() 
{
	if(peticion_http.readyState == READY_STATE_COMPLETE) 
	{
		if(peticion_http.status == 200) 
		{
			document.getElementById(idContainer).innerHTML = peticion_http.responseText;
		}
	}
}

function obtenerPrecio(id, contenedor) 
{
	idProducto = id;
	idContainer = contenedor;
	cargaContenido("getPrecio.aspx?id=" + id, "GET", procesaRespuesta);
}
//--><!]]>
