function ampliarImagen(sSrc){
      var windowImagen;
      windowImagen = window.open("popups/popupImagenAmpliada.asp?src="+sSrc,"","width=560,height=500,top=10,left=10,scrollbars=yes");	
}

function verTienda(sURL){	
	window.open("/popups/tiendas.asp?id="+sURL,"","width=465,height=250,scrollbars=no,resizable=no");	
}

function cambiarHorariosActividad(idActividad) {
    if (!enProceso && http) {
       var url = "consultarHorarios.asp?idProducto="+ idActividad;
       http.open("GET", url, true);
       http.onreadystatechange = handleHttpResponse;
       enProceso = true;
       http.send(null);
    }
}

function handleHttpResponse() { 
    if (http.readyState == 4) { 
       if (http.status == 200) { 
          if (http.responseText.indexOf('invalid') == -1) {
             // alert(http.responseText);
             // Armamos un array, usando la coma para separar elementos
             resultsTemp = http.responseText.split(';');
			 
			 var iMinP = resultsTemp[0].split("_")[0];
 			 var iMaxP = resultsTemp[0].split("_")[1];
			 
			 document.getElementById("iMinP").value=iMinP;
			 document.getElementById("iMaxP").value=iMaxP;			 
             
			document.getElementById("horario_requerido_texto").length = 0;
         	
			results = resultsTemp[1].split(",");
             for(i=0;i<results.length;i++){
             	datos = results[i].split("_");
             	var opt = new Option(datos[1],datos[1]);
             	
             	document.getElementById("horario_requerido_texto")[i] = opt;
             }
             enProceso = false;
          }
       }
    }
}

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;
}

// Función que almacena en campos de tipo hidden del formulario los datos de la actividad que se desea eliminar.
function eliminarActividad(iIdProducto, dFecha, iHora, iIdIdioma)
{
	document.getElementById("idProducto").value = iIdProducto;
	document.getElementById("fecha").value = dFecha;
	document.getElementById("hora").value = iHora;
	
	if (iIdIdioma == 1)
		document.getElementById("fResumen").action = '/c/8/4/Eliminar-actividad';
	else
		document.getElementById("fResumen").action = '/c/8/4/Delete-activity';
	
	document.getElementById("fResumen").submit();
}
