// JavaScript Document

var isFirst = 0

function startTicker(){
theCurrentStory = -1;
theCurrentLength = 0;
if (document.getElementById)
{
theAnchorObject = document.getElementById("tickerAnchor");
runTheTicker();
}
else
{ document.write("<style>.ticki{display:none;}.ticko {border:0px; padding:0px;}</style>");
return true;
}
}
function runTheTicker()
{
if(theCurrentLength == 0)
{
theCurrentStory++;
theCurrentStory = theCurrentStory % theItemCount;
theStorySummary = theSummaries[theCurrentStory].replace(/&quot;/g,'"');

thePrefix = "<span class=\"tickls\">" + theLeadString + "</span>";
}
theAnchorObject.innerHTML = thePrefix +
theStorySummary.substring(0,theCurrentLength) + whatWidget();

if(theCurrentLength != theStorySummary.length)
{
theCurrentLength++;
myTimeout = theCharacterTimeout;
setTimeout("runTheTicker()", myTimeout);
}
else
{
theCurrentLength = 0;
myTimeout = theStoryTimeout;
}

}

function whatWidget()
{
if(theCurrentLength == theStorySummary.length)
{
return theWidgetNone;
}

if((theCurrentLength % 2) == 1)
{
return theWidgetOne;
}
else
{
return theWidgetTwo;
}
}

var theCharacterTimeout = 50;
var theStoryTimeout = 5000;
var theWidgetOne = "_";
var theWidgetTwo = "-";
var theWidgetNone = "";
var theLeadString = "<span>LATEST:</span>&nbsp;";
var myTimeout;

var theSummaries = new Array();
var theSiteLinks = new Array();
var theItemCount = 3;

theSummaries[0] = "Crystal Court - Retirement living for the over 55's in the heart of Tutbury";
theSiteLinks[0] = "";

theSummaries[1] = "with Shared Ownership available on selected plots.";
theSiteLinks[1] = "";

theSummaries[2] = "CALL 0800 032 3877 FOR MORE DETAILS";
theSiteLinks[2] = "";


