
var msgsdelay = 400;  // msecs delay between messages
var chardelay = 100;   // msecs delay between characters in a message
var msgs = new Array()
msgs[msgs.length?msgs.length:0] = "Glanford Electronics  . . . . . . .     ";
msgs[msgs.length?msgs.length:0] = "we measure up . . . . ";
msgs[msgs.length?msgs.length:0] = "We are offering the EasyPat1600 at only £399 !  ";
msgs[msgs.length?msgs.length:0] = "and the Megger MFT1502 at the bargain price of £599     ";
msgs[msgs.length?msgs.length:0] = "with extra discounts off the range of Martindale Pat Testers,  ";
msgs[msgs.length?msgs.length:0] = " Check out our webshop for the latest offers!";
     
msgs[msgs.length?msgs.length:0] = "telephone or email today for the latest bargain offers . . . . ";
//msgs[msgs.length?msgs.length:0] = "";

//msgs[msgs.length?msgs.length:0] = "The people that get you talking . . .  ";
//msgs[msgs.length?msgs.length:0] = " See our calibration page and check our prices";
//msgs[msgs.length?msgs.length:0] = " Sales, Service, Calibration, Repairs ";
//msgs[msgs.length?msgs.length:0] = " Portable Appliance Testers . . . . ";
//msgs[msgs.length?msgs.length:0] = " choose the one for you on our PAT testers page   ";

// this function ensures that only 1 delay count
// is going on at once.
function NewScrolling() {
stopScroll();
startScroll();
}
var timerID   = null;  // necessary to kill it.
var scrolling = false; // used to know if it is already going.
var msgNum  = 0;  // which message is being displayed.
var atchar  = 0; // character currently displaying up to.
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()
