var theAnchorObject = 0;
var theCharacterTimeout = 50;
var theStoryTimeout = 2000;
var theSummaries = new Array();
var theSiteLinks = new Array();
var i = 0;



theSummaries[i] = 'Islamic Finance has Setback in UK, Shows Progress in France';
theSiteLinks[i] = 'pressreleases.html';
i++;


theSummaries[i] = 'Civil Code Amendment to Help The Sukuk Market Take Off in France';
theSiteLinks[i] = 'pressreleases.html';
i++;

theSummaries[i] = 'UK Islamic Bank Gets Foothold in France';
theSiteLinks[i] = 'pressreleases.html';
i++;


theSummaries[i] = 'Investors Flock to Dubai\'s Sukuk Sale';
theSiteLinks[i] = 'pressreleases.html';
i++;

theSummaries[i] = 'Luxembourg Advised of More Involvement in Islamic Finance';
theSiteLinks[i] = 'pressreleases.html';
i++;

theSummaries[i] = 'Malaysia Renews Pledge to Islamic Finance';
theSiteLinks[i] = 'pressreleases.html';
i++;

theSummaries[i] = 'HK Sukuk Gets New Boost';
theSiteLinks[i] = 'pressreleases.html';
i++;

theSummaries[i] = 'UBS to Widen Islamic Offerings ';
theSiteLinks[i] = 'pressreleases.html';
i++;


theSummaries[i] = 'GE’s Sukuk';
theSiteLinks[i] = 'pressreleases.html';
i++;

var theItemCount = theSummaries.length;

function startTicker()
{
	// Define run time values
	theCurrentStory     = -1;
	theCurrentLength    = 0;
	
	// Locate base objects
	if(document.getElementById)
	{	
		theAnchorObject = document.getElementById("tickerAnchor");
		runTheTicker();   	
	}
	else
	{
		document.write("Javascript is turned off in your browser");
		return true;
	}
}

// Ticker main run loop
function runTheTicker()
{
	var myTimeout;  

	// Go for the next story data block
	if(theCurrentLength == 0)
	{
		theCurrentStory++;
		theCurrentStory = theCurrentStory % theItemCount;
		theStorySummary = theSummaries[theCurrentStory].replace(/&quot;/g,'"');		
		theTargetLink = theSiteLinks[theCurrentStory];
		theAnchorObject.href = theTargetLink;
	}

	// Stuff the current ticker text into the anchor
	theAnchorObject.innerHTML = theStorySummary.substring(0,theCurrentLength) + ((theCurrentLength == theStorySummary.length) ? "" : "_");

	// Modify the length for the substring and define the timer
	if(theCurrentLength != theStorySummary.length)
	{
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}

	// Call up the next cycle of the ticker
	setTimeout("runTheTicker()", myTimeout);
}


startTicker();