var msgsdelay = 300;  // msecs delay between messages
var chardelay = 100;   // msecs delay between characters in a message
var msgs = new Array()
    msgs[msgs.length?msgs.length:0] = "Craven Garth Farm Holiday Cottages  ";
    msgs[msgs.length?msgs.length:0] = "Wondered what the area looks like ";
    msgs[msgs.length?msgs.length:0] = "See a selection of photographs of the area ";
msgs[msgs.length?msgs.length:0] = "Scenes of the television series 'Heartbeat' ";
    msgs[msgs.length?msgs.length:0] = "View photographs sent in by holidaymakers ";
msgs[msgs.length?msgs.length:0] = "We are open all year round ";

// this function ensures that only 1 delay count
// is going on at once.
function NewScrolling() {
  stopScroll();
  startScroll();
}
var timerID   = null;  // 
var scrolling = false; // 
var msgNum    = 0;     // 
var atchar    = 0;     // 
function stopScroll() {
  if (scrolling) {
    clearTimeout(timerID);
    scrolling = false;
  }
}

function startScroll() {
  if (atchar < msgs[msgNum].length) {
    if (msgs[msgNum].charAt(atchar) == " ") atchar++ 
    defaultStatus = msgs[msgNum].substring(0, (atchar++) + 1);
    timerID = setTimeout("startScroll()", chardelay);
  } else {
    atchar = 0; //reset to begining of next msg.
msgNum = msgNum+1 == msgs.length?0:msgNum+1;// next message (around and around)
    timerID = setTimeout("startScroll()", msgsdelay);
  }
  scrolling = true;
}
NewScrolling()

