function Rinventario() { new Ajax.Request(WEB_ROOT+'/ajax/reportes-inventario.php', { method:'post', parameters:$('formInven').serialize(true), onLoading: function(req){ $('loadBusqueda').show(); $('contenido').innerHTML = ""; }, onSuccess: function(transport){ var response = transport.responseText || "no response text"; $('loadBusqueda').hide(); $("contenido").innerHTML = response; TableKit.reloadTable('tblReporte'); }, onFailure: function(){ alert('Something went wrong...') } }); } function ExportInv() { $('formInven').submit(); return true; } function LoadSubcats(){ var catId = $("prodCatId").value; $("enumSubcats").innerHTML = ''; new Ajax.Request(WEB_ROOT+'/ajax/reportes-inventario.php',{ method:'post', parameters: {type:"loadSubcats", prodCatId:catId}, onLoading: function(){ $("enumSubcats").innerHTML = LOADER; }, onSuccess: function(transport){ var response = transport.responseText || "no response text"; var splitResponse = response.split("[#]"); $("enumSubcats").innerHTML = ""; if(splitResponse[0] == "ok") $("enumSubcats").innerHTML = splitResponse[1]; }, onFailure: function(){ alert('Something went wrong...') } }); }//LoadSubcats function ShowDesc(id){ var resp = $("totales"+id).style.display; var status; var txt; if(resp == "none"){ status = ""; txt = "[-]"; }else{ status = "none"; txt = "[+]"; } $("totales"+id).style.display = status; $("showHide"+id).innerHTML = txt; } function ShowHideGral(){ var chks = document.getElementsByName('idS[]'); var resp = $("showHideG").innerHTML; if(resp == "[+] TODOS"){ status = ""; txt = "[-]"; txtG = "[-] TODOS" }else{ status = "none"; txt = "[+]"; txtG = "[+] TODOS"; } for (var i=0; i