// Animated title bar with changing messages
var message = new Array();
// Messages to appear in title bar
message[0] = "Bolton St James";
message[1] = "Your parish church";
message[2] = "Join us at one of our services";
message[3] = "See how much we can offer you";
message[4] = "The church with the cross on Bolton Road";
message[5] = "Eager to serve you in the name of Christ";
message[6] = "Here to listen and here to pray";
// Number of times the cross cycle repeats with each message
var repeats = 2;
var speed=200;  // Set speed (larger = slower)
var place=message.length;
var text="";
var counter=0;
var messageCounter=0;
var position=0;
var timer=null;
if (repeats<1) repeats=1;
function startTitleSequence() {
	text=message[messageCounter];
	moveCross();
}
function moveCross() {
    position++;
    if (position>8) {position=1;}
    // Animated cross
    if (position==1) {document.title='+____ '+text+' ';}
    if (position==2) {document.title='_+___ '+text+' ';}
    if (position==3) {document.title='__+__ '+text+' ';}
    if (position==4) {document.title='___+_ '+text+' ';}
    if (position==5) {document.title='____+ '+text+' ';}
    if (position==6) {document.title='___+_ '+text+' ';}
    if (position==7) {document.title='__+__ '+text+' ';}
    if (position==8) {document.title='_+___ '+text+' ';}
    if (counter<(8*repeats)) {
    	timer=setTimeout("moveCross()",speed);
    	counter++;
	}else{
		counter=0;
        position=0;
        messageCounter++;
        if(messageCounter>place-1) messageCounter=0;
        timer=null;
        startTitleSequence();
   }
}
startTitleSequence();
