//Copyright 2011-12-24 William O. Adams Jr.
//All rights reserved
//input type=text name=ticker_tape style=background: white; width: 200px; border: 0px; color: black; size=55
var id,pause=0,position=0;
var msgindex=0;
var msgarray = [];
msgarray[0] = '2012-2-12 Living room - 2 new blinds, 1 new shade';
msgarray[1] = '2012-1-19 Living room - 4 new drapes';
msgarray[2] = '2012-1-3 Save Blueprint as .eps file and snapshot as .png';
msgarray[3] = '2012-1-1 Blueprint measurements simplified';
msgarray[4] = '2011-12-23 New knotty alder in 5 stains';
msgarray[5] = '2011-12-12 Insparia Professional - align granite slabs from photos';
msgarray[6] = 'Make 2012 a banner year with Insparia in your showroom strengthening your sales cycle. Email for professional pricing.';
msgarray[7] = '2011-11-29 Living room - 7 new floor lamps';
msgarray[8] = '2011-11-21 Living room - 2 new fireplaces';
msgarray[9] = '2011-11-12 Living room - 1 new entertainment center';
msgarray[10] = '2011-11-5 Living room - 8 new coffee tables';

var msgboxsize = 100;

function ticker() {
var i,k;
var spacer = "";
  //msgboxsize = document.form2.ticker_tape.size;
  for(k=0;k<msgarray.length;k++) {
    spacer = ""
    for(i=0;i<msgboxsize;i++) { 
      spacer += " "; 
    }
    msgarray[k] = spacer + msgarray[k];
    //alert(msgarray[k] + ", " + msgarray[k].length);
  }
  //msgboxsize = document.form2.ticker_tape.size;
  tickerun();
}

function tickerun() {
  if(position++ > msgarray[msgindex].length) {
    position=0;
    msgindex++;
    if(msgindex >= msgarray.length) msgindex = 0;
  }
  document.form2.ticker_tape.value=msgarray[msgindex].substring(position,position+msgboxsize);
  id=setTimeout("tickerun()",100); //1000/10
}

function action() {
  if(!pause) {
    clearTimeout(id);
    pause=1; 
  } else {
    ticker();
    pause=0; 
  }
}

 

