



var status_message = "Welcome to the Great Divide"
var delay_time = 50      // The scroll delay (smaller = faster)
var start_position = 150 // How far right the message starts
var maximum_scrolls = 2  // The maximum number of scrolls

// Pad the message with spaces to get the "start" position
for (var counter = 1; counter <= start_position; counter++) {
   status_message = " " + status_message
}

var current_position = 0
var total_scrolls = 0

// Launch the interval
var interval_id = setInterval("scroll_message()", delay_time)

// Call this function at the end of each interval
function scroll_message(){

   current_position++ 

   // Are we still less than the length of the message?
   if (current_position < status_message.length)

      // If so, then display the message only from the current position
      status = status_message.substring(current_position)
   
   else {

      // If not, then the message has scrolled off the left side.
      current_position = 0 // Reset the current position
      total_scrolls++ // Increment the total scrolls

      // Have we reached the maximum number of scrolls?
      if (total_scrolls == maximum_scrolls) {

         // If so, bail out of the interval and function
         clearInterval(interval_id)
         status = ""
         return
      }
   }
}


