var GoValue;
GoValue = "";

//Create list of texts
var line=new Array();
line[1]="Focus on Scheduling. Only the \'Lean\' Survive!";
line[2]="How Manufacturing Intelligence can increase your bottom-line";
line[3]="Integrated Technology enables OEE optimisation";
line[4]="The new driving force behind Lean Manufacturing Initiatives.";
line[5]="Manufacturing Performance and OEE";
line[6]="Wonderware UK & EmsPT Announce Lean Manufacturing Event";
line[7]="Latest EmsPT News";

//Create list of links
var linkage=new Array();
linkage[1]="/news/focus-on-scheduling-only-the-lean-survive/4/";
linkage[2]="/news/how-manufacturing-intelligence-can-increase-your-bottom-line/5/";
linkage[3]="/news/integrated-technology-enables-oee-optimisation/6/";
linkage[4]="/news/the-new-driving-force-behind-lean-manufacturing-initiatives/7/";
linkage[5]="/news/manufacturing-performance-and-oee/8/";
linkage[6]="/news/wonderware-uk-emspt-announce-lean-manufacturing-event/3/";
linkage[7]="";

//Specify font size for scoller
var ts_fontsize="10px";

//Scroll through the texts and see which is longest
var longestmessage=1;
for (i=2;i<line.length;i++)
{
if (line[i].length>line[longestmessage].length)
{
longestmessage=i;
}
}

//Auto set scroller width
var tscroller_width=line[longestmessage].length;

lines=line.length-1;

//if IE 4+ or NS6
if (document.all||document.getElementById)
{
document.write('<div id="contentToWrite"></div>');
}

temp="";
ahref="";
nextchar=-1;
nextline=1;
cursor="_";

function animate()
{
if(temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines)
{
//At this point the type has scrolled, we want to add the link to either side
ahref=linkage[nextline];
GoValue=ahref;
nextline++;
nextchar=-1;
if(ahref != "")
{
document.getElementById('contentToWrite').innerHTML="<p><a href=\"" + ahref + "\">" + temp + "</a></p>";
}
else
{
document.getElementById('contentToWrite').innerHTML="<p><strong>" + temp + "</strong></p>";
}
temp="";
ahref="";
setTimeout("nextstep()",5000);
}
else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length)
{
nextline=1;
nextchar=-1;
document.getElementById('contentToWrite').innerHTML="<p><strong>" + temp + "</strong></p>";
temp="";
setTimeout("nextstep()",5000);
}
else
{
nextstep();
}
}

function nextstep()
{
nextchar++;
temp+=line[nextline].charAt(nextchar);
if(nextline != "7")
{
document.getElementById('contentToWrite').innerHTML="<p><strong>" + temp + cursor + "</strong></p>";
}
else
{
document.getElementById('contentToWrite').innerHTML="<p><strong>" + temp + cursor + "</strong></p>";
}
setTimeout("animate()",25);
}

function go_button()
{
if(GoValue != "")
{
document.location.href = GoValue;
}
}
//if IE 4+ or NS6
if (document.all||document.getElementById)
{
window.onload=animate;
}

