<!--

// intialise main variables and arrays
var vCharacterTimeout = 50;
var vHeadlineTimeout = 7000;
var vTypewriterStyle1 = "_";
var vTypewriterStyle2 = "";
var vTypewriterStyleNone = "";
var vHeadlineSummary   = "";

var vHeadline = new Array();
var vSiteLinks = new Array();

var theItemCount = 3;
vHeadline[0] = "A Commitment to the Future, World's largest tube press installation opens at Rocks. More...";
vSiteLinks[0] = "news/news4.html";
vHeadline[1] = "Introducing Barrisurf, a new range of kaolins for barrier applications. More...";
vSiteLinks[1] = "products/new-products.html";
vHeadline[2] = "Proposed Closure of Ground Calcium Carbonate Facility in Salisbury, UK. More...";
vSiteLinks[2] = "news/news5.html";

//start typewriter function once document loaded

window.onload = function startType()
{
	vCurrentStory     = -1;
	vCurrentLength    = 0;
	
		if (!document.getElementById) return false;
		vAnchorObject     = document.getElementById("typePoint");
		if(vAnchorObject != undefined){
			runTypeWriter();
		}
}

// main typewiter loop run
function runTypeWriter()
{
	var myTimeout;  
	if(vCurrentLength == 0)
	{
		vCurrentStory++;
		vCurrentStory      = vCurrentStory % theItemCount;
		vHeadlineSummary      = vHeadline[vCurrentStory].replace(/&quot;/g,'"');		
		vTargetLink        = vSiteLinks[vCurrentStory];
		vAnchorObject.href = vTargetLink;
	}
	
	if (vHeadlineSummary.Length == 0) vHeadlineSummary = "imerys-paper.com - The Multi-Pigment Provider";
	
	vAnchorObject.innerHTML = vHeadlineSummary.substring(0,vCurrentLength) + whatWidget();
	
	if(vCurrentLength != vHeadlineSummary.length)
	{
		vCurrentLength++;
		myTimeout = vCharacterTimeout;
	}
	else
	{
		vCurrentLength = 0;
		myTimeout = vHeadlineTimeout;
	}
	setTimeout("runTypeWriter()", myTimeout);
}
// Widget generator
function whatWidget()
{
	if(vCurrentLength == vHeadlineSummary.length)
	{
		return vTypewriterStyleNone;
	}

	if((vCurrentLength % 2) == 1)
	{
		return vTypewriterStyle1;
	}
	else
	{
		return vTypewriterStyle2;
	}
}
-->
