/*
xbMarquee-test.js

This script performs the setup for a number of 
demonstration tests of the xbMarquee object.

*/

function startMarquee(id, dir, behav)
{
  var elm;
  var height;
  var width;

  switch (dir)
  {
  case 'up':
  case 'down':
    // use divs to contain each item in the marquee to force
    // each item to begin on different lines
    elm = 'div';
    height = 100;
    width  = 200;
    break;

  case 'left':
  case 'right':
  default:
    // use spans to contain each item in the marquee to force
    // each item to begin on the same line
    elm = 'span';
    height = 20;
    width  = 600;
    break;
  }

  var html = 
  '<' + elm + ' style="background-color: green;">1<\/' + elm + '>' +
  '<' + elm + ' style="background-color: blue;">2<\/' + elm + '>' +
  '<' + elm + ' style="background-color: red;">3<\/' + elm + '>' +
  '<' + elm + ' style="background-color: green;">4<\/' + elm + '>' +
  '<' + elm + ' style="background-color: blue;">5<\/' + elm + '>' +
  '<' + elm + ' style="background-color: red;">6<\/' + elm + '>' +
  '<' + elm + ' style="background-color: green;">7<\/' + elm + '>' +
  '<' + elm + ' style="background-color: blue;">8<\/' + elm + '>' +
  '<' + elm + ' style="background-color: red;">9<\/' + elm + '>' +
  '<' + elm + ' style="background-color: green;">10<\/' + elm + '>' +
  '<' + elm + ' style="background-color: blue;">11<\/' + elm + '>' +
  '<' + elm + ' style="background-color: red;">12<\/' + elm + '>' +
  '<' + elm + ' style="background-color: green;">13<\/' + elm + '>' +
  '<' + elm + ' style="background-color: blue;">14<\/' + elm + '>' +
  '<' + elm + ' style="background-color: red;">15<\/' + elm + '>' +
  '<' + elm + ' style="background-color: green;">16<\/' + elm + '>' +
  '<' + elm + ' style="background-color: blue;">17<\/' + elm + '>' +
  '<' + elm + ' style="background-color: red;">18<\/' + elm + '>' +
  '<' + elm + ' style="background-color: green;">19<\/' + elm + '>' +
  '<' + elm + ' style="background-color: blue;">20<\/' + elm + '>' +
  '<' + elm + ' style="background-color: red;">21<\/' + elm + '>' +
  '<' + elm + ' style="background-color: green;">22<\/' + elm + '>' +
  '<' + elm + ' style="background-color: blue;">23<\/' + elm + '>' +
  '<' + elm + ' style="background-color: red;">24<\/' + elm + '>' +
  ''
  ;

  var marquee = new xbMarquee(id, height, width, 6, 85, dir, behav, html);

  // due to limitations in Internet Explorer's initialization of
  // element heights and widths, execute the marquee start method
  // in the page's load event handler.
  window.onload = function () {marquee.start();};
}
