/** * @author jchernandez */ var sendReq = getXmlHttpRequestObject(); var receiveReq = getXmlHttpRequestObject(); var mTimer; var vtEvntGrdd; var vsPathRemote; var vsRemoteFile; var vsGadgetPartidos = '
'; vsGadgetPartidos += ''; vsGadgetPartidos += ''; vsGadgetPartidos += ''; vsGadgetPartidos += ''; vsGadgetPartidos += ''; vsGadgetPartidos += ''; vsGadgetPartidos += ''; vsGadgetPartidos += ''; vsGadgetPartidos += '
- - -
'; vsGadgetPartidos += '
'; vsGadgetPartidos += '
'; vsGadgetPartidos += '
'; vsGadgetPartidos += '
'; vsGadgetPartidos += '
'; vsGadgetPartidos += ''; //thernandez - 21/02/2009 Se sustituye por un webservice en PHP. //vsGadgetPartidos += ''; vsGadgetPartidos += '
'; vsGadgetPartidos += '
'; vsGadgetPartidos += '
'; vsGadgetPartidos += ' '; //*** Rutina para ejecutar la consulta del archivo XML que tiene el nombre del componente y si se despliega o no function getRemoteControl() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", 'http://femexfut.org.mx/PortalV2/webservices/ws_RemoteControl.aspx?pnRdn=' + Math.random(), true); //*** Cuando conteste el archivo XML pasamos el control a la rutina que se encarga de verificar las instrucciones remotas receiveReq.onreadystatechange = function() { handleRemoteControl(receiveReq) } receiveReq.send(null); } } function getRemoteControl2(psPathRemote, psRemoteFile) { if(vsPathRemote==null) { vsPathRemote = psPathRemote; } if(vsRemoteFile==null) { vsRemoteFile = psRemoteFile; } if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", 'http://femexfut.org.mx' + vsPathRemote + '/ws_RemoteControl.aspx?psRemoteControl=' + vsRemoteFile + '&pnRdn=' + Math.random(), true); //*** Cuando conteste el archivo XML pasamos el control a la rutina que se encarga de verificar las instrucciones remotas receiveReq.onreadystatechange = function() { handleRemoteControl(receiveReq) } receiveReq.send(null); } } //*** Rutina que interpreta el contenido del XML y enciendo o apaga el(los) componente(s) especificado(s) function handleRemoteControl(poRespuestaXML) { if (poRespuestaXML.readyState == 4) { switch(poRespuestaXML.status) { case 200: //*** Extraemos un arreglo de los componentes especificados en el XML if(poRespuestaXML.responseXML!=null){ var vaoElementos = poRespuestaXML.responseXML.getElementsByTagName('Elemento'); for(var vnTmp=0; vnTmp 400) { mTimer = setTimeout('getRemoteControl();', 30000); } } } } //*** Rutina para generar el div dinamico function f_MakeComponent(psNombreComponente, psDestino, psParametros) { var vsNombrePartidos = psNombreComponente.substring(0,10); if (vsNombrePartidos=='MxMPartido'){ //alert('Si es partido: ' + vsNombrePartidos); var voComponent = f_CreaObjetoHTML(psNombreComponente + '_' + psDestino, 'div', psDestino); }else{ if(xGetElementById(psDestino)!=null) { var voComponent = f_CreaObjetoHTML(psNombreComponente + '_' + psDestino, 'div', psDestino); var vsNmbrPrmtr = psNombreComponente + '_GADGET_Parametros'; vsNmbrPrmtr = vsNmbrPrmtr.toUpperCase(); var voComponentParams = f_CreaObjetoHTML(vsNmbrPrmtr, 'div', psDestino); xDisplay(voComponentParams, 'none'); voComponentParams.innerHTML = psParametros; xShow(voComponent); procesaXML('http://femexfut.org.mx/portalv2/webservices/ws_universal.aspx', f_MakeDIVFromXML, '_Query=Gadgets/Gdgt_' + psNombreComponente + '.txt' + '&_Objeto=' + psNombreComponente + '_Gadget', psNombreComponente + '_Gadget', psNombreComponente + '_' + psDestino); } } } function f_MakeDIVFromXML(poRespuestaXML, poObjetoDiv, psDestino) { //alert(poObjetoDiv); var vaoElementosGrupo = poRespuestaXML.responseXML.getElementsByTagName('Elementos'); var vaoElementos = poRespuestaXML.responseXML.getElementsByTagName('Elemento'); for(var vnTmp=0; vnTmp0){ var MyJS = document.createElement('script'); MyJS.setAttribute('type','text/javascript'); MyJS.setAttribute('id', jsName); MyJS.setAttribute('src','http://femexfut.org.mx/TXT/Gadgets/js/' + jsName); MyJS.onload = function() { try { setTimeout(eval('f_' + psNombreGadget + '_OnStart').apply(), 1000); } catch(err) { } } document.getElementsByTagName('head')[0].appendChild(MyJS); } } function f_LoadJS(jsName, psNombreGadget) { if(jsName.length>0){ var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.setAttribute('id', jsName); //*** En IE aplica de esta manera la ejecución de una funcion cargada dinamicamente script.onreadystatechange = function() { if(script.readyState == 'loaded' || script.readyState == 'complete') { try { var args = [xGetElementById(psNombreGadget + '_PARAMETROS').innerHTML]; eval('f_' + psNombreGadget + '_OnStart').apply(window, args); } catch(err) { } } } //*** Esto es en el modo de Firefox, etc. script.onload = function() { try { var args = [xGetElementById(psNombreGadget + '_PARAMETROS').innerHTML]; eval('f_' + psNombreGadget + '_OnStart').apply(window, args); } catch(err) { } } //script.src= 'http://femexfut.org.mx/webservices/ws_includefile.aspx?psPath=/TXT/Gadgets/js/' + jsName; script.setAttribute('src','http://femexfut.org.mx/TXT/Gadgets/js/' + jsName + '?pnRdn=' + Math.random()); head.appendChild(script); } } function f_UnloadJS(jsName) { if(document.getElementById(jsName)!=null) { var s = document.getElementById(jsName); document.getElementsByTagName('head')[0].removeChild(s); } } //*** Rutina para desaparecer el div dinamico function f_KillComponent(psNombreComponente, psDestino) { if((xGetElementById(psDestino)!=null) && (xGetElementById(psNombreComponente + '_' + psDestino)!=null)) { try { f_BorraObjetoHTML(psNombreComponente + '_' + psDestino, psDestino); f_UnloadJS('Gdgt_' + psNombreComponente + '.js') } catch(err) { } } } function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { //*** document.getElementById("MXM").innerHTML = 'Status: Cound not create XmlHttpRequest Object.' + 'Consider upgrading your browser.'; } } function f_Nada() { return true; } function f_MaxMinMxM(pnIDPartido, pnTipo){ // Utilizando funciones de la librería x_event.js, x_core.js var ifrMXM = xGetElementById('ifrMxM' + pnIDPartido); var objdivMXMPartido = xGetElementById("divMxMPartido" + pnIDPartido); switch(pnTipo){ case 1: if(objdivMXMPartido.style.zIndex != 666) { //document.getElementById('spanLtroMxMn').innerHTML = 'Minimizar' document.getElementById('imgMaxMin' + pnIDPartido).src = '/portalv2/css/img/mxm/minimizar.png'; objdivMXMPartido.style.position = "absolute"; objdivMXMPartido.style.zIndex = 666; xMoveTo(objdivMXMPartido, xScrollLeft(), xScrollTop()); xResizeTo(objdivMXMPartido, xClientWidth()-20, xClientHeight()-60); xMoveTo(ifrMXM, xScrollLeft(), xScrollTop()); xResizeTo(ifrMXM, xClientWidth()-20, xClientHeight()-100); } else { //document.getElementById('spanLtroMxMn').innerHTML = 'Maximizar' document.getElementById('imgMaxMin' + pnIDPartido).src = '/portalv2/css/img/mxm/maximizar.png'; objdivMXMPartido.style.position = "static"; objdivMXMPartido.style.zIndex = 10; objdivMXMPartido.style.width = "100%"; objdivMXMPartido.style.height = "285px"; ifrMXM.style.width = "100%"; ifrMXM.style.height = "180px"; } break; case 2: //ifrMXM.src="aspx/WEB_Noticias.aspx?pnIDNtca=" + pnIDNoticia; break; } }