var msg=new Array()
msg[0]="<FONT FACE='Tahoma' style='font-size: 11pt'><b>به شبكه فن آوري اطلاعات ايران (www.IRITN.com) خوش آمديد.</b></FONT>"
msg[1]="<FONT FACE='Tahoma' style='font-size: 8pt'><a href='index.php?action=show&type=news&id=7275'><B>امكان استفاده از مطالب سايت با كمك تكنولوژي RSS فراهم گرديد.</B></a></FONT>"
msg[2]="<FONT FACE='Tahoma' style='font-size: 9pt'><a href='index.php?action=show&type=signup'> در راستاي <b>حمايت سايتهايي كه از سيستم نمايشگر اخبار ما استفاده مي‌كنند</b>، گزينه 'برگشت' در پايان صفحه بصورتي تعريف شده تا كاربر بتواند مجددا به سايت اوليه رجوع نمايد.</a></FONT>"
msg[3]="<FONT FACE='Tahoma' style='font-size: 8pt'><a href='index.php?action=show&type=news&id=465'><B>قابل توجه كليه مديران سايتها: از اين پس مي‌توانيد با اضافه نمودن چند خط كد HTML در سايت خود، آخرين اخبار سايت ما را بصورت OnLine نمايش دهيد.</B></a></FONT>"
msg[4]="<FONT FACE='Tahoma' style='font-size: 8pt'><a href='/banner'><B>لطفا به منظور حمايت از شبكه فن آوري اطلاعات ايران، يكي از بنرهاي ما را (از طريق همين لينك) برروي سايت خود قرار دهيد.</B></a></FONT>"
msg[5]="<FONT FACE='Tahoma' style='font-size: 8pt'><a href='index.php?action=show&type=signup'><B>با عضويت در اين سايت از امكان جستجو در كل مطالب سايت بهره‌مند شويد...</B></a></FONT>"

/* The variables below are the ones you want to change  */

speed=60                      // Sets the speed in milliseconds at which the link or text scrolls.
var divwidth=550            // Sets the width of the div or layer in pixels.  You will have to play with this to get it set correctly.
var divheight=30            // Sets the height of the div or layer in pixels.  Same as above.

var divincbt=1                 
var divinctb=-1
var divincrl=10
var divinclr=-10

var divpause=4000        // Sets how long to pause in milliseconds before scrolling the next link or text. 

var divtop="-8"              // divtop and divleft set the top and left positions of the container div or layer in pixels. 
var divleft="40"

var divcolor=""      // Sets the background color of the div or layer

var divname1="scroll2"  // Sets the name of your div or layer for the first link or text that is displayed
var divname2="scroll3"  // Sets the name of your div or layer for the next link or text to be displayed

/*
   The variable whichscroll is used to set the direction of the scrolling.  It is currently set to 1.
    1 = Bottom to Top
    2 = Top to Bottom
    3 = Right to Left
    4 = Left to Right
*/
var whichscroll="1"

/* END OF CONFIGURATION VARIABLES */

/* THERE IS NO NEED TO CHANGE THE VARIABLES OR SCRIPTS BELOW */

var divinc
var stopposa
var stopposb
var scrollmsga
var scrollmsgb 
var thediva
var thedivb
var posa
var posb
var ii=msg.length
var firsttime="y"
var divprop
var whichdiv=divname1
if(whichscroll=="1")
  {
   stopposa=0
   stopposb=divheight*-1
   divprop="top"
   divinc=divincbt
  }
if(whichscroll=="2")
  {
   stopposa=0
   stopposb=divheight
   divprop="top"
   divinc=divinctb
  }
if(whichscroll=="3")
  {
   stopposa=0
   stopposb=divwidth*-1
   divprop="left"
   divinc=divincrl
  }
if(whichscroll=="4")
  {
   stopposa=1
   stopposb=divwidth+2
   divprop="left"
   divinc=divinclr
  }

function Scrollboxa(obja)
     {
         savobja=obja
         posa=posa-divinc
         if(((whichscroll=="1" || whichscroll=="3")&&(posa<=stopposa))||
           ((whichscroll=="2" || whichscroll=="4")&&(posa>=stopposa)))
           {
            clearTimeout(scrollmsga)
            setTimeout("scrollit()",divpause)
           } 
         else
             {
              if(document.getElementById) // IE5 and NS6
                {
                 eval("elma.style."+divprop+"=posa")
                 elma.style.visibility="visible"
                }
              if(document.layers)    // NS4+
                {
                 eval("obja."+divprop+"=posa")
                 document.main.visibility="show"
                }
              scrollmsga=setTimeout("Scrollboxa(savobja)",speed)
             }
     }
function Scrollboxb(objb)
     {
         savobjb=objb
         posb=posb-divinc
         if(((whichscroll=="1" || whichscroll=="3")&&(posb<=stopposb))||
            ((whichscroll=="2" || whichscroll=="4")&&(posb>=stopposb)))
           {
            clearTimeout(scrollmsgb)
           }
         else
              {
               if(document.getElementById) // IE5 and NS6
                 {
                  eval("elmb.style."+divprop+"=posb")
                 }
               if(document.layers)  // NS4+
                 {
                  eval("objb."+divprop+"=posb")
                  objb.visibility="show"
                 }
               scrollmsgb=setTimeout("Scrollboxb(savobjb)",speed)
              }
     }
function scrollit()
   {
    ii++
    if(ii>=msg.length)
      {ii=0}
    posa=stopposb*-1
    posb=0
    if(firsttime=="y")
      {
       firsttime= "n"
       if(document.getElementById)      // IE5 and NS6
         {
          elma=document.getElementById(divname1)
          elma.innerHTML=msg[ii]
         }
      if(document.layers)   // NS4+
        {
         thediva=eval("document.main.document."+divname1)
         thediva.document.write(msg[ii])
         thediva.document.close()
        }
       Scrollboxa(thediva)
      }
    else
      {
       if(whichdiv==divname1)
         {
          if(document.getElementById)  // IE5 and NS6
            {
             elmb=document.getElementById(divname1)
             elma=document.getElementById(divname2)
             elma.innerHTML=msg[ii]
            }
          if(document.layers)  //  NS4+
            {
             thedivb=eval("document.main.document."+divname1)
             thediva=eval("document.main.document."+divname2)  
             thediva.document.write(msg[ii])
             thediva.document.close()
            }
          Scrollboxb(thedivb)
          whichdiv=divname2
          Scrollboxa(thediva)
         }
       else
         {
          if(document.getElementById)   // IE5 and NS6
            {
             elmb=document.getElementById(divname2)
             elma=document.getElementById(divname1)
             elma.innerHTML=msg[ii]
             }
          if(document.layers)  // NS4+
            {
             thedivb=eval("document.main.document."+divname2)
             thediva=eval("document.main.document."+divname1)
             thediva.document.write(msg[ii])
             thediva.document.close()
             }
          Scrollboxb(thedivb)
          whichdiv=divname1
          Scrollboxa(thediva)
         }
      }
  }
