var PRISA=PRISA||{};(function(a){'use strict';var b=!1,c=!1,d=[],e="//pxlctl.elpais.com/pxlctl.gif?m=1",f=-1,g={data:{uid:void 0,nickname:void 0,nombre:void 0,apellido1:void 0,nombre_bonito:void 0,avatar:void 0},dataWsUserInfo:{status:-1,id:{uid:void 0,nick:void 0,ts:void 0,nom:void 0,ap1:void 0,nb:void 0,avat:void 0}},init:function(a){var b=parseInt(1e7*Math.random()),d=new Image(1,1),f=this;d.src=1==a?e+"&w="+b:e+"&r="+a+"&w="+b,c=window.setTimeout(function(){c=!1,f.callListeners()},2e3),d.onload=function(){c&&(window.clearTimeout(c),f.callListeners())}},getData:function(a){return a&&"ws"==a?this.dataWsUserInfo:this.data},addListener:function(a,c,e){b?a.call(e,c&&"ws"==c?this.dataWsUserInfo:this.data):d.push({f:a,fmt:c,obj:e})},callListeners:function(){this.loadData(),b=!0,d.forEach(function(a){a.f.call(a.obj,a.fmt&&"ws"==a.fmt?this.dataWsUserInfo:this.data)},this)},loadData:function(){for(var a,b=!1,d=decodeURIComponent(document.cookie).split(";"),e=0;e<d.length;e++)if(a=d[e].trim(),"uid_ns="==a.substr(0,7)){b=!0;break}if(b){var f=a.substr(7).split("#");if(this.data.uid=f[0],this.data.nickname=f[1],this.dataWsUserInfo.status=1,this.dataWsUserInfo.id.uid=this.data.uid,this.dataWsUserInfo.id.nick=this.data.nickname,window.PEPuid=this.data.uid,window.PEPuname=this.data.nickname,f[3]){for(var g=[],h=f[3].match(/:[^|]+|[^:]+/g),j=0;j<h.length;j+=2)g[h[j]]=h[j+1].substr(1);this.data.nombre=this.decodeBase64ToUTF8(g[":NOM"]),this.data.apellido1=this.decodeBase64ToUTF8(g[":AP1"]),this.data.nombre_bonito=this.decodeBase64ToUTF8(g[":NB"]),this.data.avatar=this.getAvatar(this.data.nickname),this.dataWsUserInfo.id.nom=g[":NOM"],this.dataWsUserInfo.id.ap1=g[":AP1"],this.dataWsUserInfo.id.nb=g[":NB"],this.dataWsUserInfo.id.ts=g[":TS"],this.dataWsUserInfo.id.avat=this.data.avatar}}},decodeBase64ToUTF8:function(a){if(!a||""==a)return"";var b,c,d,e,f=[],g=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");g<a.length&&(b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a[g++]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a[g++]),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a[g++]),e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a[g++]),f.push(b<<2|c>>4),64!=d)&&!(f.push((15&c)<<4|d>>2),64==e);)f.push((3&d)<<6|e);return this.decodeBase64(f)},decodeBase64:function(a){for(var b=String.fromCharCode,c,d,e,f="",g=0;g<a.length;)c=a[g++],128>c?f+=b(c):191<c&&224>c?(d=a[g++],f+=b((31&c)<<6|63&d)):(d=a[g++],e=a[g++],f+=b((15&c)<<12|(63&d)<<6|63&e));return f},getAvatar:function(a){if(!a||""==a)return"";for(var b=[0,0],c=0;c<a.length;c++)b[c%2]+=a[c].charCodeAt(0);for(var d=(b[0]%16).toString(16).toUpperCase();1>d.length;)d="0"+d;for(var e=(b[1]%256).toString(16).toUpperCase();2>e.length;)e="0"+e;var f="/miperfil/avatares/"+d+"/"+e+"/"+a+".jpg";return f},trackAgain:function(){if(!(0>f)){var a=parseInt(1e7*Math.random()),b=new Image(1,1);b.src=1==f?e+"&w="+a:e+"&r="+f+"&w="+a}}};g.loadData();var h=document.getElementsByTagName("script"),i=h[h.length-1],j=/i=(\d+)/.exec(i.src);j&&(f=j[1],g.init(f)),a.user=g})(PRISA);