function mpl_content(content){var div=document.getElementById('cafenews.pl#cvb64mnc8vg4jd8gksd653jkadg7j6');if(div)div.innerHTML=content||'';}function mpl_event(args){var qs='';for(var x in args)qs+='&_'+encodeURIComponent(x)+'='+encodeURIComponent(args[x]);mpl_load(mpl_getUrl(mpl_getCookie('MPL'))+'&_=event'+qs);}function mpl_getCookie(name){var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1);if(c.indexOf(name+'=')==0){var content=c.substring(name.length+1),result={};try{while(content.length>0){var nameLength=parseInt(content.substr(0,2),16),name=content.substr(2,nameLength),valueLength=parseInt(content.substr(2+nameLength,2),16),value=content.substr(2+nameLength+2,valueLength);content=content.substr(2+nameLength+2+valueLength);result[name]=value;}}catch(e){return null;}return result;}}return null;}function mpl_getQueryString(){var result={};if(window.location.search&&(window.location.search.length>0)){var qs=window.location.search.substring(1).split('&');for(var i=0;i<qs.length;i++){if(qs[i].length>0){var pair=qs[i].split('='),key=pair[0],value=pair[1];if(key.length>0)result[key]=(value&&(value.length>0))?decodeURIComponent(value).toString():new String();}}}return result;}function mpl_getUrl(cookie){var url='http://webservices.cafenews.pl/mpl/Page.js?d='+new Date().getTime();if(document.referrer&&(document.referrer.length>0))url+='&r='+encodeURIComponent(document.referrer);var qs=mpl_getQueryString();if(qs.pwid&&(qs.pwid.length>0))url+='&ru='+encodeURIComponent(qs.pwid);if(cookie&&cookie.u)url+='&u='+cookie.u;return url;}function mpl_load(url,interval){setTimeout(function(){var div=document.getElementById('cafenews.pl#cvb64mnc8vg4jd8gksd653jkadg7j6');if(div){div.innerHTML='';var script=document.createElement('script');script.setAttribute('type','text/javascript');script.src=url;div.appendChild(script);}},interval||0);}(function(){var cookie=mpl_getCookie('MPL');if(cookie&&!cookie.u&&cookie.rd&&(parseInt(cookie.rd)>=new Date().getTime()))mpl_content();else mpl_load(mpl_getUrl(cookie),5000);})();