/* DHTML NewsTicker */

/* Copyright Notice for the Original Source. It has been substantially modified */
/* Pausing updown message scroller- (C) Dynamic Drive (www.dynamicdrive.com) */
 
/* Configure the variables below to change the color, dimensions of the scroller */
scrollerwidth=124
scrollerheight=150
scrollerbgcolor='white'
toppause=4000 
minipause=10  // Original Value = var  minipause=100
dtop=5        // Original Value 
decrement=2   // Original Value = var decrement=5


//set below to '' if you don't wish to use a background image
// MUST use transparent background image to prevent Netscape draw bug
scrollerbackground='transparent.gif'
disc_heads=new Array()
disc_urls=new Array()
express_heads=new Array()
express_urls=new Array()
//////////////////////////////////////////////////////////////////////////////
// The following line is a unique string to identify this array to another script 
//<!--HeadAPUrl-->
 
//<!--/HeadAPUrl-->
 
//<!--HeadUrl-->
disc_heads[0]="Shares de 2012-02-01"
disc_heads[1]="RTP 1 - 20.5"
disc_heads[2]="RTP 2 - 5.4"
disc_heads[3]="S I C - 22.1"
disc_heads[4]="T V I - 25.4"
disc_heads[5]="Video/Outros - 26.5"
disc_heads[6]="20 Abril 2010 17:14"
disc_heads[7]="Deixa que te Leve chega ao fim na TVI"
disc_heads[8]="20 Abril 2010 17:12"
disc_heads[9]="Notícias em segunda mão na SIC"
disc_heads[10]="20 Abril 2010 16:57"
disc_heads[11]="Filipa Azevedo ganha Festival da Canção"
disc_heads[12]="20 Abril 2010 16:55"
disc_heads[13]="SIC estreia Verdade ou Talvez Não"
disc_heads[14]="20 Abril 2010 16:47"
disc_heads[15]="Share de Fevereiro  2010"
disc_heads[16]="Mais noticias AQUI"
disc_urls[1]="http://www.mediamonitor.pt/"
disc_urls[2]="http://www.mediamonitor.pt"
disc_urls[3]="http://www.mediamonitor.pt"
disc_urls[4]="http://www.mediamonitor.pt"
disc_urls[5]="http://www.mediamonitor.pt"
disc_urls[6]="http://www.mediamonitor.pt/index.php#0"
disc_urls[7]="http://www.mediamonitor.pt/index.php#0"
disc_urls[8]="http://www.mediamonitor.pt/index.php#1"
disc_urls[9]="http://www.mediamonitor.pt/index.php#1"
disc_urls[10]="http://www.mediamonitor.pt/index.php#2"
disc_urls[11]="http://www.mediamonitor.pt/index.php#2"
disc_urls[12]="http://www.mediamonitor.pt/index.php#3"
disc_urls[13]="http://www.mediamonitor.pt/index.php#3"
disc_urls[14]="http://www.mediamonitor.pt/index.php#4"
disc_urls[15]="http://www.mediamonitor.pt/index.php#4"
disc_urls[16]="http://www.mediamonitor.pt/noticias/"
 
//<!--/HeadUrl-->
// The previous line is a unique string to identify this array to another script 
//////////////////////////////////////////////////////////////////////////////
disc_news_url="http://www.mediamonitor.pt/noticias/"
express_news_url="http://www.mediamonitor.pt/noticias/"
disc_source_text="Noticias Mediamonitor"
express_source_text="As GORDAS"
source_font="<font face='Verdana, Arial, Helvetica, Helv' SIZE=1><b>"
 
///////Do not edit past this line///////////////////////
 
messages=new Array()
 
function write_message( mindex, top_url, top_text, urlarray, textarray, index ) {
    messages[ mindex ] = source_font + "<a href='" + top_url + "'>" + top_text + "</a></b><br>" +
                         "<br><a href='" + urlarray[index] + "'>" + textarray[index] + "</a><br>";
    if ( textarray[ index + 1 ] )
        messages[ mindex ] += "<br><a href='" + urlarray[index + 1] + "'>" + textarray[index + 1] + "</a>";
    messages[ mindex ] += "</font>"
}
 
   mess_len = ( disc_heads.length + (disc_heads.length % 2) + express_heads.length +  (express_heads.length % 2)) / 2 ;
 
   for (d=0, m=0, e=0; m<=(mess_len-1); m++) {
       if ( disc_heads[d] )  {
          write_message( m, disc_news_url, disc_source_text, disc_urls, disc_heads, d );
          d += 2;
       } else if ( express_heads[e] ) {
          write_message( m, express_news_url, express_source_text, express_urls, express_heads, e );
          e += 2;
       } 
   }
 
if (messages.length>1) {
  i=2
  if ( i >= messages.length )
    i = 0; 
}
else
  i=0
 
function move1(whichlayer){
  tlayer=eval(whichlayer)
  if (tlayer.top>0&&tlayer.top<=dtop){
    tlayer.top=0
    setTimeout("move1(tlayer)",toppause)
    setTimeout("move2(document.main.document.second)",toppause)
    return
  }
  if (tlayer.top>=tlayer.document.height*-1){
    tlayer.top-=decrement
    setTimeout("move1(tlayer)",minipause)
  } else {
    tlayer.top=scrollerheight
    tlayer.document.write(messages[i])
    tlayer.document.close()
    if (i==messages.length-1)
      i=0
    else
      i++
  }
}
 
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=dtop){
tlayer2.top=0 
setTimeout("move2(tlayer2)",toppause)
setTimeout("move1(document.main.document.first)",toppause)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=decrement
setTimeout("move2(tlayer2)",minipause)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(messages[i])
tlayer2.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=dtop){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",toppause)
setTimeout("move4(second2)",toppause)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=decrement
setTimeout("move3(tdiv)",minipause)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=dtop){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",toppause)
setTimeout("move3(first2)",toppause)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=decrement
setTimeout("move4(second2)",minipause)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}}
function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
second2.style.visibility='visible'
}
else if (document.layers){
document.main.visibility='show'
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+decrement
document.main.document.second.visibility='show'
}
}
// This line is now in the HTML page to avoid sporadic javascript errors: window.onload=startscroll


