var linklists=(function()
{var instance={};return(function(url){if(typeof instance[url]=='undefined'){instance[url]=this;this.callback=[];this.url=url;var me=this;poma.addLoadEvent(function(){me.loadFeed();});}
return instance[url];});})();linklists.first_id=0;linklists.prototype.addCallback=function(callback)
{this.callback[this.callback.length]=callback;}
linklists.prototype.loadFeed=function()
{var me=this;var cb=function(data,req){if(!data){return;}
data=me.processFeed(data);for(var i=0;i<me.callback.length;i++){me.callback[i](data,req);}}
var req=poma.ajax.initRequest();req.setOpt('response',poma.ajax.response.__XML__);req.registerCallback(poma.ajax.state.__COMPLETE__,cb);req.sendRequest(this.url);}
linklists.prototype.processFeed=function(data)
{var channels=data.getElementsByTagName('channel');var items=null;var attr=['title','link','description','enclosure','category'];var i,c,a,tmp,result;data=[];for(c=0;c<channels.length;c++){items=channels[c].getElementsByTagName('item');for(i=0;i<items.length;i++){tmp=items[i].getElementsByTagName('enclosure')[0];if(!tmp){tmp=null;}else{tmp={'type':tmp.getAttribute('type'),'url':tmp.getAttribute('url')}}
data[i]={'title':poma.dom.$textContent(items[i].getElementsByTagName('title')[0]),'link':poma.dom.$textContent(items[i].getElementsByTagName('link')[0]),'description':poma.dom.$textContent(items[i].getElementsByTagName('description')[0]),'enclosure':tmp,'category':poma.dom.$textContent(items[i].getElementsByTagName('category')[0]),'channel':poma.dom.$textContent(channels[c].getElementsByTagName('title')[0]),'channellink':poma.dom.$textContent(channels[c].getElementsByTagName('link')[0])};}}
return data;}
linklists.prototype.showRelated=function(level,parent,data)
{if(data.length<=1){return;}
if(poma.isNone(parent)){return;}
var cnt=Math.min(6,data.length);var url=data[0].channellink;var content=[{'div':{'class':'index','children':[{'a':{'href':addSession(url),'#text':data[0].category}}]}}];for(var i=0;i<cnt;i++){content[content.length]={'p':{'styles':{'padding':'3px 0 0'},'children':[{'a':{'href':addSession(data[i].link),'#text':data[i].title.wordCut(40)}}]}}}
poma.dom.appendTags(parent,content);}
linklists.prototype.showArticles=function(level,parent,data){var body=document.getElementById('rssViewer');var cnt=Math.min(5,data.length);if(cnt<=1){return;}
var loc=document.location.href;var lnk='';loc=loc.replace(/^.*?(\d+)[^\/]*$/,'$1');do{lnk=data[0].link.replace(/^.*?(\d+)[^\/]*$/,'$1');if(lnk!=loc&&lnk!=linklists.first_id){break;}else{data.shift();}}while(data.length>0);linklists.first_id=lnk;var url=data[0].channellink;var links=[];if(parent.id=='linklist-l4-aux'){poma.dom.$id('linklist-l4-aux').style.marginTop='-16px';}
var i=1;for(var c=1;c<data.length;c++){lnk=data[c].link.replace(/^.*?(\d+)[^\/]*$/,'$1');if(lnk!=loc&&i<cnt){links[links.length]={'li':{'children':[{'a':{'href':addSession(data[c].link),'#text':data[c].title}}]}}
++i;if(i>=cnt){break;}}}
links[links.length]={'li':{'children':[{'a':{'href':addSession(url),'#text':'Mehr '+data[0].channel.replace(/^[^-]+\s-\s/,'')}}]}}
var x='6';var children=[{'div':{'class':'related','styles':{'marginBottom':'5px'},'children':[{'p':{'#text':data[0].channel.replace(/^[^-]+\s-\s/,'')}}]}},];if(data[0].enclosure){x='4';children.push({'div':{'class':'col x2','children':[{'a':{'href':addSession(data[0].link),'children':[{'img':{'src':(data[0].enclosure?data[0].enclosure.url.replace(/,h=\d+/,',h=86').replace(/,w=\d+/,',w=145'):''),'alt':''}}]}}]}});children.push({'div':{'class':'col space'}});}
children.push({'div':{'class':'col x'+x,'children':[{'h1':{'children':[{'a':{'href':addSession(data[0].link),'#text':data[0].title}}]}},{'p':{'#text':data[0].description.wordCut(120)+' ','children':[{'a':{'href':addSession(data[0].link),'#text':'mehr'}}]}}]}});children.push({'div':{'class':'related','styles':{'paddingTop':'10px'},'children':[{'ul':{'children':links}}]}});poma.dom.appendTags(parent,[{'div':{'class':'x6 type-d topic','children':children}}]);}
function linklists_init(id,url)
{if((poma.useragent.isIe()&&poma.useragent.getVersion()<5.5)||(!poma.useragent.knowsAjax())){return;}
if(!poma.dom.$id(id)){return;}
var parent=poma.dom.$id(id);var ll=new linklists(url);switch(id){case'linklist-l4-aux':ll.addCallback(function(data,req){ll.showArticles('linkL4_',parent,data);});break;case'linklist-l2-aux':ll.addCallback(function(data,req){ll.showArticles('linkL2_',parent,data);});break;case'linklist-related-aux':ll.addCallback(function(data,req){ll.showRelated('linkTool',parent,data);});break;}}
function newsticker(id,params){var me=this;this.interval=null;this.ticker=poma.dom.$tag('table',poma.dom.$id(id+'-slider'))[0].tBodies[0];if(poma.scrollbox.call(this,id,params)){poma.addLoadEvent(function(){me.startScroll();});poma.dom.$id(id).onmouseover=function(){me.stopScroll();}
poma.dom.$id(id).onmouseout=function(){me.startScroll();}
if(typeof params=='undefined'){params=[];}
this.speed=(typeof params['speed']=='undefined'?1:params['speed']);this.timeout=100;this.direction=(typeof params['lr']!='undefined'&&params['lr']?'h':'v');}}
newsticker.prototype=new poma.scrollbox;newsticker.prototype.setHandleCallback=function(id,cb){}
newsticker.prototype.doScroll=function()
{var vval=0;var hval=0;if(this.direction=='v'){var row=this.ticker.rows[0].offsetHeight;var pos=this.slider.offsetTop;if(pos+row<=0){this.ticker.rows[0].parentNode.appendChild(this.ticker.rows[0]);this.slider.style.top=(parseInt(this.slider.style.top)+row)+'px';}
vval=this.speed;}else if(this.direction=='h'){var col=this.ticker.rows[0].cells[0].offsetWidth;var pos=this.slider.offsetLeft;if(pos+col<=0){this.ticker.rows[0].cells[0].parentNode.appendChild(this.ticker.rows[0].cells[0]);this.slider.style.left=(parseInt(this.slider.style.left)+col)+'px';}
hval=this.speed;}
this.moveSlider([hval,vval]);}
newsticker.prototype.startScroll=function()
{if(this.interval==null){var me=this;this.interval=window.setInterval(function(){me.doScroll();},this.timeout);}}
newsticker.prototype.stopScroll=function()
{if(this.interval!=null){window.clearInterval(this.interval);this.interval=null;}}
function slideshow(containerId,blendEffect,preloadSlides)
{this.containerId=containerId;this.blendEffect=(blendEffect>0);this.preloadSlides=preloadSlides||2;this.speed=Math.round(blendEffect/100);this.slides=[];this.slide=0;this.obj={'container':poma.dom.$id(containerId),'slide':poma.dom.$id(containerId+'-slide'),'textln1':poma.dom.$id(containerId+'-textln1'),'textln2':poma.dom.$id(containerId+'-textln2')}
var me=this;var obj=poma.dom.$id(containerId+'-last');obj.setAttribute('href','javascript://');obj.onclick=function(){me.showSlide((me.slide>0?me.slide-1:me.slides.length-1));}
obj=poma.dom.$id(containerId+'-next');obj.setAttribute('href','javascript://');obj.onclick=function(){me.showSlide((me.slide<me.slides.length-1?me.slide+1:0));}}
if(typeof poma.ads!='undefined'&&poma.ads.instances.length>0){slideshow.prototype.reloadAds=function(){for(var i=0,len=poma.ads.instances.length;i<len;++i){poma.ads.instances[i].reload();}}}else{slideshow.prototype.reloadAds=function(){}}
if(typeof counter!='undefined'&&typeof counter.countPI!='undefined'){slideshow.prototype.countPI=function(){counter.countPI();}}else{slideshow.prototype.countPI=function(){}}
slideshow.prototype.refreshPager=function()
{var obj=poma.dom.$id(this.containerId+'-nav');var me=this;var cb={'showPage':function(page){me.showSlide(page-1);}}
var pager=poma.dom.buildPager(this.slide+1,this.slides.length,cb,false);while(obj.firstChild){obj.removeChild(obj.firstChild);}
poma.dom.appendTags(obj,pager);}
slideshow.prototype.addSlide=function(imagesrc,textln1,textln2,width,linkurl)
{linkurl=(typeof linkurl!='undefined'?linkurl:'');var me=this;if(this.slides.length==0&&linkurl==''){var obj=poma.dom.$id(this.containerId+'-slide');obj.setAttribute('href','javascript://');obj.onclick=function(){me.showSlide((me.slide<me.slides.length-1?me.slide+1:0));}}
this.slides[this.slides.length]={'imageobj':null,'imagesrc':imagesrc,'linkurl':(typeof linkurl!='undefined'?linkurl:''),'textln1':textln1,'textln2':textln2,'width':width};if(this.preloadSlides<0||this.slides.length<=this.preloadSlides){this.preloadSlide(this.slides.length-1);}}
slideshow.prototype.preloadSlide=function(slideNo,cb)
{if(!this.slides[slideNo]||this.slides[slideNo]['image']){if(typeof cb!='undefined'){cb();}
return;}
this.slides[slideNo]['imageobj']=new Image();if(typeof cb!='undefined'){this.slides[slideNo]['imageobj'].onload=cb;}
this.slides[slideNo]['imageobj'].src=this.slides[slideNo]['imagesrc'];}
slideshow.prototype.showSlide=function(slideNo)
{if(typeof this.slides[slideNo]=='undefined'){return;}
var me=this;if(!this.slides[slideNo]['imageobj']){this.preloadSlide(slideNo,function(){me.showSlide(slideNo);});return;}
this.slide=slideNo;var linkurl=this.slides[this.slide]['linkurl'];var linkcb=function(){};if(linkurl==''){linkcb=function(){me.showSlide((me.slide<me.slides.length-1?me.slide+1:0));}}
var children=[{'a':{'href':(linkurl!=''?linkurl:'javascript://'),'onclick':linkcb,'children':[{'img':{'src':this.slides[this.slide]['imagesrc']}}]}},{'div':{'children':[{'span':{'html':this.slides[this.slide]['textln1']}},{'br':{}},{'span':{'class':'source','html':this.slides[this.slide]['textln2']}}]}}];while(this.obj.container.firstChild){this.obj.container.removeChild(this.obj.container.firstChild);}
this.obj.container.style.width=this.slides[this.slide]['width']+'px';poma.dom.appendTags(this.obj.container,children);this.refreshPager();this.countPI();this.reloadAds();}
poma.smartsearch=function(id,catid,param)
{param=param||{};poma.moveonscroll.call(this,id,param);this.cat_obj=poma.dom.$id(catid);this.obj=poma.dom.$id(id);this.obj_top=parseInt(poma.dom.getComputedStyle(this.obj,'top'),10);this.setPosition();}
poma.smartsearch.prototype=new poma.moveonscroll();poma.smartsearch.prototype.setPosition=function(){var y=this.obj_top;if(this.cat_obj.style.display!='none'){y+=this.cat_obj.offsetHeight;}
this.initPosition.call(this,null,y);}
poma.moveonscroll.prototype.moveObject=function()
{var scrollTop=poma.dom.getScroll()[1];var ydiff;if(parseInt(this.top_s,10)>this.abs_top||scrollTop>this.abs_top){ydiff=(scrollTop-this.top_s-this.abs_sub)/10;}else{ydiff=(this.top-this.top_s)/10;}
this.top_s=Math.max(this.top,this.top_s+ydiff);this.obj.style.top=this.top_s+'px';if(Math.abs(ydiff)<0.3){window.clearInterval(this.timerEvent);this.timerEvent=null;}}
