function comprueba(Objeto){
    if (Objeto.options[Objeto.selectedIndex].value != 0) {
        document.e_p.submit()
    }
}

function comprueba_siguiente(Tipo, valor, manga){
    var suma = 1
    if (Tipo == 1){
        document.e_pp.partido.value = valor - 1 
    }
    if (Tipo == 2){
        document.e_pp.partido.value = valor + 1
    }
    document.e_pp.manga.value = manga
    document.e_pp.submit()
}

function nuevoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
		return xmlhttp;
}

function CargaPartidos(torneo){
    var selObj = document.getElementById('SelectManga');
    var selIndex = selObj.selectedIndex;
    var v_id = selObj.options[selIndex].value;
    var partidos;
	partidos = document.getElementById('Partidos');
	
    document.getElementById('SelectPartido').options.disabled = true;
    
    if (v_id > 0){
        ajax=nuevoAjax();
        ajax.open("GET", "./includes/consulta_partidos.asp?act=s_partidos&id_torneo=" + torneo + "&manga=" + escape(v_id),true);
	    ajax.onreadystatechange=function() {
		    if (ajax.readyState==4) {
		        document.getElementById('SelectPartido').options.disabled = false;
			    partidos.innerHTML = ajax.responseText;
		    }
	    }
	    ajax.send(null);
	}
}