
if(typeof PLISTA=='undefined'||!PLISTA.path){var PLISTA={};PLISTA.path='http://farm.plista.com/';PLISTA.cdnpath='http://static.plista.com/';PLISTA.debug=false;var plista=PLISTA;}
PLISTA.path=PLISTA.path||((document.location.protocol==='https')?'https://farm.plista.com/':'http://farm.plista.com/');PLISTA.cdnpath=PLISTA.cdnpath||((document.location.protocol==='https')?'https://static.plista.com/':'http://static.plista.com/');PLISTA.widgetdatarequested=0;PLISTA.isIE6=/MSIE (5\.5|6\.)/.test(navigator.userAgent);PLISTA.isIE7=/MSIE (7\.)/.test(navigator.userAgent);PLISTA.isIE=PLISTA.isIE6||PLISTA.isIE7||/MSIE (8\.)/.test(navigator.userAgent);PLISTA.isIEquirksmode=(PLISTA.isIE&&(document.compatMode==='BackCompat'));PLISTA.isOpera=/Opera/.test(navigator.userAgent);PLISTA.isIncompatible=(function(){var i,ua=navigator.userAgent,incompatBrowsers=[/^Nokia/,/Opera Mini/,/Symbian/,/MSIE [45]\./];for(i=0;i<incompatBrowsers.length;i++){if(incompatBrowsers[i].test(ua)){return true;}}
return false;}());PLISTA.items=[];PLISTA.items.getByObjectId=function(objectid,domainid){var i,item;if(!domainid){domainid=PLISTA.domainid;}
for(i=0;i<PLISTA.items.length;i++){item=PLISTA.items[i];if((item.objectid==objectid)&&(!item.domainid||domainid==item.domainid)){return item;}}};PLISTA.lib={};PLISTA.options={objectidGenerator:'specCharsToUnderscore',autoinit:('1')?true:false,parserActive:false,sendItemDataAttributes:[]};if(!document.baseURI){document.baseURI=(function(){var b=document.getElementsByTagName('base')[0];if(b){return b.href;}else{return document.location.protocol+'//'+document.location.hostname+'/';}}());}
if(typeof String.prototype.trim==='undefined'){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};}
if(typeof String.prototype.deentityify==='undefined'){String.prototype.deentityify=(function(){var entity={quot:'"',lt:'<',gt:'>',amp:'&'};return function(){return this.replace(/&([^&;]*);/ig,function(a,b){var r=entity[b];return(typeof r==='string')?r:a;});};}());}
(function(ap){if(!ap.forEach){ap.forEach=function(fn){var thisp=arguments[1],i=0,len=this.length;for(;i<len;i+=1){if(i in this){fn.call(thisp,this[i],i,this);}}};}
if(!ap.map){ap.map=function(fn){var len=this.length,res=[],thisp=arguments[1],i=0;if(typeof fn!=="function"){throw new TypeError();}
for(;i<len;i+=1){if(i in this){res[i]=fn.call(thisp,this[i],i,this);}}
return res;};}
if(!ap.filter||/this\.each/.test(ap.filter.toString())){ap.filter=function(fn){var len=this.length,res=[],thisp=arguments[1],i=0,val;if(typeof fn!=="function"){throw new TypeError();}
for(;i<len;i+=1){if(i in this){val=this[i];if(fn.call(thisp,val,i,this)){res.push(val);}}}
return res;};}
if(!ap.indexOf){ap.indexOf=function(f){var l=this.length,i=arguments[1]||0;i+=(i<0)?l:0;for(i=Math.max(i,0);i<l;i+=1){if(this[i]===f){return i;}}
return-1;};}
if(!ap.reduce){ap.reduce=function(fn){var l=this.length,i=0,rv=arguments[1];if(arguments.length<2){do{if(i in this){rv=this[i++];break;}
if(++i>=l){throw new TypeError();}}
while(true);}
if(l===0&&arguments.length===1){throw new TypeError();}
for(;i<l;i+=1){if(i in this){rv=fn.call(null,rv,this[i],i,this);}}
return rv;};}}(Array.prototype));if(!Array.isArray){Array.isArray=function(a){return!!(a&&(typeof a==='object')&&(a instanceof Array));};}
if(!Object.hasOwnProperty('create')){Object.create=(function(){var F=function(){};return function(o){F.prototype=o;var c=new F();if(arguments[1]){throw new TypeError('Object.create: augmenting object not implemented, please dont use the second parameter');}
return c;};}());}
PLISTA.util={DOM:{addEventListener:function(elem,type,listener,useCapture){if((typeof elem!=='object')||(elem===null)){throw'Parameter needs to be DOM element';}
if((type==='DOMMouseScroll')&&(PLISTA.isIE||PLISTA.isOpera)){type='mousewheel';}
if(type==='tripleclick'){return PLISTA.util.DOM.addEventListener(elem,'click',PLISTA.util.DOM.onTripleClick(elem,listener));}
if(elem.addEventListener){elem.addEventListener(type,listener,(typeof useCapture!=='undefined'&&useCapture)?true:false);}else if(window.attachEvent){if(type==='load'&&elem!==window){elem.onreadystatechange=(function(){var f=function(){if(!f.hasRun&&(elem.readyState==='complete')||(elem.readyState==='loaded')){listener();f.hasRun=true;}};f.hasRun=false;return f;}());}else{elem.attachEvent('on'+type,listener);}}else{throw'cannot attach event';}},removeEventListener:function(elem,type,listener,useCapture){if((typeof elem!=='object')||(elem===null)){throw'Parameter needs to be DOM element';}
if((type==='DOMMouseScroll')&&(PLISTA.isIE||PLISTA.isOpera)){type='mousewheel';}
if(elem.removeEventListener){elem.removeEventListener(type,listener,(typeof useCapture!=='undefined'&&useCapture)?true:false);}else if(window.detachEvent){if(type==='DOMMouseScroll'){type='mousewheel';}
if(type==='load'&&elem!==window){elem.onreadystatechange=null;}else{elem.detachEvent('on'+type,listener);}}else{throw'Cannot attach event';}},textContent:function(elem){if(!elem){return false;}
if(PLISTA.isIE&&(elem.nodeType===3)){return elem.data.trim();}
return(elem.textContent||elem.innerText||'').trim();},setAttribute:function(elem,attr,value){if((PLISTA.isIE||PLISTA.isOpera)&&(attr==='style')){elem.style.cssText=value;}else if(PLISTA.isIE&&(attr==='class')){elem.className=value;}else{elem.setAttribute(attr,value);}},createElement:function(name,content){var newElem=document.createElement(name);if(!content){return newElem;}
if(name==='style'){newElem.type='text/css';if(PLISTA.isIE){newElem.styleSheet.cssText=content;}else{newElem.textContent=content;}}else if(name==='script'){newElem.type='text/javascript';if(PLISTA.isIE){newElem.text=content;}else{newElem.innerHTML=content;}}else{newElem.innerHTML=content;}
return newElem;},onTripleClick:function(elm,fn,timeout){var timer=0,cnt=0,click=function(evt){cnt+=1;if(((new Date()).getTime()-timer)>timeout){timer=(new Date()).getTime();cnt=1;}
if(cnt===3){cnt=0;fn();}};if(typeof fn!=='function'){throw'detectTripleClick wants callback function!';}
timeout=timeout||800;PLISTA.util.DOM.addEventListener(elm,'click',click);return click;},getAbsolutePosition:function(e){var x=0,y=0;if(typeof e.offsetParent!=='undefined'){while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent;}}
return{x:x,y:y};},getDimensions:function(e){var x=e.width||e.clientWidth,y=e.height||e.clientHeight;if(!x&&!y&&e.currentStyle){x=parseInt(e.currentStyle.width,10);y=parseInt(e.currentStyle.height,10);}
if(!x&&!y&&window.getComputedStyle){var cs=window.getComputedStyle(e,null);x=parseInt(cs.getPropertyValue("height"),10);y=parseInt(cs.getPropertyValue("width"),10);}
return{x:x,y:y};}},newEvent:function(subject,type){var listeners=[];return{subscribe:function(fn,scope,name){if(typeof fn!=='function'){throw'newEvent.subscribe: parameter no function';}
listeners.push({fn:fn,scope:scope,name:name});},unsubscribe:function(fn){var r=false;listeners.forEach(function(val,key,obj){if(val.fn===fn){obj.splice(key,1);r=true;}});return r;},fire:function(data){var i,length=listeners.length;for(i=0;i<length;i+=1){try{listeners[i].fn.apply(listeners[i].scope||window,[subject,data,type]);}catch(e){PLISTA.util.logger.log((typeof subject!=='undefined'?subject.toString()+': ':'')+'exception while triggering callback '+(listeners[i].name||i)+' for '+type+' event: '+(e.message||e));if(PLISTA.debug){throw e;}}}}};},logger:(function(){var messages=[],loggers={},getLogFn=function(logger,level){return function(msg){var o={message:msg,level:level,logger:logger,type:'log'};messages.push(o);if(PLISTA.debug){PLISTA.remotedata.getData(o);}};};messages.toString=function(){var result='',m;for(var i=0;i<this.length;i+=1){m=this[i];result+=m.logger+' '+m.level+':'+m.message+'\n';}
return result;};return{log:getLogFn('default','DEBUG'),getLogger:function(logger){if(!loggers[logger]){loggers[logger]={trace:getLogFn(logger,'TRACE'),debug:getLogFn(logger,'DEBUG'),info:getLogFn(logger,'INFO'),warn:getLogFn(logger,'WARN'),error:getLogFn(logger,'ERROR'),fatal:getLogFn(logger,'FATAL')};}
return loggers[logger];},getMessages:function(){return messages;}};}()),htmlEntities:(function(){var entity=[34,39,60,62];return function(s){for(var i=0;i<entity.length;i+=1){s=s.split(String.fromCharCode(entity[i])).join('&#'+entity[i]+';');}
return s;};}()),trim:function(s,numChar,p){numChar=parseInt(numChar,10);if(typeof s!=="string"){return"";}
s=s.trim();s=s.replace(/<[^>]*>/g,"");numChar+=s.length-PLISTA.util.realStrLength(s);if(numChar&&s.length>(numChar+(p?2:0))){s=s.slice(0,numChar);s=s.slice(0,Math.max(s.lastIndexOf("-")+1,s.lastIndexOf(" ")));if(p){s+='...';}}
return s;},realStrLength:function(s){var m=s.match(/&#\d+;/g);return m?m.reduce(function(prev,val){return prev+1-val.length;},s.length):s.length;},text_clean:function(str){var ta=document.createElement("textarea");ta.innerHTML=str.replace(/(<([^>]+)>)/ig,"");return ta.value;},loadCSS:function(content,media){var elm;if(/^https?\:\/\/.*/.test(content)){elm=document.createElement("link");elm.href=content;elm.rel="stylesheet";elm.type="text/css";}else{elm=PLISTA.util.DOM.createElement('style',content);}
if(media){PLISTA.util.DOM.setAttribute(elm,'media',media);}
document.getElementsByTagName("head")[0].appendChild(elm);},augment:function(obj){for(var n in obj){if(obj.hasOwnProperty(n)){this[n]=obj[n];}}
return this;},evalScriptTags:function(containerId){var e=document.getElementById(containerId),c='',s=0;for(;s<e.getElementsByTagName('script').length;s+=1){c+=e.getElementsByTagName('script')[s].innerHTML;}
eval(c);},JSON:{parse:function(json){if(typeof json!=='string'){return json;}
if((typeof JSON==='object')&&JSON&&JSON.parse){return JSON.parse(json);}else{return eval('(function () { return '+json+'; })()');}}},mousePosition:function(e){if(!e){e=window.event;}
var body=(window.document.compatMode&&window.document.compatMode==="CSS1Compat")?window.document.documentElement:window.document.body;return{y:e.pageY?e.pageY:e.clientY+body.scrollTop-body.clientTop,x:e.pageX?e.pageX:e.clientX+body.scrollLeft-body.clientLeft};},descendantOf:function(container,descendant){while(descendant){if(descendant===container){return true;}
descendant=descendant.parentNode;}
return false;},absoluteUrl:function(url){if(!url){return'';}
if(url.indexOf('/')===0){url=document.baseURI.slice(0,-1)+url;}else if(!(/^[a-z]+:/.test(url))){url=document.location.protocol+'//'+url;}
return url;},stringSum:function(s){var sum=0,i=0,j=s.length;for(;i<j;i+=1){sum+=s.charCodeAt(i);}
return sum;},benchmark:(function(){var timers={};var marks={};return{start:function(key){timers[key]=(new Date()).getTime();marks[key]=0;},stop:function(key){marks[key]+=1;var t=(new Date()).getTime()-timers[key];PLISTA.util.logger.getLogger('util.benchmark').info('('+key+marks[key]+') : '+t);return t;}};}())};PLISTA.onBeforeInit=PLISTA.util.newEvent(PLISTA,'beforeinit');PLISTA.onLoad=PLISTA.util.newEvent(PLISTA,'load');PLISTA.onStarRating=PLISTA.util.newEvent(PLISTA,'starrating');PLISTA.onBeforeReInit=PLISTA.util.newEvent(PLISTA,'reinit');PLISTA.onClick=PLISTA.util.newEvent(PLISTA,'click');PLISTA.getItemData_clean=function(data){if(!data){return;}
var cleaners={img:function(val){val=PLISTA.util.absoluteUrl(val);if(!(/https?\:\/\/[a-z0-9\-\.]+\.[a-z]+\/.*/.test(val))){return null;}
if(val.lastIndexOf('/')===(val.length-1)){return null;}
return val;},url:function(val){return PLISTA.util.absoluteUrl(val);},objectid:function(val){return val;}};for(var name in data){if(typeof data[name]==='string'){if(cleaners[name]){data[name]=cleaners[name](data[name]);}else{data[name]=PLISTA.util.trim(PLISTA.util.text_clean(data[name]),250,true);}
if(data[name]&&(data[name].length>255)){PLISTA.util.logger.log('property "'+name+'" of item "'+(data.objectid||'')+'" is too long: '+data[name],'error');delete data[name];}}}
return data;};PLISTA.sendItemData=function(params,callback){if(!params.objectid||!params.type){PLISTA.util.logger.log('request to send item data did not contain objectid and type');return;}
var item=PLISTA.getItemData_clean(PLISTA.items.getByObjectId(params.objectid));for(var name in item){if(item.hasOwnProperty(name)){params[name]=item[name];}}
params.datacomplete='true';PLISTA.remotedata.getData(params,callback);};PLISTA.click=function(ref,domainid,objectid,position,widgetkey,src,params,friendid,clickdomainid,campaignid){var name,request=[],clickprops;if(arguments.length>1){clickprops={domainid:domainid,objectid:objectid,position:position,widgetkey:widgetkey,src:src,params:params,friendid:friendid,clickdomainid:clickdomainid,campaignid:campaignid};}else if((arguments.length===1)&&(typeof arguments[0]==='object')&&(arguments[0]!==null)){clickprops={};for(name in arguments[0]){if(arguments[0].hasOwnProperty(name)){clickprops[name]=arguments[0][name];}}}
for(name in clickprops){if(typeof clickprops[name]!=='undefined'){request.push(name+'='+encodeURIComponent(clickprops[name]));}}
request.push('clientrev=8');if(document.images){(new Image()).src=PLISTA.path+'redirect.php?'+request.join('&');}
PLISTA.onClick.fire(clickprops);return true;};PLISTA.isarticle=null;PLISTA.isArticle=function(){if(PLISTA.isarticle===null){if(PLISTA.parser&&PLISTA.parser.get('isarticle')){PLISTA.isarticle=true;}else{if(PLISTA.widgetdatarequested){PLISTA.isarticle=(PLISTA.items.length===1);}}}
return PLISTA.isarticle;};PLISTA.currentObjectid=function(){if(PLISTA.items.length>0){return PLISTA.items[0].objectid;}};PLISTA.loadWidgetData=function(){PLISTA.widgetdatarequested=1;var isarticlerequest,attrs,k;if(PLISTA.isArticle()&&PLISTA.items[0]&&!PLISTA.clickadded){PLISTA.getItemData_clean(PLISTA.items[0]);if(!PLISTA.items[0].objectid){PLISTA.util.logger.log('item 0 has no objectid. NOT sending data...');}else{isarticlerequest={type:'isarticle',objectid:PLISTA.items[0].objectid};attrs=PLISTA.options.sendItemDataAttributes;for(k=0;k<attrs.length;k++){if(attrs[k]){isarticlerequest[attrs[k]]=PLISTA.items[0][attrs[k]];}}
PLISTA.remotedata.getData(isarticlerequest,function(data){data=PLISTA.util.JSON.parse(data);if(data.action&&(data.action==='sendItemData')){setTimeout(function(){PLISTA.sendItemData(data.params);},5000);}});PLISTA.clickadded=true;}}};PLISTA.init=function(){PLISTA.onBeforeInit.fire();if(PLISTA.container){PLISTA.container.initParser();PLISTA.container.initPanels();}
if(PLISTA.loadtopbar&&PLISTA.lib.PlistaTopbar){PLISTA.initTopbar();}
if(PLISTA.panels&&PLISTA.panels.getRatingdata){PLISTA.panels.getRatingdata();}
if(!PLISTA.widgetdatarequested){PLISTA.loadWidgetData();}
if(PLISTA.itemlists){PLISTA.lists.load();}
PLISTA.onLoad.fire();};PLISTA.reinit=function(){PLISTA.items=[];PLISTA.widgetdatarequested=0;PLISTA.onBeforeReInit.fire();PLISTA.init();};PLISTA.setAutoInit=(function(){var f=function(){if(PLISTA.options.autoinit&&!f.onLoadAdded){if(PLISTA.util.DOM.ready){PLISTA.util.DOM.ready(PLISTA.init);}else{PLISTA.util.DOM.addEventListener(window,'load',function(){if(!PLISTA.widgetdatarequested){PLISTA.init();}});}
f.onLoadAdded=true;}};f.onLoadAdded=false;return f;}());PLISTA.addRemoteScriptTag=function(url,id){var tag=PLISTA.util.DOM.createElement('script');if(id){tag.id=id;}
tag.type='text/javascript';tag.src=url;tag.charset='utf-8';document.getElementsByTagName('head')[0].appendChild(tag);return tag;};PLISTA.loadModules=function(names,fn,force){(function loadModule(){var name=names.shift();if(name){if(force||!PLISTA[name]){var tag=PLISTA.addRemoteScriptTag(PLISTA.path+'scripts/'+name+'.js');PLISTA.util.DOM.addEventListener(tag,'load',loadModule);}else{loadModule();}}else{if(typeof fn==='function'){fn();}}}());};PLISTA.remotedata=(function(){var httpRequests=[],callbacks=[];function sendRequests(){var i=0,query,data='';while(i<callbacks.length){if(typeof callbacks[i]!=='undefined'){query=PLISTA.path+'widgetdata.php'+'?clientrev=8'+
(PLISTA.domainid?'&domainid='+PLISTA.domainid:'')+
(PLISTA.pluginhash?'&hash='+PLISTA.pluginhash:'')+
(PLISTA.pluginversion?'&version='+PLISTA.pluginversion:'')+
(PLISTA.publickey?'&publickey='+PLISTA.publickey:'')+
(PLISTA.osh?'&osh='+PLISTA.osh:'')+'&requestID='+httpRequests.length;httpRequests.push([]);data='';while(i<callbacks.length){if(typeof callbacks[i]==='undefined'){PLISTA.util.logger.log('callbacks[i] undefined');i++;}else if(callbacks[i].request.length>2000){PLISTA.util.logger.log('data request too long, starting with: '+
callbacks[i].request.substr(0,50));i++;}else if((data+callbacks[i].request).length>2100){PLISTA.addRemoteScriptTag(query+data);break;}else{data+='&'+i.toString()+'='+callbacks[i].request;httpRequests[httpRequests.length-1][i]=callbacks[i];callbacks[i]=undefined;i++;}}}else{i++;}}
if(data.length>0){PLISTA.addRemoteScriptTag(query+data);}}
return{mode:'queue',sendRequests:sendRequests,getData:function(request,onSetData,onAfterDataSet){if(typeof request!=='string'){request=PLISTA.remoteData.getSpecificationString(request);}
callbacks.push({request:encodeURIComponent(request),onSetData:onSetData,onAfterDataSet:onAfterDataSet});if(this.mode==='run'){sendRequests();}},setData:function(data,requestSubID,requestID){httpRequests[requestID].time=httpRequests[requestID].time||(new Date()).getTime();var req=httpRequests[requestID][requestSubID];if(typeof req.onSetData==='function'){req.onSetData(data,httpRequests[requestID].time);req.onSetData=undefined;}},setTime:function(requestID){var req,i;for(i=0;i<httpRequests[requestID].length;i++){req=httpRequests[requestID][i];if(req&&(typeof req.onAfterDataSet==='function')){req.onAfterDataSet();req.onAfterDataSet=undefined;}}},getSpecificationString:function(spec){var res='',name;for(name in spec){if(spec.hasOwnProperty(name)&&(typeof spec[name]!=='undefined')&&(spec[name]!==null)){res+=name+':'+spec[name].toString().replace(/([;:])/g,'\\$1')+';';}}
return res;},getDebugData:function(){if(PLISTA.debug){return{callbacks:callbacks,httpRequests:httpRequests};}}};}());PLISTA.remoteData=PLISTA.remotedata;PLISTA.onLoad.subscribe(function(){PLISTA.remoteData.mode='run';PLISTA.remoteData.sendRequests();});PLISTA.onBeforeReInit.subscribe(function(){PLISTA.remoteData.mode='queue';});PLISTA.render={parseStyle:function(style,data,styleElements,context){var getVal=function(attr,args){var val;try{if(typeof styleElements[attr]==='function'){val=styleElements[attr](data,args,context);}else if(typeof styleElements[attr]==='undefined'){val=data[attr];}else{val=styleElements[attr].getContent(data,args,context);}
val=val.toString();}catch(e){PLISTA.util.logger.log('util.parseStyle#getVal: error parsing style "'+attr+'": '+(e.message||e));val='';}
return val;},trimEach=function(val,i,obj){obj[i]=val.trim();};styleElements=styleElements||this.defaultStyleElements;context=context||{};var regmatch=/\[([a-z_0-9]+)(\(([A-Za-z_0-9, ]*)\))?\]/i.exec(style),args,tmp,cnt=0;while(regmatch!==null&&regmatch[0]&&regmatch[1]){cnt+=1;if(cnt>100){PLISTA.util.logger.getLogger('PLISTA.render.parseStyle').error('reached maximum replacement count of 100. possible endless loop, plz check ['+regmatch[1]+']!');return'';}
if(regmatch[3]){args=regmatch[3].split(',');args.forEach(trimEach);}else{args=[];}
tmp=getVal(regmatch[1],args);if(!PLISTA.isIE){tmp=tmp.replace(/\$/g,'$$$$');}
style=style.replace(regmatch[0],tmp);regmatch=/\[([a-z_0-9]+)(\(([A-Za-z_0-9, ]*)\))?\]/i.exec(style);}
return style;},defaultStyleElements:{image:function(item,args){var src=item.img;if((args[0]||item.type==='pet')&&src&&item.objectid){src=PLISTA.render.imageUrl(item,args[0],args[1],args[2]);}
return src?'<img src="'+src+'" title="[title]" alt="" />':'';},imgnoresize:(function(){var newImgId=(function(){var id=0;return function(){id+=1;return'plista_widget_imgnoresize_'+id;};}()),setCheckAndResize=function(id){var interval=function interval(){var img=document.getElementById(id);if(img&&(img.naturalWidth||img.complete)){PLISTA.render.resizeImage(img);}else{setTimeout(interval,50);}};interval();};return function(item,args){var src=item.img,dim='',imgId=newImgId();if(!src){return'';}
if(args[0]){dim+='width:'+args[0]+'px;';}
if(args[1]){dim+='height:'+args[1]+'px;';}
setCheckAndResize(imgId);return'<span style="display: block;'+dim+'overflow: hidden;" '+'class="plista_widget_imgwrapper">'+'<img id="'+imgId+'" src="'+src+'" title="[title]" alt="" /></span>';};}()),title:function(item,args){var s=item.title||item.item;if(args[0]){s=PLISTA.util.trim(s,args[0],args[1]);}
return s;},text:function(item,args){var s=item.text;if(args[0]){s=PLISTA.util.trim(s,args[0],args[1]);}
return s;},number:function(item,args,ctx){return ctx.position;},url:function(item){return((item.url.indexOf('%'))===-1)?encodeURI(item.url):item.url;},created_at:{format:'d.m.Y',getContent:function(item){var t=parseInt(item.created_at,10);if(!t){throw'created_at: item.created_at is not set or evaluates to 0';}
var format=this.format;if(format.indexOf('%')===-1){format=format.replace(/([a-z])/ig,'%$1');}
return PLISTA.render.strftime(format,t);}},augment:PLISTA.util.augment},strftime:function(f,t){function pad(val,len){if(typeof val!=='string'){val=val.toString();}
len=len||2;while(val.length<len){val='0'+val;}
return val;}
var date=new Date(t*1000);f=f.replace('%%','%');f=f.replace('%Y',pad(date.getFullYear()));f=f.replace('%y',pad(date.getFullYear()%100));f=f.replace('%m',pad(date.getMonth()+1));f=f.replace('%d',pad(date.getDate()));f=f.replace('%H',pad(date.getHours()));f=f.replace('%i',pad(date.getMinutes()));f=f.replace('%s',pad(date.getSeconds()));return f;},i18n:{rating_description:{1:'irrelevant',2:'boring',3:'okay',4:'good',5:'excellent'}},imageUrl:function(item,width,height,bgColor){var hash=PLISTA.util.stringSum(item.img||'');return PLISTA.cdnpath+'image/resized/'+
(item.domainid||PLISTA.domainid)+'/'+
(bgColor?bgColor+'/':'')+
item.objectid+'_'+(width||0)+'x'+(height||0)+'_'+hash+'.jpg';},resizeImage:function(img){var pDim=PLISTA.util.DOM.getDimensions(img.parentNode),imgOrig=PLISTA.util.DOM.getDimensions(img),ratio={x:pDim.x/imgOrig.x,y:pDim.y/imgOrig.y},t;if(ratio.x<1&&ratio.y<1){t=(ratio.x<ratio.y)?ratio.y:ratio.x;img.height=imgOrig.y*t;img.width=imgOrig.x*t;}
img.style.marginTop=((pDim.y-img.height)/2).toString()+'px';img.style.marginLeft=((pDim.x-img.width)/2).toString()+'px';}};PLISTA.render.defaultStyleElements.imgresize=(function(){var defaultImage=PLISTA.render.defaultStyleElements.image;return function(item,args,ctx){var src=item.img,dim='';if(!src){return'';}
if(args[0]){dim+='width:'+args[0]+'px;';}
if(args[1]){dim+='height:'+args[1]+'px;';}
return'<span class="plista_widget_imgwrapper" style="display: block; overflow: hidden;'+dim+'">'+defaultImage(item,args,ctx)+'</span>';};}());PLISTA.lib=PLISTA.lib||{};PLISTA.lib.dataobject=function(my){var data,udage=0,refreshing=false,logger=PLISTA.util.logger.getLogger('dataobject'),that;if(typeof my!=='object'||!my){throw{message:'parameter missing'};}
data=my.defaultData;if(typeof my.spec!=='object'||!my.spec){throw{message:'specification missing'};}
my.autoload=my.autoload||false;if(typeof my.spec.type!=='string'){throw'datasource must be string';}
my.filterGetData=my.filterGetData||function(data){return data;};that={getUpdateAge:function(){return udage;},refreshData:function(){refreshing=true;PLISTA.remotedata.getData(my.spec,function(newData,time){try{data=PLISTA.util.JSON.parse(newData);}catch(e){logger.error('error eval\'ing remote data starting with "'+newData.substr(0,50)+'": '+e);return;}
udage=time;refreshing=false;},that.onChange.fire);},getData:function(maxage){maxage=maxage||30000;if((new Date()).getTime()-maxage>udage){if(refreshing){logger.info('getData, already refreshing: '+this.toString());}else{logger.debug('getData, starting refresh: '+this.toString()+', udage: '+udage);that.refreshData();}}
return my.filterGetData(data);},toString:function(){return"dataobject";},getDebug:function(){if(PLISTA.debug){return{data:data,udage:udage,refreshing:refreshing,my:my};}}};that.onChange=PLISTA.util.newEvent(that,'change');return that;};PLISTA.lists=[];PLISTA.lists.load=function(){for(var i=0;i<this.length;i++){PLISTA.listwidgets.widget(this[i].settings).init();if(typeof this[i].cb==='function'){this[i].cb();}}};PLISTA.itemlists=(function(){var that=[],basicItemList,recommendationList,similarList;basicItemList=function(my){var that,algoinfo,reloadcount=0;my=my||{};my.spec=my.spec||{};my.spec.type=my.spec.type||'list';my.defaultData={items:[]};my.spec.datasource=my.spec.datasource||'recommendations';my.spec.objectid=my.spec.objectid||PLISTA.currentObjectid();if(isNaN(parseInt(my.spec.count,10))){my.spec.count=15;}
my.required=my.required||[];my.filterGetData=my.filterGetData||function(data){algoinfo=data.algoinfo;if(data.action&&(typeof data.action.reload==='number')&&(data.action.reload>=0)&&reloadcount===0){window.setTimeout(that.refreshData,data.action.reload);reloadcount++;}
return data.items;};that=PLISTA.lib.dataobject(my);that.setCount=function(count,force){count=parseInt(count,10);if(isNaN(count)){throw'itemlist.setCount expects a number';}
if((my.spec.count<count)||force){my.spec.count=count;that.refreshData();}};that.getAlgoInfo=function(){return algoinfo||'';};that.getSpecProperty=function(name){return my.spec[name];};that.setSpecProperty=function(name,value){my.spec[name]=value;};that.toString=function(){return'basicItemList';};PLISTA.itemlists.push(that);return that;};recommendationList=function(my){my=my||{};my.spec=my.spec||{};my.spec.datasource='recommendations';var that=basicItemList(my);that.toString=function(){return"recommendationsList";};that.onSettingsChange=PLISTA.util.newEvent(that,'settingschange');that.getNicheSlider=function(){return 0;};that.getAgeSlider=function(){return 0;};that.setNicheSlider=function(niche){};that.setAgeSlider=function(age){};PLISTA.onStarRating.subscribe(function(){that.refreshData();});return that;};similarList=function(my){my=my||{};my.spec=my.spec||{};my.spec.datasource='similar';var that=basicItemList(my);that.toString=function(){return"similarList";};return that;};that.basicItemList=basicItemList;that.recommendationList=recommendationList;that.getByDataSource=function(datasource,count){return that.getBySpec({datasource:datasource,count:count});};that.getBySpec=function(spec,nostore){var list,i,my,prop,existingValue,match;spec.count=parseInt(spec.count,10);for(i=0;i<that.length;i++){match=true;for(prop in spec){if(spec.hasOwnProperty(prop)&&(typeof spec[prop]!==undefined)&&(spec[prop]!==null)){existingValue=that[i].getSpecProperty(prop);if((prop!=='count')&&(existingValue!==spec[prop])){match=false;break;}}}
if(match){if(spec.count&&!isNaN(spec.count)){that[i].setCount(spec.count);}
return that[i];}}
my={spec:spec,nostore:nostore};switch(spec.datasource){case'recommendations':list=recommendationList(my);break;case'similar':list=similarList(my);break;default:PLISTA.util.logger.log('unknown list type: '+(spec.datasource||'undefined'),'warn');list=basicItemList(my);}
return list;};return that;}());PLISTA.listwidgets=[];PLISTA.onBeforeReInit.subscribe(function(){var lw=PLISTA.listwidgets.pop();while(lw){lw.destroy();lw=PLISTA.listwidgets.pop();}});PLISTA.listwidgets.widget=function(spec){var that;function manipulateLinks(item,innerhtml,pos){var match,stuff='title="[title]"';if(item.url&&((item.url.indexOf(PLISTA.path)===-1)||item.forceTracking)){stuff+=' onmousedown="return PLISTA.click('+"this,"+"'"+(PLISTA.domainid)+"',"+"'"+(item.objectid)+"',"+
pos+","+"'"+(spec.widgetkey||'')+"',"+"'listwidget"+((PLISTA.isArticle()?'article':'')+
spec.list.getSpecProperty('datasource'))+"',"+"'"+(typeof item.bucketid!=='undefined'?item.bucketid:spec.list.getAlgoInfo())+"',"+"'"+(spec.list.getSpecProperty('objectid')||'')+"',"+"'"+(item.domainid||'')+"',"+"'"+(item.campaignid||'')+'\');" ';}
var ix=0,rx=/<a\s[^>]*href=[\'\"]\[url\][\'\"][^>]*>/g;match=rx.exec(innerhtml);while(match!==null){ix=rx.lastIndex-1;innerhtml=innerhtml.substr(0,ix)+stuff+innerhtml.substr(ix);match=rx.exec(innerhtml);}
return innerhtml;}
function onChange(){that.refresh();}
if(typeof spec.target==='string'){spec.target=document.getElementById(spec.target);}
if(!spec.target){throw new Error('PLISTA.listwidgets.widget: no target element');}
spec.itemStyle=spec.itemStyle||'<li><a href="[url]">[title]</a></li>';spec.count=parseInt(spec.count,10)||5;spec.offset=parseInt(spec.offset,10)||0;if((typeof spec.list==='string')||(typeof spec.list==='undefined')){PLISTA.util.logger.getLogger('listwidget').warn('deprecated warning - list parameter for widget should be list object instead of "'+spec.list+'"');spec.list=PLISTA.itemlists.getBySpec({datasource:spec.list||'recommendations',count:spec.count,objectid:spec.objectid});}
spec.list.setCount(spec.count+spec.offset);if(!spec.styleElements){spec.styleElements=PLISTA.render.defaultStyleElements;}
that={spec:spec,setCount:function(cnt){spec.list.setCount(cnt);spec.count=cnt;},init:function(){this.refresh();},refresh:function(){function htmlSafeItemData(item){var safe={},name;for(name in item){if(typeof item[name]==='string'){safe[name]=PLISTA.util.htmlEntities(item[name]);}else{safe[name]=item[name];}}
return safe;}
var i,html='',data=spec.list.getData(),style,ctx=spec.context||{};ctx.listwidget=this;if((typeof data==='object')&&data&&(typeof data.length==='number')){for(i=0;spec.petpos&&(i<data.length);i++){if(data[i].type==="pet"){data.splice(spec.petpos-1,0,data.splice(i,1)[0]);}}
for(i=spec.offset;(i<data.length)&&(i<(spec.offset+spec.count));i++){ctx.position=i+1;if((typeof spec.itemStyle==='object')&&spec.itemStyle){style=spec.itemStyle[data[i].type||'default']||'';}else if(!data[i].type){style=spec.itemStyle;}else{PLISTA.util.logger.log('no matching style for item '+data[i].domainid+'/'+data[i].objectid);style='';}
style=manipulateLinks(data[i],style,i+1);if(style&&data[i].ad_html){style+='<div style="display:none">'+data[i].ad_html+"</div>";}
html+=PLISTA.render.parseStyle(style,htmlSafeItemData(data[i]),spec.styleElements,ctx);}}
if((typeof PLISTA!=='undefined')&&(PLISTA.type==='embedded')){html+='<li class="plista_items_logo"><img src="'+PLISTA.cdnpath+'images/logo15x15.png" /> <a href="http://www.plista.com" style="text-decoration:none;">powered by plista</a></li>';}
if(html===''){if(PLISTA.options.showloading){html='loading ...';}else{html='';}}
that.getTarget().innerHTML=html;that.onRefresh.fire();return true;},destroy:function(){spec.list.onChange.unsubscribe(onChange);spec.getTarget().innerHTML='';},toString:function(){return"list widget";},setList:function(list){spec.list.onChange.unsubscribe(onChange);list.onChange.subscribe(onChange);spec.list=list;}};that.onRefresh=PLISTA.util.newEvent(that,'refresh');if(typeof spec.target==='function'){that.getTarget=spec.target;}else{that.getTarget=function(){return spec.target;};}
that.setList(spec.list);PLISTA.listwidgets.push(that);return that;};(function(){var status=0,k,t=20000,errorPath=PLISTA.path+'errorreport.php',fn=function(){if(status>=0&&status<2){var url=errorPath+'?domainid='+PLISTA.domainid+'&msgkey=not_initialized&error=not yet initialized after '+t+'ms. status '+status;PLISTA.addRemoteScriptTag(url);PLISTA.util.logger.getLogger('errorreport').debug('called '+url);PLISTA.selfmonitoring.onErrorReport.fire();status=-1;}};PLISTA.onBeforeInit.subscribe(function(){status=1;});PLISTA.onLoad.subscribe(function(){status=2;});PLISTA.selfmonitoring={getStatus:function(){return status;},setDelay:function(delay){t=delay;if(k){clearTimeout(k);}
k=setTimeout(fn,t);}};PLISTA.selfmonitoring.onErrorReport=PLISTA.util.newEvent(PLISTA.selfmonitoring);PLISTA.selfmonitoring.setDelay(t);}());PLISTA.loadtopbar=false;PLISTA.options.autoinit=false;PLISTA.options.showloading=false;PLISTA.partner={options:(function(){var o,k=false,r=/plista\[([a-z]+)\]=([a-z0-9]+)/g,d={type:'options'};while((o=r.exec(decodeURIComponent(PLISTA.test&&PLISTA.test.search?PLISTA.test.search:document.location.search)))){d[o[1]]=o[2];k=true;}
if(k){PLISTA.remotedata.getData(d);}
return d;}()),setWidgets:function(widgets){if((typeof widgets!=='object')||(widgets===null)){return;}
function gotoFirstWidget(){if(PLISTA.listwidgets[0]){document.location.hash='#'+PLISTA.listwidgets[0].getTarget().id;}}
function displayBlock(e){return function(){e.style.display='block';};}
function addOnFirstDataEvent(itemlist){if(itemlist.onFirstData){return;}
itemlist.onFirstData=PLISTA.util.newEvent(itemlist,'firstdata');itemlist.onChange.subscribe((function(){var hasRun=false;return function(itemlist){if(!hasRun&&itemlist.getData().length>0){itemlist.onFirstData.fire();}};}()));}
function addClickTracks(e){var i,es=e.getElementsByTagName('a'),clicktrack=function(){PLISTA.click({domainid:PLISTA.domainid,objectid:'advertisehere_de_1',friendid:PLISTA.currentObjectid(),clickdomainid:this.clickdomainid});};for(i=0;i<es.length;i+=1){if(es[i].href.indexOf('http://www.plista.com/advertiser')===0){es[i].clickdomainid=1083;PLISTA.util.DOM.addEventListener(es[i],'mousedown',clicktrack);if(PLISTA.items[0]){es[i].href='http://www.plista.com/advertiser/registrations/advertisehere/'+PLISTA.domainid+'/'+PLISTA.items[0].objectid;}}else if(/^http\:\/\/www\.plista\.com\/?$/.test(es[i].href)){es[i].clickdomainid=1141;PLISTA.util.DOM.addEventListener(es[i],'mousedown',clicktrack);}}}
var widget,list,i;for(i=0;i<widgets.length;i+=1){if((typeof widgets[i]==='object')&&widgets[i]){widget=widgets[i];if(typeof widget.target==='string'){widget.target=document.getElementById(widget.target);}
widget.target.style.display='none';if(widget.targetHTML){widget.target.innerHTML=widget.targetHTML;addClickTracks(widget.target);}
if(!widget.plistaListWidgetDef.target){widget.plistaListWidgetDef.target=widget.target;}
list=widget.plistaListWidgetDef.list;if(typeof list==='string'){list=PLISTA.itemlists.getBySpec({datasource:'recommendations',count:1,objectid:PLISTA.items[0]?PLISTA.items[0].objectid:null,widgetkey:widget.plistaListWidgetDef.widgetkey,flash:widget.plistaListWidgetDef.itemStyle&&widget.plistaListWidgetDef.itemStyle.flashPet&&PLISTA.flash&&PLISTA.flash.flPlugin});}
addOnFirstDataEvent(list);widget.plistaListWidgetDef.list=list;list.onFirstData.subscribe(displayBlock(widget.target));if(document.location.hash==='#plista'){list.onFirstData.subscribe(gotoFirstWidget);}
PLISTA.listwidgets.widget(widget.plistaListWidgetDef).init();}}}};PLISTA.domainid=1029;PLISTA.publickey='e3c8cec253a77ead2c622998514e9ddb95548391';PLISTA.util.xpath=(function(){var xpath=function(query,e){e=e||document;if(document.createExpression){PLISTA.util.benchmark.start('xpath '+query);var r,expr=document.createExpression(query,null);PLISTA.util.benchmark.stop('xpath '+query);r=expr.evaluate(e,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);PLISTA.util.benchmark.stop('xpath '+query);return r;}else{PLISTA.util.logger.getLogger('util.xpath').error('no xpath support!');}};return function(x,e){try{var v=xpath(x,e),d=[],i=0;for(;v&&(i<v.snapshotLength);i+=1){d.push(v.snapshotItem(i));}
return d;}catch(ex){PLISTA.util.logger.getLogger('util.xpath').error('exception when executing xpath: '+ex);return[];}};}());(function(w,d,f){function XPath(e){this.e=e;this.i=0;this.js=['with(XPath){return ','}'];this.expression(1,1)||this.error();return new Function('n','nsr',this.js.join(''));}
XPath.ie=/MSIE/.test(navigator.userAgent);XPath.prototype={match:function(rx,x){var m,r;if(!(m=rx.exec(this.e.substr(this.i)))||(typeof x=='number'&&!(r=m[x]))||(typeof x=='object'&&!(r=x[m[1]])))return false;this.m=m;this.i+=m[0].length;return r||m;},error:function(m){m=(m||'Syntax error')+' at index '+this.i+': '+this.e.substr(this.i);var e;try{e=new XPathException(51,m)}
catch(x){e=new Error(m)}
throw e;},step:function(l,r,s,n){var i=3;if(this.match(/^(\/\/?|\.\.?|@)\s*/,1)){switch(this.m[1]){case'/':if(s)this.error();if(!n)return this.step(l,r,1);this.js.splice(l,0,' axis(axes["','document-root','"],');i+=this.nodeTypes.node.call(this,l+i);s=1;break;case'//':if(s)this.error();this.js.splice(l,0,' axis(axes["','descendant-or-self','"],');i+=this.nodeTypes.node.call(this,l+i);s=1;break;case'.':if(!s&&!n)this.error();this.js.splice(l,0,' axis(axes["','self','"],');i+=this.nodeTypes.node.call(this,l+i);s=0;break;case'..':if(!s&&!n)this.error();this.js.splice(l,0,' axis(axes["','parent','"],');i+=this.nodeTypes.node.call(this,l+i);s=0;break;case'@':if(!s&&!n)this.error();this.js.splice(l,0,' axis(axes["','attribute','"],');i+=this.nodeTest(l+i,'node')||this.error('Missing nodeTest after @');s=0;}}
else if(!s&&!n)return s?this.error():0;else if(this.match(/^([a-z]+(?:-[a-z]+)*)\s*::\s*/,XPath.axes)){this.js.splice(l,0,' axis(axes["',this.m[1],'"],');i+=this.nodeTest(l+i,(this.m[1]=='attribute')?'node':'element')||this.error('Missing nodeTest after ::');s=0;}
else if(i=this.nodeTest(l,'element')){this.js.splice(l,0,' axis(axes["','child','"],');i+=3;s=0;}
else return 0;for(var j;j=this.predicate(l+i);i+=j);if(n)this.js.splice(r+i++,0,n);i+=this.step(l,r+i,s);this.js.splice(r+i++,0,')');return i;},expression:function(l,r,p){var o,i=this.operand(l);while(o=this.match(/^(or|and|!?=|[<>]=?|[|*+-]|div|mod)\s*/,this.operators)){if(p&&p[0]>=o[0]){this.i-=this.m[0].length;break;}
this.js.splice(l,0,o[1]);i++;this.js.splice(l+i++,0,o[2]);i+=this.expression(l+i,r,o)||this.error('Missing operand');this.js.splice(l+i++,0,o[3]);}
return i;},operand:function(l){if(this.match(/^(-?(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+)|"[^"]*"|'[^']*')\s*/,1)){this.js.splice(l,0,this.m[1]);return 1;}
var fn;if(fn=this.match(/^([a-z]+(?:-[a-z]+)*)\s*\(\s*/,this.functions)){var i=1,j;this.js.splice(l,0,fn[1]);do{if(j)this.js.splice(l+i++,0,',');i+=(j=this.expression(l+i,l+i));}while(j&&this.match(/^,\s*/));this.match(/^\)\s*/)||this.error('Missing (');if(fn[0]){if(j)this.js.splice(l+i++,0,',');this.js.splice(l+i++,0,fn[0]);}
if(fn[2])this.js.splice(l+i++,0,fn[2]);else if(j>1)this.error('Function has arguments');i+=this.step(l,l+i);return i;}
if(this.match(/^\(\s*/)){var i=1;this.js.splice(l,0,'(');i+=this.expression(l+i,l+i);this.match(/^\)\s*/)||this.error('Missing )');this.js.splice(l+i++,')');return i;}
return this.step(l,l,0,'[n]');},operators:{'|':[1,'union(',',',')'],'or':[1,'bool(',')||bool(',')'],'and':[2,'bool(',')&&bool(',')'],'=':[3,'compare(eq,',',',')'],'!=':[3,'compare(ne,',',',')'],'<':[4,'compare(lt,',',',')'],'>':[4,'compare(gt,',',',')'],'<=':[4,'compare(le,',',',')'],'>=':[4,'compare(ge,',',',')'],'+':[5,'number(',')+number(',')'],'-':[5,'number(',')-number(',')'],'*':[6,'number(',')*number(',')'],'div':[6,'number(',')/number(',')'],'mod':[6,'number(',')%number(',')']},functions:{'last':[0,'nl.length'],'position':[0,'(i+1)'],'count':['nl','(','.length||0)'],'id':['n','id(',')'],'local-name':['nl','localName(',')'],'namespace-uri':['nl','namespaceURI(',')'],'name':['nl','qName(',')'],'string':['n','string(',')'],'concat':[0,'concat(',')'],'starts-with':[0,'startsWith(',')'],'contains':[0,'contains(',')'],'substring-before':[0,'substringBefore(',')'],'substring-after':[0,'substringAfter(',')'],'substring':[0,'substring(',')'],'string-length':['n','string(',').length'],'normalize-space':['n','normalizeSpace(',')'],'translate':[0,'translate(',')'],'boolean':[0,'bool(',')'],'not':[0,'!bool(',')'],'true':[0,'true '],'false':[0,'false '],'number':['n','number(',')'],'floor':[0,'Math.floor(number(','))'],'ceiling':[0,'Math.ceil(number(','))'],'round':[0,'Math.round(number(','))'],'sum':[0,'sum(',')']},predicate:function(l){var i=0;if(this.match(/^\[\s*/)){if(i=this.expression(l,l)){this.js.splice(l,0,'function(n,i,nl){with(XPath){var r=');i++;this.js.splice(l+i++,0,';return typeof r=="number"?Math.round(r)==i+1:bool(r)}},');}
this.match(/^\]\s*/)||this.error('Missing ]');}
return i;},nodeTest:function(l,t){var fn;if(fn=this.match(/^([a-z]+(?:-[a-z]+)*)\(([^)]*)\)\s*/,this.nodeTypes))
return fn.call(this,l,this.m[2]);if(this.match(/^\*\s*/))
return this.nodeTypes[t].call(this,l);return this.nodeName(l)},nodeType:function(l,t){this.js.splice(l,0,'function(n){return n.nodeType==',t,'},');return 3;},nodeTypes:{'node':function(l){this.js.splice(l,0,'null,');return 1;},'element':function(l){return this.nodeType(l,1);},'attribute':function(l){return this.nodeType(l,2);},'text':function(l){return this.nodeType(l,3);},'processing-instruction':function(l,t){if(!t)return this.nodeType(l,7);this.js.splice(l,0,'function(n){return n.nodeType==7&&n.target==',t,'},');return 3;},'comment':function(l){return this.nodeType(l,8);}},nodeName:function(l){if(!this.match(/^([a-zA-Z_]+(?:-?[a-zA-Z0-9]+)*)(?::([a-zA-Z_]+(?:-?[a-zA-Z0-9]+)*))?\s*/,1))
return 0;if(this.m[2]){this.js.splice(l,0,'function(n){if(!nsr)throw new XPathException(14);return "',this.m[2],'"==',XPath.ie?'n.baseName':'n.localName','&&nsr.lookupNamespaceURI("',this.m[1],'")==n.namespaceURI},');return 7;}
else{this.js.splice(l,0,'function(n){return/^',this.m[1],'$/i.test(n.nodeName)},');return 3;}}};XPath.order=function(l,r){var x=l.compareDocumentPosition?l.compareDocumentPosition(r):XPath.compareDocumentPosition.call(l,r);if(x&32){l=Array.prototype.indexOf.call(l.attributes,l);r=Array.prototype.indexOf.call(r.attributes,r);return(l<r)?-1:(l>r)?1:0;}
if(!x){if(l==r)
return 0;if((l=l.ownerElement)&&(r=r.ownerElement))
return XPath.order(l,r);return XPath.ie?1:0;}
return 3-((x&6)||3);};XPath.compare=function(fn,l,r){if(l instanceof Array&&r instanceof Array){var ls=l.map(this.string),rs=r.map(this.string);for(l=ls.length;--l>=0;)
for(r=rs.length;--r>=0;)
if(!fn(ls[l],rs[r]))return false;return true;}
if(l instanceof Array){for(var i=l.length;--i>=0;)
if(!fn(this[typeof r](l[i]),r))return false;return l.length>0;}
if(r instanceof Array){for(var i=r.length;--i>=0;)
if(!fn(l,this[typeof l](r[i])))return false;return r.length>0;}
if(typeof l=='boolean'||typeof r=='boolean')
return fn(this.bool(l),this.bool(r));if(typeof l=='number'||typeof r=='number')
return fn(this.number(l),this.number(r));return fn(this.string(l),this.string(r));};XPath.eq=function(l,r){return l==r};XPath.ne=function(l,r){return l!=r};XPath.lt=function(l,r){return l<r};XPath.gt=function(l,r){return l>r};XPath.le=function(l,r){return l<=r};XPath.ge=function(l,r){return l>=r};XPath.id=function(s,n){if(arguments.length==1)n=s;var nl=[];for(var id=this.string(s).split(/\s+/),i=id.length;--i>=0;)
if(s=(n.ownerDocument||n).getElementById(id[i]))
nl.push(s);return nl.sort(this.order);};XPath.localName=new Function('nl','return (nl.length&&nl[0].'+(XPath.ie?'baseName':'localName')+')||""');XPath.namespaceURI=function(nl){return(nl.length&&nl[0].namespaceURI)||'';};XPath.qName=function(nl){return(nl.length&&nl[0].nodeName)||'';};XPath.union=function(a,b){if(!a.length)return b;if(!b.length)return a;var nl=[],i=a.length-1,j=b.length-1;for(;;){switch(this.order(a[i],b[j])){case-1:nl.unshift(b[j--]);break;case 0:j--;case 1:nl.unshift(a[i--]);break;default:throw new Error('Invalid order');}
if(i<0){if(++j>0)nl.unshift.apply(nl,nl.slice.call(b,0,j));break;}
if(j<0){if(++i>0)nl.unshift.apply(nl,nl.slice.call(a,0,i));break;}}
return nl;};XPath.string=XPath.object=function(v){if(v instanceof Array&&typeof(v=v[0])=='undefined')return'';if(typeof v=='string')return v;switch(v.nodeType){case 1:case 9:case 11:return Array.prototype.map.call(v.childNodes,this.string,this).join('');default:return v.nodeValue||'';}
return String(v);};XPath.concat=function(){return Array.prototype.map.call(arguments,this.string,this).join('');};XPath.startsWith=function(a,b){return this.string(a).substr(0,(b=this.string(b)).length)==b;};XPath.contains=function(a,b){return this.string(a).indexOf(this.string(b))!=-1;};XPath.substringBefore=function(a,b){a=this.string(a);b=a.indexOf(this.string(b));return b!=-1?a.substr(0,b):'';};XPath.substringAfter=function(a,b){a=this.string(a);b=this.string(b);var i=a.indexOf(b);return i!=-1?a.substr(i+b.length):'';};XPath.substring=function(s,i,l){s=this.string(s);i=Math.round(this.number(i))-1;return(arguments.length==2)?s.substr(i<0?0:i):s.substr(i<0?0:i,Math.round(this.number(l))-Math.max(0,-i));};XPath.normalizeSpace=function(s){return this.string(s).replace(/^\s+/,'').replace(/\s+$/,'').replace(/\s+/g,' ');};XPath.translate=function(a,b,c){a=this.string(a);b=this.string(b);c=this.string(c);var o=[],l=a.length,i=0,j,x;while(--l>=0)
if((j=b.indexOf(x=a.charAt(i++)))==-1||(x=c.charAt(j)))o.push(x);return o.join('');};XPath.bool=XPath['boolean']=function(v){if(typeof v=='boolean')return v;if(v instanceof Array||typeof v=='string')return v.length>0;return Boolean(v);};XPath.number=function(v){if(v instanceof Array&&typeof(v=v[0])=='undefined')return 0;if(typeof v=='number')return v;if(typeof v=='boolean')return v?1:0;return Number(this.string(v));};XPath.sum=function(nl){var r=0,i=nl.length;while(--i>=0)r+=this.number(nl[i]);return r;};XPath.walk=function(n,nl){var x,c=n.firstChild;while(c){if(PLISTA.isIE6&&(nl.indexOf(c)!==-1)){throw'DOM bug: infinite loop in XPath.walk! Current node exists already at pos '+nl.indexOf(c)+' in a list of '+nl.length+' nodes';}
nl.push(c);if(x=c.firstChild)c=x;else for(x=c;!(c=x.nextSibling)&&(x=x.parentNode)&&(x!=n););}
return nl;};XPath.axes={'ancestor':function(n){var nl=[];while(n=n.parentNode)nl.unshift(n);return nl;},'ancestor-or-self':function(n){var nl=[];do{nl.unshift(n)}while(n=n.parentNode);return nl;},'attribute':new Function('n','var nl = [], a = n.attributes;if(a){attr:for(var x,i=a.length;--i>=0;){if(!(x=a[i]).specified){'+
(XPath.ie?'switch(x.nodeName){case"selected":case"value":if(x.nodeValue)break;default:continue attr;}':'continue;')+'}nl.unshift(x);}}return nl;'),'child':function(n){return n.childNodes?Array.prototype.map.call(n.childNodes,function(v){return v;}):[];},'descendant':function(n){return this.walk(n,[]);},'descendant-or-self':function(n){return this.walk(n,[n]);},'following':function(n){var nl=[],x;while(n){if(x=n.nextSibling){nl.push(n=x);if(x=n.firstChild)nl.push(n=x);}
else n=n.parentNode;}
return nl;},'following-sibling':function(n){var nl=[];while(n=n.nextSibling)nl.push(n);return nl;},'parent':function(n){return n.parentNode?[n.parentNode]:[];},'preceding':function(n){var nl=[],x,p=n.parentNode;while(n){if(x=n.previousSibling){for(n=x;x=n.lastChild;n=x);nl.unshift(n);}
else if(n=n.parentNode){if(n==p)p=p.parentNode;else nl.unshift(n);}}
return nl;},'preceding-sibling':function(n){var nl=[];while(n=n.previousSibling)nl.unshift(n);return nl;},'self':function(n){return[n];},'document-root':function(n){return[n.ownerDocument||n];}};XPath.axis=function(fn,nt){var r,x,al=arguments.length-1,nl=arguments[al],ap=Array.prototype;for(var i=0,j,l=nl.length;--l>=0;){x=fn.call(this,nl[i++]);if(nt&&x.length)x=ap.filter.call(x,nt,this);for(j=2;j<al&&x.length;x=ap.filter.call(x,arguments[j++],this));r=r?this.union(r,x):x;}
return r||[];};XPath.cache={};function compareDocumentPosition(n){if(this==n)return 0;if(this.nodeType==2&&n.nodeType==2)
return(this.ownerElement&&this.ownerElement==n.ownerElement)?32:0;var l=this.ownerElement||this,r=n.ownerElement||n;if(l.sourceIndex>=0&&r.sourceIndex>=0&&l.contains&&r.contains){return(((l.contains(r)&&16)||(r.contains(l)&&8))|((l.sourceIndex<r.sourceIndex&&4)||(r.sourceIndex<l.sourceIndex&&2)))||1;}
var la=l,ra=r,ld=0,rd=0;while(la=la.parentNode)ld++;while(ra=ra.parentNode)rd++;if(ld>rd){while(ld--!=rd)l=l.parentNode;if(l==r)return 2|8;}
else if(rd>ld){while(rd--!=ld)r=r.parentNode;if(r==l)return 4|16;}
while((la=l.parentNode)!=(ra=r.parentNode))
if(!(l=la)||!(r=ra))return 1;while(l=l.nextSibling)
if(l==r)return 4;return 2;};if(w.Node&&w.Node.prototype){var np=w.Node.prototype;if(f||!np.compareDocumentPosition)
np.compareDocumentPosition=compareDocumentPosition;if(f||!np.contains){np.contains=function(n){return Boolean(this.compareDocumentPosition(n)&16);};}}
else
XPath.compareDocumentPosition=compareDocumentPosition;if(f||!w.XPathException){function XPathException(c,m){this.name='XPathException';this.code=c;this.message=m;}
var e=XPathException,p=new Error;p.toString=function(){return this.name+':'+this.message;};e.prototype=p;e.NAMESPACE_ERR=14;e.INVALID_EXPRESSION_ERR=51;e.TYPE_ERR=52;w.XPathException=e;}
if(f||!w.XPathNSResolver){function XPathNSResolver(n){this.ns={};for(var m,a,i=n.attributes.length;--i>=0;)
if(m=/xmlns:(.+)/.exec((a=n.attributes[i]).nodeName))
this.ns[m[1]]=a.nodeValue;this.ns['']=n.getAttribute('targetNamespace');}
XPathNSResolver.prototype={lookupNamespaceURI:function(p){return this.ns[p||''];}};w.XPathNSResolver=XPathNSResolver;}
if(f||!w.XPathExpression){function XPathExpression(e,nsr){this.fn=XPath.cache[e]||(XPath.cache[e]=new XPath(e));this.nsr=nsr;}
XPathExpression.prototype={evaluate:function(n,rt){return new XPathResult(this.fn(n,this.nsr),rt);}};w.XPathExpression=XPathExpression;}
if(f||!w.XPathResult){function XPathResult(r,rt){if(rt==0){switch(typeof r){default:rt++;case'boolean':rt++;case'string':rt++;case'number':rt++;}}
this.resultType=rt;switch(rt){case 1:this.numberValue=XPath.number(r);return;case 2:this.stringValue=XPath.string(r);return;case 3:this.booleanValue=XPath.bool(r);return;case 4:case 5:if(r instanceof Array){this.value=r;this.index=0;this.invalidIteratorState=false;return;}
break;case 6:case 7:if(r instanceof Array){this.value=r;this.snapshotLength=r.length;return;}
break;case 8:case 9:if(r instanceof Array){this.singleNodeValue=r[0];return;}}
throw new XPathException(52);}
var r=XPathResult;r.ANY_TYPE=0;r.NUMBER_TYPE=1;r.STRING_TYPE=2;r.BOOLEAN_TYPE=3;r.UNORDERED_NODE_ITERATOR_TYPE=4;r.ORDERED_NODE_ITERATOR_TYPE=5;r.UNORDERED_NODE_SNAPSHOT_TYPE=6;r.ORDERED_NODE_SNAPSHOT_TYPE=7;r.ANY_UNORDERED_NODE_TYPE=8;r.FIRST_ORDERED_NODE_TYPE=9;r.prototype={iterateNext:function(){switch(this.resultType){case 4:case 5:return this.value[this.index++];}
throw new XPathException(52);},snapshotItem:function(i){switch(this.resultType){case 6:case 7:return this.value[i];}
throw new XPathException(52);}};w.XPathResult=r;}
if(f||!w.XPathEvaluator){function XPathEvaluator(){}
var e=XPathEvaluator;e.prototype={createExpression:function(e,nsr){return new XPathExpression(e,nsr);},createNSResolver:function(n){return new XPathNSResolver(n);},evaluate:function(e,n,nsr,rt){return new XPathExpression(e,nsr).evaluate(n,rt);}};e.install=function(o,f){for(var k in XPathEvaluator.prototype)
if(f||!o[k])o[k]=XPathEvaluator.prototype[k];};w.XPathEvaluator=e;if(w.Document)
e.install(w.Document.prototype,f);else
e.install(document,f);w.XPath=XPath;}})(window,document,/WebKit/.test(navigator.userAgent));PLISTA.util.loadCSS('.plista_intext_highlight {position: relative; border-bottom: 1px solid #999; cursor: pointer;}');PLISTA.util.getSafeIEEvent=function(){var e=window.event,c={},n;if(!e){return null;}
for(n in e){if(typeof e[n]!=='unknown'){c[n]=e[n];}}
return c;};PLISTA.util.isContainedInSeparators=(function(){var s='\t\n "\',.:;!?*+=-_#~"§$%&/()[]{}@\\«»„“‟';return function(src,pos,word){return(s.indexOf(src.charAt(pos-1)||' ')!==-1)&&(s.indexOf(src.charAt(pos+word.length)||' ')!==-1);};}());PLISTA.intext=(function(){var boxTimerShow,boxTimerLeaveTag,boxTimerLeaveBox,articles=[],isadmin={domain:false,global:false},highlights=[],markedNodes=[],logger=function(){return PLISTA.util.logger.getLogger('intext');},boxEnsureCSS=(function(){var loaded=false;return function(){var css=PLISTA.intext.popup.css||'';if(!loaded){if(css.indexOf('/*CLEAR*/')!==0){PLISTA.util.loadCSS(PLISTA.cdnpath+"/images/intext/style.css?v=2");}
PLISTA.util.loadCSS(PLISTA.intext.popup.css);loaded=true;}};}()),getHiddenMarkup=(function(){var id=0;return function(keyword){id+=1;return{id:id,markup:'<span id="plista_intext_hidden_'+id+'">'+keyword+'</span>'};};}()),augmentKeywordMethods=function(k){for(var i=0;i<k.length;i+=1){k[i].alias=k[i].alias.toLowerCase();}
k.getIterator=function(){var arr=this,skipping=0,cur=-1,get=function(i){var o=arr[i];return o?{tagid:o.tagid,alias:o.alias,isHighlight:!o.disabled}:null;},that={current:function(){var o=get(cur);if(o){o.isHighlight=o.isHighlight&&(skipping===arr[cur].skip);}
return o;},last:function(){var o=get(arr.length-1);if(o){o.isHighlight=o.isHighlight&&!arr[arr.length-1].skip;}
return o;}};that.next=function(){if(skipping){skipping-=1;}else{cur+=1;skipping=arr[cur]?arr[cur].skip:-1;}
return that.current();};that.next();return that;};k.getID=function(alias){alias=alias.toLowerCase();for(var i=0;i<k.length;i+=1){if(k[i].alias===alias){return k[i].tagid;}}};return k;},addAdminLinks=function(e,tag){var tagid=highlights.getID(tag),d0=PLISTA.util.DOM.createElement('div','Tag <em>"'+tag+'"</em> : '),da=PLISTA.util.DOM.createElement('div','<li>aus Artikel entfernen</li>'),db=PLISTA.util.DOM.createElement('div','<li>f\u00fcr Domain deaktivieren</li>'),dc=PLISTA.util.DOM.createElement('div','<li>komplett l\u00f6schen</li>');d0.className='plista_intext_popup_disabletag';PLISTA.util.DOM.addEventListener(da,'click',function(){PLISTA.intext.disableTag('intextdisabletag',tagid,tag);});PLISTA.util.DOM.addEventListener(db,'click',function(){PLISTA.intext.disableTag('intextdisabledomaintag',tagid,tag);});PLISTA.util.DOM.addEventListener(dc,'click',function(){PLISTA.intext.disableTag('intextdisablealltag',tagid,tag);});if(isadmin.domain){d0.appendChild(da);d0.appendChild(db);}
if(isadmin.global){d0.appendChild(dc);}
e.appendChild(d0);},getBoxDomId=function(id){return"plista_intext_popup_"+id;},inited=false,init=function(objid){if(!PLISTA.partner){logger().error('abort init, PLISTA.partner not available');return;}
if(inited){logger().warn('abort init, already inited');return;}
inited=true;PLISTA.remotedata.getData({type:'intexthighlights',objectid:objid},PLISTA.intext.setData);};PLISTA.util.DOM.addEventListener(document.body,'click',function(e){var posMouse,posBox,dimBox,dimTag,posTag,box=PLISTA.intext.activeBox,pointWithin=function(a,b){return(b.y<a.height+a.top)&&(b.y>a.top)&&(b.x<a.width+a.left)&&(b.x>a.left);};e=e||PLISTA.util.getSafeIEEvent();if(box){dimBox=PLISTA.util.DOM.getDimensions(box);posBox=PLISTA.util.DOM.getAbsolutePosition(box);dimTag=PLISTA.util.DOM.getDimensions(box.relatedElement);posTag=PLISTA.util.DOM.getAbsolutePosition(box.relatedElement);posMouse=PLISTA.util.mousePosition(e);if(!PLISTA.intext.blockBox&&!pointWithin({top:posBox.y,left:posBox.x,width:dimBox.x,height:dimBox.y},{x:posMouse.x,y:posMouse.y})&&!pointWithin({top:posTag.y,left:posTag.x,width:dimTag.x||50,height:dimTag.y||20},{x:posMouse.x,y:posMouse.y})){if(boxTimerLeaveBox){clearTimeout(boxTimerLeaveBox);boxTimerLeaveBox=0;}
if(boxTimerLeaveTag){clearTimeout(boxTimerLeaveTag);boxTimerLeaveTag=0;}
PLISTA.intext.removeBox(box);}else{PLISTA.util.logger.getLogger('intext.popup.events').debug('click inside box or tag('+posMouse.y+' '+posBox.y+' '+dimBox.y+'), not closing.');}}});return{setKeywords:function(objid){logger().info('call to deprecated setKeywords method. use init instead!');init(objid);},init:init,setData:function(data){var it,i;data=PLISTA.util.JSON.parse(data);if(!data.success){logger().warn('server reports error when asked for highlights. aborting...');return;}
if(!data.highlights.length){logger().info('no highlights found, aborting...');return;}
if(!articles.length){logger().error('no article nodes, although highlights have been returned. aborting...');return;}
augmentKeywordMethods(data.highlights);highlights=data.highlights;PLISTA.intext.highlights=highlights;isadmin=data.admin;logger().debug('number of article nodes: '+articles.length);logger().debug('number of words to highlight: '+highlights.length);PLISTA.util.benchmark.start('replacing');it=highlights.getIterator();markedNodes=[];try{for(i=0;articles.length>i;i+=1){markedNodes=markedNodes.concat(PLISTA.intext.replaceTextNodes(it,articles[i].e,articles[i].blacklist));}
if(it.current()){throw'I have still highlights to process ('+it.current().alias+') , but I am out of text nodes';}}catch(e){logger().error('caught exception while finding nodes to highlight: '+e);PLISTA.remotedata.getData({type:'intexterror',objectid:PLISTA.items[0].objectid,msg:e,action:'retag'});}
PLISTA.util.benchmark.stop('replacing');boxEnsureCSS();markedNodes=PLISTA.intext.highlightReplacedNodes(markedNodes);PLISTA.util.benchmark.stop('replacing');},replaceTextNodes:function replaceTextNodes(highlightIterator,searchNode,blacklist){var replacedIDs=[],childNodes=searchNode.childNodes,childNodesCopy=[],i,excludedTags=['html','head','style','title','link','meta','script','object','iframe'],handleNode=function(node){var src=node.data,wrap=function(html){var f=document.createDocumentFragment(),d=document.createElement('div');d.innerHTML=html;while(d.firstChild){f.appendChild(d.firstChild);}
return f;};var tmp=PLISTA.intext.replacer(src,highlightIterator,getHiddenMarkup);replacedIDs=replacedIDs.concat(tmp.replacements);return wrap(tmp.markup);};if(searchNode.nodeType===3){if(searchNode.parentNode){searchNode.parentNode.replaceChild(handleNode(searchNode),searchNode);}else{logger().error('node had no parent node: '+searchNode);}}
for(i=0;i<childNodes.length;i+=1){childNodesCopy.push(childNodes[i]);}
for(i=0;i<childNodesCopy.length;i+=1){var currentNode=childNodesCopy[i];if(blacklist.indexOf(currentNode)===-1&&(currentNode.nodeType!==1||excludedTags.indexOf(currentNode.nodeName.toLowerCase())===-1)){if(currentNode.id&&currentNode.id.indexOf('plista_intext_hidden_')!==-1){throw'we already seem to have visited the node '+currentNode.id;}
replacedIDs=replacedIDs.concat(replaceTextNodes(highlightIterator,currentNode,blacklist));}}
return replacedIDs;},getArticleNodes:function(){return articles;},blockBox:0,cache:{},removeBox:function(box){box.parentNode.removeChild(box);PLISTA.intext.blockBox=setTimeout(function(){PLISTA.intext.blockBox=0;},50);PLISTA.intext.activeBox=null;},activeBox:null,popup:{css:"",itemStyle:{},styleElements:Object.create(PLISTA.render.defaultStyleElements).augment({created_at:function(item){var f;var t=item.created_at;var c=new Date(t*1000);var now=new Date();if(now.getFullYear()===c.getFullYear()){if(now.getDate()===c.getDate()&&now.getMonth()===c.getMonth()){f=PLISTA.render.strftime('%H:%i Uhr',t);}else{f=PLISTA.render.strftime('%d.%m.',t);}}else{f=PLISTA.render.strftime('%d.%m.%y',t);}
return f+' - ';},title:function(item,args,ctx){var r,t=PLISTA.util.trim(item.title,args[0],args[1]?true:false),p=t.toLowerCase().indexOf(ctx.tag);if(p!==-1&&args[2]==='hl'&&PLISTA.util.isContainedInSeparators(t,p,ctx.tag)){r=item.title.slice(p,p+ctx.tag.length);t=t.replace(r,'<span class="plista_intext_widget_hltitle">'+r+'</span>');}
return t;},text:function(item,args,ctx){var r,t=PLISTA.util.trim(item.text,args[0],args[1]?true:false),p=t.toLowerCase().indexOf(ctx.tag);if(p!==-1&&args[2]==='hl'&&PLISTA.util.isContainedInSeparators(t,p,ctx.tag)){r=item.text.slice(p,p+ctx.tag.length);t=t.replace(r,'<strong>'+r+'</strong>');}
return t;}})},show:function(elm,tagid,tag,pos){var boxDomId=getBoxDomId(tagid);if(document.getElementById(boxDomId)===null&&PLISTA.intext.blockBox===0){if(PLISTA.intext.activeBox){PLISTA.intext.removeBox(PLISTA.intext.activeBox);}
PLISTA.intext.blockBox=setTimeout(function(){PLISTA.intext.blockBox=0;},400);var myBox=document.body.appendChild(document.createElement("div"));PLISTA.intext.activeBox=myBox;myBox.id=boxDomId;myBox.onmouseout=function(e){var event=e?e:PLISTA.util.getSafeIEEvent();var target=event.relatedTarget?event.relatedTarget:event.toElement;if(!PLISTA.util.descendantOf(myBox,target)){if(boxTimerLeaveBox){clearTimeout(boxTimerLeaveBox);}
boxTimerLeaveBox=setTimeout(function(){PLISTA.intext.removeBox(myBox);boxTimerLeaveBox=0;},PLISTA.intext.boxTimerLeaveBoxTimeout);}};myBox.onmouseover=function(e){if(boxTimerLeaveTag){clearTimeout(boxTimerLeaveTag);boxTimerLeaveTag=0;}
if(boxTimerLeaveBox){clearTimeout(boxTimerLeaveBox);boxTimerLeaveBox=0;}};myBox.className='plistaintextbox';myBox.style.zIndex=-2147483647;myBox.innerHTML='<div class="plista_wrapper">'+' <div class="plista_top"> '+'  <div class="plista_inhalt_top">'+'   <a href="javascript:PLISTA.intext.removeBox(document.getElementById(\''+boxDomId+'\'))" class="plista_close"></a>'+'   Mehr zu: "'+tag+'"  </div>'+' </div>'+' <div class="plista_content">'+'  <div class="plista_inhalt_content">'+'  <div id="plista_intext_popup_admin"></div>'+'  <div id="plista_intext_popup_cnt" style="margin: 0px 178px; font-size: 9px;"></div>'+'   <img id="plista_intext_widget_loadimg" src="http://static.plista.com/images/intext/ajax-loader.gif" alt="loading" style="border: none; background: none; margin: 5px 170px"><div style="clear: both"></div>'+'  </div>'+' </div>'+'</div>'+'<div class="plista_bottom">'+' <div class="plista_inhalt_bottom">'+'  <a href="http://www.plista.com/" target="_blank" onclick="PLISTA.click({domainid: PLISTA.domainid,objectid: \'advertisehere_de_1\',friendid: PLISTA.currentObjectid(),clickdomainid: \'1141\'});">powered by plista</a>'+' </div>'+'</div>';if(isadmin&&isadmin.global){setTimeout((function(){var tm=(new Date()).getTime(),u='ms';return function counter(){var e=document.getElementById('plista_intext_popup_cnt'),t=((new Date()).getTime()-tm);if(e){e.innerHTML=t+u;setTimeout(counter,100);}else{logger().debug('popup waited '+t+'ms for recommendations');}};}()),100);}
myBox.relatedElement=elm;myBox.pos=pos;PLISTA.intext.boxReposition(myBox,390);myBox.style.zIndex=2147483647;if(PLISTA.intext.cache[tagid]===undefined){PLISTA.remotedata.getData({type:'intextrecs',tag:tagid,objectid:PLISTA.items[0].objectid,flash:false},function(data){data=PLISTA.util.JSON.parse(data);if(!data.success){logger().warn('intextrecs reports error. no intext recommendations!');var i=document.getElementById('plista_intext_widget_loadimg');i.src='';return;}
PLISTA.intext.purgeInvalidData(data);PLISTA.intext.cache[tagid]=data;PLISTA.intext.getRecommendations(myBox,PLISTA.intext.cache[tagid],tagid,tag);});}else{PLISTA.intext.getRecommendations(myBox,PLISTA.intext.cache[tagid],tagid,tag);}}},getRecommendations:function(myBox,data,tagid,keyword){myBox.style.zIndex=-2147483647;myBox.innerHTML='<div class="plista_wrapper">'+' <div class="plista_top"> '+'  <div class="plista_inhalt_top">'+'   <a href="javascript:PLISTA.intext.removeBox(document.getElementById(\''+getBoxDomId(tagid)+'\'))" class="plista_close"></a>'+'   Mehr zu: '+keyword+'  </div>'+' </div>'+' <div class="plista_content">'+'  <div class="plista_inhalt_content">'+'   <div id="plista_intext_popup_admin"></div>'+'   <ul id="plista_intext_popup_list"></ul>'+'  </div>'+' </div>'+'</div>'+'<div class="plista_bottom">'+' <div class="plista_inhalt_bottom">'+'  <a href="http://www.plista.com/" target="_blank" onclick="PLISTA.click({domainid: PLISTA.domainid,objectid: \'advertisehere_de_1\',friendid: PLISTA.currentObjectid(),clickdomainid: \'1141\'});">powered by plista</a>'+' </div>'+'</div>';if(!document.getElementById('plista_intext_popup_list')){PLISTA.util.logger.getLogger('intext.getRecommendations').error('for some reason, plista_intext_popup_list does not exist -> cannot set widget');return;}
if(isadmin&&(isadmin.global||isadmin.domain)){addAdminLinks(document.getElementById('plista_intext_popup_admin'),keyword);}
PLISTA.intext.getListWidget(document.getElementById('plista_intext_popup_list'),data.intextitems,keyword,tagid).init();PLISTA.intext.boxReposition(myBox);myBox.style.zIndex=2147483647;},disableTag:function(type,tagid,tag){var sure;if(type==='intextdisablealltag'){sure=confirm('Soll "'+tag+'" wirklich auf allen Domains gesperrt werden?');}else if(type==='intextdisabledomaintag'){sure=confirm('Soll "'+tag+'" wirklich auf der ganzen Domain mit 0 gewichtet werden?');}else if(type==='intextdisabletag'){sure=true;}
if(sure===true){PLISTA.remotedata.getData({type:type,tagid:tagid,objectid:PLISTA.items[0].objectid,domainid:PLISTA.domainid},function(data){data=PLISTA.util.JSON.parse(data);if(data.success===true){PLISTA.intext.disableHighlights(tag);PLISTA.intext.removeBox(PLISTA.intext.activeBox);}});}},disableHighlights:function(tag){var i,e;tag=tag.toLowerCase();logger().trace('disabling '+tag+', got '+markedNodes.length+' markedNodes to search');for(i=markedNodes.length-1;i>=0;i-=1){if(markedNodes[i].alias===tag){e=markedNodes[i].node;if(e){e.className='';e.id='';e.onmouseout=null;e.onmouseover=null;e.onclick=null;markedNodes.splice(i,1);}else{logger().debug('intext.disableHighlights: element '+markedNodes[i].id+' existiert nicht');}}}},highlightReplacedNodes:function(markedNodes){var mouseoverHandler=function(e){e=e||PLISTA.util.getSafeIEEvent();var keyword=this.innerHTML;var elm=this;var tagid=PLISTA.intext.highlights.getID(this.alias);if(boxTimerLeaveTag){clearTimeout(boxTimerLeaveTag);boxTimerLeaveTag=0;}
boxTimerShow=setTimeout(function(){PLISTA.intext.show(elm,tagid,keyword,PLISTA.util.mousePosition(e));boxTimerShow=0;},PLISTA.intext.boxTimerHoverTagTimeout);},clickHandler=function(e){PLISTA.intext.show(this,PLISTA.intext.highlights.getID(this.alias),this.innerHTML,PLISTA.util.mousePosition(e));},mouseoutHandler=function(){if(boxTimerShow){clearTimeout(boxTimerShow);boxTimerShow=0;}
if(PLISTA.intext.activeBox){if(!boxTimerLeaveTag){boxTimerLeaveTag=setTimeout(function(){PLISTA.intext.removeBox(PLISTA.intext.activeBox);boxTimerLeaveTag=0;},PLISTA.intext.boxTimerLeaveTagTimeout);}}},i,node;logger().info('intext: #hl: '+markedNodes.length);for(i=0;i<markedNodes.length;i+=1){node=document.getElementById('plista_intext_hidden_'+markedNodes[i].id);markedNodes[i].node=node;node.className='plista_intext_highlight';node.onmouseover=mouseoverHandler;node.onclick=clickHandler;node.onmouseout=mouseoutHandler;node.alias=markedNodes[i].alias;}
return markedNodes;},replacers:{searchForEachWord:function(src,highlightIterator,markup){var i,srcLc=src.toLowerCase(),pos=-1,word,tmp,p,positions=[],cur=highlightIterator.current(),alias=cur?cur.alias:highlightIterator.last().alias;srcLc=srcLc.replace(/[\n\r\t]/g," ");while(alias&&((pos=srcLc.indexOf(alias,pos!==-1?pos+1:0))!==-1)){if(PLISTA.util.isContainedInSeparators(srcLc,pos,alias)){if(!cur){throw'I am over the end of the highlight array, but nevertheless I found the last tag again!';}
if(cur.isHighlight){positions.push({pos:pos,alias:alias,tagid:cur.tagid});pos+=alias.length;}
cur=highlightIterator.next();alias=cur?cur.alias:alias;}}
positions.sort(function(a,b){return b.pos-a.pos;});for(i=0;i<positions.length;i+=1){p=positions[i];pos=p.pos;word=src.slice(pos,pos+p.alias.length);tmp=markup(word);src=src.slice(0,pos)+tmp.markup+src.slice(pos+p.alias.length);delete p.pos;p.id=tmp.id;}
return{markup:src,replacements:positions};}},purgeInvalidData:function(data){var item,i;for(i=data.intextitems.length-1;i>=0;i-=1){item=data.intextitems[i];if(!(item.url&&item.objectid)){data.intextitems.splice(i,1);logger().warn('PLISTA.intext.getRecommendations: got broken item data (no url or no objectid). removing item!');}}},getListWidget:function(target,items,tag,tagid){var list={spec:{objectid:PLISTA.items[0]?PLISTA.items[0].objectid:'',datasource:'tagid:'+tagid,flash:PLISTA.intext.popup.itemStyle&&PLISTA.intext.popup.itemStyle.flashPet&&PLISTA.flash&&PLISTA.flash.flPlugin},getData:function(){return items;},getSpecProperty:function(n){return this.spec[n];},setCount:function(){},getAlgoInfo:function(){return tag;}};list.onChange=PLISTA.util.newEvent(list,'change');return PLISTA.listwidgets.widget({list:list,count:4,widgetkey:list.spec.datasource,target:target,styleElements:PLISTA.intext.popup.styleElements,context:{tag:tag},itemStyle:PLISTA.intext.popup.itemStyle});},addArticleNode:function(element,b){if(!element){PLISTA.util.logger.getLogger('intext.addArticleNode').error('parameter element is not set');return;}
var blacklist,i;if(!Array.isArray(b)){blacklist=[];if(b&&b.length&&b.item){for(i=0;i<b.length;i+=1){blacklist.push(b[i]);}}}else{blacklist=b;}
articles.push({e:element,blacklist:blacklist});},boxReposition:function(box,boxHeight){if(!box.pos){throw'boxReposition: can not find box.pos';}
var relPos=box.pos;var newY=relPos.y,newX=relPos.x+30;boxHeight=boxHeight||PLISTA.util.DOM.getDimensions(box).y||390;var screenHeight=window.innerHeight||(document.documentElement?document.documentElement.clientHeight:document.body.clientHeight);var scrollTop=(window.pageYOffset||document.body.scrollTop||(document.documentElement?document.documentElement.scrollTop:0));var relElmWindowOffset=relPos.y-scrollTop;var relElmHeight=PLISTA.util.DOM.getDimensions(box.relatedElement).y||20;if(relElmWindowOffset<boxHeight){if((screenHeight-relElmWindowOffset-relElmHeight)<boxHeight){newY=scrollTop+((screenHeight-boxHeight)/2);newX+=20;}else{newY+=relElmHeight;}}else{newY-=boxHeight;}
box.style.top=newY+'px';box.style.left=newX+'px';box.style.position='absolute';},augmentKeywordMethods:augmentKeywordMethods,markedNodes:markedNodes,highlights:highlights,boxTimerLeaveTagTimeout:2000,boxTimerLeaveBoxTimeout:3000,boxTimerHoverTagTimeout:250,getTimeoutRemoveBox:function(){return boxTimerLeaveTag;}};}());PLISTA.intext.replacer=PLISTA.intext.replacers.searchForEachWord;(function(){PLISTA.intext.popup.css=null;try{PLISTA.util.xpath("\/\/span[@class=\"news-body-text\"]\/span\/text()").forEach(function(val,idx,obj){PLISTA.intext.addArticleNode(val);});}catch(e){PLISTA.util.logger.getLogger('xpath').error(e);}
PLISTA.intext.popup.itemStyle['pet']="<li>\n\t<a href=\"[url]\" class=\"plista_box2\" target=\"_blank\">\n\t[imgresize(59, 59)]\n\t<div style=\"float: right\"><img alt=\"ANZEIGE\" title=\"ANZEIGE\" src=\"http:\/\/static.plista.com\/images\/newtab.gif\" style=\"border: 0px\"\/><\/div>\n\t<span class=\"plista_uberschrift\">[title(50, true, hl)]<\/span>\n\t\t<div class=\"plista_text\" title=\"[text]\">[text(150, true, hl)]&nbsp;<span class=\"plista_more\">mehr<\/span><\/div>\n\t\t<div style=\"clear:both;\"><\/div>\n\t<\/a>\n<\/li>";PLISTA.intext.popup.itemStyle['default']="<li>\n\t<a href=\"[url]\" class=\"plista_box1\">\n\t[imgnoresize(59, 59)]\n\t<span class=\"plista_uberschrift\">[title(50, true, hl)]<\/span>\n\t\t<!-- no space to avoid breaking -->\n\t\t<div class=\"plista_text\" title=\"[text]\">[created_at][text(150, true, hl)]&nbsp;<span class=\"plista_more\">mehr<\/span><\/div>\n\t\t<div style=\"clear:both;\"><\/div>\n\t<\/a>\n<\/li>";PLISTA.intext.popup.itemStyle['flashPet']="<li onmouseover=\"plista.intext.slowZoomIn([number]);\">\n\t<div class=\"plista_box2\" style=\"height:auto;\">\n\t\t<div id=\"flAdContainer[number]\" style=\"float:left;margin-right:7px;width:120px;height:90px;\">[flVideo]<\/div>\n\t\t<a id=\"flAdData[number]\" href=\"[url]\" target=\"_blank\" style=\"display:block;\">\n\t\t\t<div style=\"float:right;\"><img alt=\"ANZEIGE\" title=\"ANZEIGE\" src=\"http:\/\/static.plista.com\/images\/newtab.gif\" style=\"border: 0px\"\/><\/div>\n\t\t\t<span class=\"plista_uberschrift\">[title(50, true, hl)]<\/span>\n\t\t\t<div class=\"plista_text\">[created_at][text(150, true, hl)]&nbsp;<span class=\"plista_more\">mehr<\/span><\/div>\n\t\t<\/a>\n\t\t<div style=\"clear:both;\"><\/div>\n\t<\/div>\n<\/li>";}());PLISTA.onBeforeInit.subscribe(function(){if(PLISTA.items[0]){PLISTA.intext.init(PLISTA.items[0].objectid);}});PLISTA.partner.init=function(placing){var widgets=[];if(!placing){placing={'belowArticle':document.getElementById('plista_widget_belowArticle')};}
if(placing['belowArticle']){widgets.push({"plistaListWidgetDef":{"count":5,"petpos":1,"list":PLISTA.itemlists.getBySpec({"adcount":4,"count":5,"datasource":"recommendations","widgetname":"belowArticle","flash":false&&PLISTA.flash&&PLISTA.flash.flPlugin}),"itemStyle":{"default":"<a class=\"plistaItem\" href=\"[url]\" title=\"[title]\">\n\t[image]\n\t<div class=\"itemTitle\">[title(105)]<\/div>\n\t<div class=\"itemText\">\n\t\t[text(200)]&nbsp;<span class=\"itemMore\">...mehr<\/span>\n\t<\/div>\n\t<div class=\"clear\"><\/div>\n<\/a>","pet":"<a class=\"plistaItem petItem\" href=\"[url]\" title=\"[title]\" target=\"_blank\">\n\t[image(65,65)]\n\t<div class=\"itemTitle\">[title]<\/div>\n\t<div class=\"itemText\">\n\t\t[text(200)]&nbsp;<span class=\"itemMore\">...mehr<\/span>\n\t<\/div>\n\t<div class=\"petClue\"><img src=\"http:\/\/static.plista.com\/images\/newtab.gif\" border=\"0\"\/><span>&nbsp;ANZEIGE<\/span><\/div>\n\t<div class=\"clear\"><\/div>\n<\/a>"},"target":"plista_widget_list_belowArticle","widgetkey":"belowArticle"},"targetHTML":"<div class=\"plistaWidget\">\n\t<div class=\"plistaWidgetHead\">Das k&ouml;nnte Sie auch interessieren<\/div>\n\t<div id=\"plista_widget_list_belowArticle\" class=\"plistaWidgetList\"><\/div>\n\t<div class=\"plistaWidgetLink\">\n\t\t\n\t\t<a title=\"powered by plista\" href=\"http:\/\/www.plista.com\" target=\"_blank\"><img border=\"0\" alt=\"powered by plista\" src=\"http:\/\/plugin.plista.com\/images\/logo15x15_trans.gif\"\/> powered by plista<\/a>\n\t<\/div>\n<\/div>","target":placing["belowArticle"]});PLISTA.util.loadCSS(".itemTitle{font-size:13px;font-weight:bold;float:none;display:block }.plistaWidget a{text-decoration:none;color:#333}.plistaWidgetList a:hover,.plistaWidgetList a:active,.plistaWidgetList a:focus{background-color:#f3f3f3}.plistaWidget{font-family:Arial,Helvetica,sans-serif;font-size:12px}.plistaWidgetHead{font-weight:bold;font-size:13px;padding:5px;background-color:#ccc;color:#555}.plistaWidgetLink{text-align:right;margin-top:5px}.plistaWidgetLink a{color:#aaaaaa;text-decoration:none;font-size:10px}.plistaWidgetLink img{vertical-align:middle;border:none !important }.plistaItem{margin:0;display:block;padding:10px;border-bottom:1px dotted #ccc}.plistaItem .itemText{color:#555;margin-top:10px;display:block }.plistaItem .itemMore{color:#aaa;font-weight:bold}.plistaItem .petClue{text-align:right;display:block }.plistaItem .petClue span{margin:0;padding:0;color:#bbb;font-size:9px}.plistaItem .petClue img{vertical-align:middle;float:none;border:none;margin-right:0px;width:12px !important }.petItem{background-color:#f3f3f3}.plistaItem img{float:left;border:1px solid #ccc;margin-right:10px}.clear{clear:left;display:block }a.plista_widget_advhere{display:block;float:left}.itemTitle{font-size:13px;font-weight:bold;float:none}.plistaWidget a{text-decoration:none;color:#333}.plistaWidgetList a:hover,.plistaWidgetList a:active,.plistaWidgetList a:focus{background-color:#f3f3f3}.plistaWidget{font-family:Arial,Helvetica,sans-serif;font-size:12px}.plistaWidgetHead{font-weight:bold;font-size:13px;padding:5px;background-color:#ccc;color:#555}.plistaWidgetLink{text-align:right;margin-top:10px}.plistaWidgetLink a{color:#aaaaaa;text-decoration:none;font-size:10px}.plistaWidgetLink img{vertical-align:middle}.plistaItem{margin:0;display:block;padding:10px;border-bottom:1px dotted #ccc}.plistaItem .itemText{color:#555;margin-top:10px}.plistaItem .itemMore{color:#aaa;font-weight:bold}.plistaItem .petClue{float:right}.plistaItem .petClue span{margin:0;padding:0;color:#bbb;font-size:9px}.plistaItem .petClue img{vertical-align:middle;float:none;border:none;margin-right:0px}.petItem{background-color:#f3f3f3}.plistaItem img{float:left;border:1px solid #ccc;margin-right:10px}.clear{clear:both}");}
PLISTA.partner.setWidgets(widgets);PLISTA.init();};