/* Copyright (C)1996 Web Integration Systems, Inc. DBA Websys, Inc.

   All Rights Reserved.



   This applet can be re-used or modified, if credit is given in 

   the source code.



   We will not be held responsible for any unwanted effects due to the 

   usage of this applet or any derivative.  No warrantees for usability 

   for any specific application are given or implied.



   Chris Skinner, January 30th, 1996.

*/

//*************************STATUS BAR SCROLL

function scrollit_r2l(seed)

{

        var m1 = "  Don't miss your chance (July 13 & 14) to see the greatest backyard paradises in the Hampton Roads area.  ";

        var m2 = "   Get your 'Parade of Ponds' tickets today, (757) 833-8110.   ";

        var m3 = "   Custom Gardens will host 'Pond Central' both days.   ";

      

        var msg=m1+m2+m3;

        var out = " ";

        var c   = 1;



        if (seed > 100) {

                seed--;

                var cmd="scrollit_r2l(" + seed + ")";

                timerTwo=window.setTimeout(cmd,100);

        }

        else if (seed <= 100 && seed > 0) {

                for (c=0 ; c < seed ; c++) {

                        out+=" ";

                }

                out+=msg;

                seed--;

                var cmd="scrollit_r2l(" + seed + ")";

                    window.status=out;

                timerTwo=window.setTimeout(cmd,100);

        }

        else if (seed <= 0) {

                if (-seed < msg.length) {

                        out+=msg.substring(-seed,msg.length);

                        seed--;

                        var cmd="scrollit_r2l(" + seed + ")";

                        window.status=out;

                        timerTwo=window.setTimeout(cmd,100);

                }

                else {

                        window.status=" ";

                        timerTwo=window.setTimeout("scrollit_r2l(100)",75);

                }

        }

}


//*************** SCROLL MESSAGE

var l1 =   0; // left of ticker in pixel, or 0 to position relative
var t1 =   0; // top of ticker in pixel, or 0 to position relative
var w1 = 460; // width of ticker in pixel
var ie = document.all ? true : false;
var first = true;
var l2 = l1 + w1;
var l3 = l1 - l2;
var l = l2;
function tickinit() {
if (ie) {
if (l1 == 0 && t1 == 0) {
pos = document.all['tickpos'];
l1 = getLeft(pos);
t1 = getTop(pos);
}
ticktext.style.posTop = t1;
}
else {
if (l1 == 0 && t1 == 0) {
pos = document.anchors['tickpos'];
l1 = pos.x;
t1 = pos.y;
}
document.ticktext.pageY = t1;
}
l2 = l1 + w1;
l3 = l1 - l2;
l = l2;
setInterval('tick()', 1);
}
function getLeft(ll) {
if (ll.offsetParent)
return (ll.offsetLeft + getLeft(ll.offsetParent));
else 
return (ll.offsetLeft);
}
function getTop(ll) {
if (ll.offsetParent)
return (ll.offsetTop + getTop(ll.offsetParent));
else
return (ll.offsetTop);
}
//** CHANGE SPEED
function tick() {
l = l - 2.5;
if (l < l3) l = l2;
cl = l1 - l;
cr = l2 - l;
if (ie) {
ticktext.style.posLeft = l;
ticktext.style.posTop = t1;
ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
if (first) ticktext.style.visibility = "visible";
}
else {
document.ticktext.pageX = l;
document.ticktext.clip.left = cl;
document.ticktext.clip.right = cr;
if (first) document.ticktext.visibility = "show";
}
first = false;
}




//********************************************************************************
//
//     OnLoad function
//
//********************************************************************************


function scrollRun()
{

   //If you want the STATUS BAR to run a scroll message, set SCROLL_BAR = 1
  
   var scroll_bar = 0;  //1 for true, 0 for false

   //If you want the IN-PAGE SCROLL to run a scroll message, set SCROLL_MESSAGE = 1
   // **NOTE** In text scroll requires commenting out or in the scroll message <DIV>

   var scroll_message = 0;    //1 for true, 0 for false
   
   // ARRAY OF ARGUMENT VALUES
   var argv = scrollRun.arguments;

   // THE NUMBER OF ARGUMENTS PASSED TO THIS FUNCTION
   var argc = argv.length;


         //*************
         //
         //  argv[0] is scroll_bar
         //  argv[1] is scroll_message
         //
         //*************

   if (argc > 0)
   {
      scroll_bar = argv[0];
      scroll_message = argv[1];
   }
   
   if (scroll_bar == "1")
   {
      timerONE=window.setTimeout('scrollit_r2l(100)',100);
   }
   if (scroll_message == "1")
   {
      tickinit();
   }
}