home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 November / Chip_2001-11_cd1.bin / firmy / Suma / scroll.js < prev    next >
Text File  |  2001-06-19  |  4KB  |  159 lines

  1.  
  2.     //configure the below five variables to change the style of the scroller
  3.     var scrollerwidth=300
  4.     var scrollerheight=50
  5.     var scrollerbgcolor="#F6FBFF"
  6. //    var scrollerbgcolor="RED"
  7.  
  8. //    var startlink = "<p align='center'><a target='main' href='";
  9. //    var endlink = "</font></a></p>";
  10. //    var midle = "'><font face='ariel CE'>";
  11. //    var starttext = "<p align='center'><font face='ariel CE' color='NAVY'>";
  12. //    var endtext = "</font></p>";
  13.  
  14.     var startlink = "<table><tr><td><p class='bantitle'><a target='main' href='";
  15.     var endlink = "</p></a></td>";
  16.     var midle = "'><p class='bantitle'>";
  17.     var starttext = "<table><tr><td><p class='bantitle'>";
  18.     var endtext = "</p></td>";
  19.     //set below to '' if you don't wish to use a background image
  20.     var scrollerbackground='images/bg.gif'
  21.     var messages=new Array()
  22.  
  23.     StartBanner();
  24.  
  25.  
  26.     function StartBanner(){
  27.     //configure the below variable to change the contents of the scroller
  28.     for (im=0; im<messtext.length;im++)
  29.     {
  30.         if (messlink[im] == ".")
  31.         {
  32.             messages[im]=starttext+messtext[im]+endtext;
  33.         }
  34.         else
  35.         {
  36.             messages[im]=startlink+messlink[im]+midle+messtext[im]+endlink;
  37.         }
  38.         if (messcena[im] != "0")
  39.         {
  40.             messages[im] += "<td><table width=107><tr><td><p class='bancena' align='right'>" + messcena[im] + "</p></td></tr></table>";
  41.         }
  42.         messages[im]+="</td></tr></table>"
  43.     }
  44.  
  45.     ///////Do not edit pass this line///////////////////////
  46.  
  47.     if (messages.length>1)
  48.         im=2
  49.     else
  50.         im=0
  51.  
  52.     }
  53.  
  54.     function move1(whichlayer){
  55.     tlayer=eval(whichlayer)
  56.     if (tlayer.top>0&&tlayer.top<=5){
  57.     tlayer.top=0
  58.     setTimeout("move1(tlayer)",3000)
  59.     setTimeout("move2(document.main.document.second)",3000)
  60.     return
  61.     }
  62.     if (tlayer.top>=tlayer.document.height*-1){
  63.     tlayer.top-=5
  64.     setTimeout("move1(tlayer)",100)
  65.     }
  66.     else{
  67.     tlayer.top=scrollerheight
  68.     tlayer.document.write(messages[im])
  69.     tlayer.document.close()
  70.     if (im>=messages.length-1)
  71.     im=0
  72.     else
  73.     im++
  74.     }
  75.     }
  76.  
  77.     function move2(whichlayer){
  78.     tlayer2=eval(whichlayer)
  79.     if (tlayer2.top>0&&tlayer2.top<=5){
  80.     tlayer2.top=0
  81.     setTimeout("move2(tlayer2)",3000)
  82.     setTimeout("move1(document.main.document.first)",3000)
  83.     return
  84.     }
  85.     if (tlayer2.top>=tlayer2.document.height*-1){
  86.     tlayer2.top-=5
  87.     setTimeout("move2(tlayer2)",100)
  88.     }
  89.     else{
  90.     tlayer2.top=scrollerheight
  91.     tlayer2.document.write(messages[im])
  92.     tlayer2.document.close()
  93.     if (im>=messages.length-1)
  94.     im=0
  95.     else
  96.     im++
  97.     }
  98.     }
  99.  
  100.     function move3(whichdiv){
  101.     tdiv=eval(whichdiv)
  102.     if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
  103.     tdiv.style.pixelTop=0
  104.     setTimeout("move3(tdiv)",3000)
  105.     setTimeout("move4(second2)",3000)
  106.     return
  107.     }
  108.     if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
  109.     tdiv.style.pixelTop-=5
  110.     setTimeout("move3(tdiv)",100)
  111.     }
  112.     else{
  113.     tdiv.style.pixelTop=scrollerheight
  114.     tdiv.innerHTML=messages[im]
  115.     if (im>=messages.length-1)
  116.     im=0
  117.     else
  118.     im++
  119.     }
  120.     }
  121.  
  122.     function move4(whichdiv){
  123.     tdiv2=eval(whichdiv)
  124.     if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
  125.     tdiv2.style.pixelTop=0
  126.     setTimeout("move4(tdiv2)",3000)
  127.     setTimeout("move3(first2)",3000)
  128.     return
  129.     }
  130.     if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
  131.     tdiv2.style.pixelTop-=5
  132.     setTimeout("move4(second2)",100)
  133.     }
  134.     else{
  135.     tdiv2.style.pixelTop=scrollerheight
  136.     tdiv2.innerHTML=messages[im]
  137.     if (im>=messages.length-1)
  138.     im=0
  139.     else
  140.     im++
  141.     }
  142.     }
  143.  
  144.     function startscroll(){
  145.     if (document.all){
  146.     move3(first2)
  147.     second2.style.top=scrollerheight
  148.     second2.style.visibility='visible'
  149.     }
  150.     else if (document.layers){
  151.     document.main.visibility='show'
  152.     move1(document.main.document.first)
  153.     document.main.document.second.top=scrollerheight+5
  154.     document.main.document.second.visibility='show'
  155.     }
  156.     }
  157.  
  158.     window.onload=startscroll
  159.