var refresh=120*1000; var actdate=0; var alerta_anterior=''; var refreshnews=1; function loadalert() { page='alert.php'; usediv='alerta_informativa'; page1='alert_score.php'; usediv1='alert_score'; if (rppsitepage=='portada') { try {xmlhttp_alerta = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject('Microsoft.XMLHTTP');} catch (e) { } try { document.getElementById(usediv1).innerHTML = ''; xmlhttp_alerta.onreadystatechange = function() { if ((xmlhttp_alerta.readyState == 4) && (xmlhttp_alerta.status == 200)) { document.getElementById(usediv1).innerHTML = xmlhttp_alerta.responseText; } } } catch (e) { } xmlhttp_alerta.open('GET', page1); xmlhttp_alerta.send(null); document.getElementById('idrefreshnews').className='display_off'; } if (rppsitepage=='portada'||rppsitepage=='portada-cronologia'||rppsitepage=='portada-minutoaminuto'||rppsitepage=='portada-imagenes') { try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { } try { document.getElementById(usediv).innerHTML = ''; } catch (e) { } xmlhttp.onreadystatechange = function(){ if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) { alertas=xmlhttp.responseText; if (alertas!='') document.getElementById(usediv).innerHTML =alertas; }else document.getElementById(usediv).innerHTML = ''; }; xmlhttp.open("GET", page); xmlhttp.send(null); } if (actdate==0) { try {xmlhttpX = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { } xmlhttpX.onreadystatechange = function(){ if ((xmlhttpX.readyState == 4) && (xmlhttpX.status == 200)) { var response = xmlhttpX.responseText; var update = new Array(); if (response.indexOf('|' != -1)) { update = response.split('|'); if (update.length>=4) { try { document.getElementById('fechaactual').innerHTML = '

' + update[3]+'

'; } catch(e) { } try { if (update[8]==" ...") update[8]=""; var part1='Radio en vivo'; document.getElementById('programaenvivo').innerHTML = part1;} catch(e) { } if (refreshnews==1) $.cookie('nuevas-noticias', update[11],{expire : 30}); if (refreshnews%3==0&&$.cookie('nuevas-noticias')!=update[11]) { document.getElementById('idrefreshnews').className='wrap_refresh_portada bg_rojo'; $.cookie('nuevas-noticias', update[11],{expire : 30}); } refreshnews++; } } } }; xmlhttpX.open("GET", 'timedate.php'); xmlhttpX.send(null); } actdate++; if (rppsitepage=='portada') { if (actdate>=2) actdate=0; } setTimeout('loadalert()', refresh); return false; } loadalert(); chkdevice();