
function AnularPeticion(){ http.abort(); }

function handleHttpResponse() { 
    if (http.readyState == 4) {
	clearTimeout(timerAnular); 
       if (http.status == 200) { 
          if (http.responseText.indexOf('invalid') == -1) {
             
	     document.getElementById("ParteImagen").innerHTML=http.responseText;
             enProceso = false;
          }
       }
	else
	{
	
	}
    }
}

function CambiaProducto() {
    if (!enProceso && http) {
       
       var url = "Include/MuestraProductos.asp";
	
       http.open("GET", url, true);
       http.onreadystatechange = handleHttpResponse;
       enProceso = true;
       http.send(null);
    }
    else
    {
	
    }
}





function getHTTPObject() {
    var xmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
       try {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
          try {
             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) { xmlhttp = false; }
       }
    @else
    xmlhttp = false;
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
       try {
          xmlhttp = new XMLHttpRequest();
       } catch (e) { xmlhttp = false; }
    }
    return xmlhttp;
}

var enProceso = false; 
var http = getHTTPObject(); 


var timerAnular = setTimeout("AnularPeticion()", 10000);

window.setInterval("CambiaProducto() ",10000); 

