/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
function KD_pausescroller(content, divId, divMyStyle, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" style="position: relative; overflow: hidden; '+divMyStyle+'"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}
// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------
KD_pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(KD_pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}
// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------
KD_pausescroller.prototype.animateup=function(){
var scrollerinstance=this
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(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}
// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------
KD_pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}
KD_pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}
// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------
KD_pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}
KD_pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

document.write( '<div style="width: 155px; border-left: 1px solid #bfbfbf; border-top: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; font-family: Tahoma; font-size: 8pt; padding: 2px;"> <div align="center" style="background-color: #e3e3e3; padding: 2px; font-weight: bold;"><table cellspacing="0" cellpadding="0" border="0" style="font-family: Tahoma; font-size: 8pt; font-weight: bold; width: 145px;"><tr><td align="center"><img src="http://www.kerodownload.com/images/novidades.gif"></td><td align="center"><a href="http://www.kerodownload.com/s-novidades.html" target="_blank" style="color: #000; text-decoration: underline;">Kero Notícias</a></td><td align="center"><a href="http://www.kerodownload.com/rss/rss.php" target="_blank"><img src="http://www.kerodownload.com/images/rss.gif" border="0"></a></td></tr></table></div><p align="left" style="color: #b6b6b6; margin: 5px 0px; font-size: 7pt;">09-02-2010 09:00</p></div>' );
var KD_pausecontent=new Array();
KD_pausecontent[0]="<span style='color: #000000; font-family: Tahoma; font-size: 8pt;'> Pois é, nem sempre é fácil fazer este tipo de anúncio, mas por vezes o que tem de ser é mais forte.Assim, por motivos de força maior, informamos que ...</span><div align='right' style='margin-top: 5px; padding: 2px; font-family: Tahoma; font-size: 8pt;'><a href='http://www.kerodownload.com/s-novidades-id-1984.html' target='_blank' style='color: #b6b6b6; text-decoration: underline; font-size: 7pt;'>ver +</a></div>";
KD_pausecontent[1]="<span style='color: #000000; font-family: Tahoma; font-size: 8pt;'>A decisão foi tomada a nível global: a maioria das subsidiárias europeias do fabricante de Singapura vão desaparecer, mantendo-se apenas uma represent...</span><div align='right' style='margin-top: 5px; padding: 2px; font-family: Tahoma; font-size: 8pt;'><a href='http://www.kerodownload.com/s-novidades-id-1988.html' target='_blank' style='color: #b6b6b6; text-decoration: underline; font-size: 7pt;'>ver +</a></div>";
KD_pausecontent[2]="<span style='color: #000000; font-family: Tahoma; font-size: 8pt;'> Ao contrário do que noticiou a imprensa internacional e até aqui no KeroDicas, a HP não tem quaisquer planos para criar um novo sistema operativo.  U...</span><div align='right' style='margin-top: 5px; padding: 2px; font-family: Tahoma; font-size: 8pt;'><a href='http://www.kerodownload.com/s-novidades-id-1987.html' target='_blank' style='color: #b6b6b6; text-decoration: underline; font-size: 7pt;'>ver +</a></div>";
KD_pausecontent[3]="<span style='color: #000000; font-family: Tahoma; font-size: 8pt;'> Como o tema nos últimos dias tem sido o próximo sistema operativo da Microsoft, o Windows Seven, eu criei o XP to Seven Transformation Pack. Este pac...</span><div align='right' style='margin-top: 5px; padding: 2px; font-family: Tahoma; font-size: 8pt;'><a href='http://www.kerodownload.com/s-novidades-id-1986.html' target='_blank' style='color: #b6b6b6; text-decoration: underline; font-size: 7pt;'>ver +</a></div>";
KD_pausecontent[4]="<span style='color: #000000; font-family: Tahoma; font-size: 8pt;'>Como já era de esperar a equipa da Microsoft acaba de lançar o novo beta do IE8, o navegador que neste momento apresenta a maior quota do mercado, ape...</span><div align='right' style='margin-top: 5px; padding: 2px; font-family: Tahoma; font-size: 8pt;'><a href='http://www.kerodownload.com/s-novidades-id-1985.html' target='_blank' style='color: #b6b6b6; text-decoration: underline; font-size: 7pt;'>ver +</a></div>";
new KD_pausescroller(KD_pausecontent, "KD_scroller_1265706001", "width: 155px; height: 110px; padding: 2px; border-right: 1px solid #bfbfbf; border-left: 1px solid #bfbfbf;", 6000);
document.write( '<div style="width: 155px; border-left: 1px solid #bfbfbf; border-bottom: 1px solid #bfbfbf; border-right: 1px solid #bfbfbf; font-family: Tahoma; padding: 2px;"><div align="center" style="background-color: #ACFE04; line-height: 30px; font-size: 7pt;"><a href="http://www.kerodownload.com/s-kerolive.html" target="_blank" style="text-decoration: underline; color: #000;">Keres isto no teu site?</a></div></div> ' )
