var bridgepath="/rss_bridge.jsp";
function formatrssmessage(_1,_2,_3,_4){
var _5=rsscontentdata[_1][_2];
var _6="";
var _7="";
var _8="";
try{
_6="<span class=\"rsstitle\"><a href=\""+unescape(_5.link)+"\" target=\""+_3+"\">"+unescape(_5.title)+"</a></span>";
if(_5.description!=null){
_7="<div class=\"rssdescription\">"+unescape(_5.description)+"</div>";
}else{
_7="";
}
if(_5.feeddate!=null){
_8="<span class=\"rssdate\">"+unescape(_5.date)+"</span>";
}else{
_8="";
}
}
catch(e){
}
if(_4.indexOf("description")!=-1&&_4.indexOf("date")!=-1){
return _6+"<br />"+_8+_7;
}else{
if(_4.indexOf("description")!=-1){
return _6+"<br />"+_7;
}else{
if(_4.indexOf("date")!=-1){
return _6+"<br />"+_8;
}else{
return _6;
}
}
}
};
var rsscontentdata=new Array();
function rsspausescroller(_9,_a,_b,_c,_d,_e){
this.tickerid=_a;
this.delay=_c;
this.linktarget=(typeof _d!="undefined")?_d:"";
this.logicswitch=(typeof _e!="undefined")?_e:"";
this.mouseoverBol=0;
this.hiddendivpointer=1;
this.js_is_loaded=0;
this.number_of_tries=0;
document.write("<div id=\""+_a+"\" class=\""+_b+"\" style=\"position: relative; overflow: hidden\"><div class=\"innerDiv\" style=\"position: absolute; width: 100%\" id=\""+_a+"1\"><span style=\"position: absolute\">Fetching RSS...</span></div><div class=\"innerDiv\" style=\"position: absolute; width: 100%; visibility: hidden\" id=\""+_a+"2\"></div></div>");
if(document.getElementById){
var _f="feed_id="+_9+"&divid="+_a+"&bustcache="+new Date().getTime();
rsspausescroller.getRSScontentJS(bridgepath+"?"+_f);
this.do_onjsload();
}
};
rsspausescroller.prototype.do_onjsload=function(){
var _10=this;
if(typeof rsscontentdata[this.tickerid]=="undefined"&&this.number_of_tries<40){
this.number_of_tries++;
setTimeout(function(){
_10.do_onjsload();
},300);
}else{
if(typeof rsscontentdata[this.tickerid]!="undefined"){
this.tickerdiv=document.getElementById(this.tickerid);
this.visiblediv=document.getElementById(this.tickerid+"1");
this.hiddendiv=document.getElementById(this.tickerid+"2");
this.visibledivtop=parseInt(rsspausescroller.getCSSpadding(this.tickerdiv));
try{
this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px";
}
catch(e){
}
this.visiblediv.innerHTML=formatrssmessage(this.tickerid,0,this.linktarget,this.logicswitch);
this.hiddendiv.innerHTML=formatrssmessage(this.tickerid,1,this.linktarget,this.logicswitch);
this.do_ondivsinitialized();
}else{
document.getElementById(this.tickerid).innerHTML=rsscontentdata+"<br />Fetching RSS feed failed.";
}
}
};
rsspausescroller.prototype.do_ondivsinitialized=function(){
var _11=this;
if(parseInt(this.visiblediv.offsetHeight)==0||parseInt(this.hiddendiv.offsetHeight)==0){
try{
setTimeout(function(){
_11.do_ondivsinitialized();
},600);
}
catch(e){
alert(e);
}
}else{
this.initialize();
}
};
rsspausescroller.prototype.initialize=function(){
var _12=this;
this.getinline(this.visiblediv,this.hiddendiv);
this.hiddendiv.style.visibility="visible";
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px";
this.tickerdiv.onmouseover=function(){
_12.mouseoverBol=1;
};
this.tickerdiv.onmouseout=function(){
_12.mouseoverBol=0;
};
if(window.attachEvent){
window.attachEvent("onunload",function(){
_12.tickerdiv.onmouseover=_12.tickerdiv.onmouseout=null;
});
}
setTimeout(function(){
_12.animateup();
},this.delay);
};
rsspausescroller.prototype.animateup=function(){
var _13=this;
if(this.mouseoverBol==1){
setTimeout(function(){
_13.animateup();
},100);
}else{
if(parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px";
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px";
setTimeout(function(){
_13.animateup();
},75);
}else{
this.getinline(this.hiddendiv,this.visiblediv);
this.swapdivs();
setTimeout(function(){
_13.rotatemessage();
},this.delay);
}
}
};
rsspausescroller.prototype.swapdivs=function(){
var _14=this.visiblediv;
this.visiblediv=this.hiddendiv;
this.hiddendiv=_14;
};
rsspausescroller.prototype.getinline=function(_15,_16){
_15.style.top=this.visibledivtop+"px";
_16.style.top=Math.max(_15.parentNode.offsetHeight,_15.offsetHeight)+"px";
};
rsspausescroller.prototype.rotatemessage=function(){
var _17=this;
if(this.mouseoverBol==1){
setTimeout(function(){
_17.rotatemessage();
},100);
}else{
var i=this.hiddendivpointer;
var _19=rsscontentdata[this.tickerid].length;
this.hiddendivpointer=(i+1>_19-1)?0:i+1;
this.hiddendiv.innerHTML=formatrssmessage(this.tickerid,this.hiddendivpointer,this.linktarget,this.logicswitch);
this.animateup();
}
};
rsspausescroller.getRSScontentJS=function(_1a){
var _1b=document.createElement("script");
_1b.setAttribute("type","text/javascript");
_1b.setAttribute("src",_1a);
document.getElementsByTagName("head").item(0).appendChild(_1b);
};
rsspausescroller.getCSSpadding=function(_1c){
if(_1c.currentStyle){
return _1c.currentStyle["paddingTop"];
}else{
if(window.getComputedStyle){
return window.getComputedStyle(_1c,"").getPropertyValue("padding-top");
}else{
return 0;
}
}
};
