var GoValue;
GoValue = "";

//Create list of texts
var line=new Array();
line[1]="Flight restrictions may cause shipment delays";
line[2]="HardwarePT adds 802.11b/g Industrial Wireless Access Point";
line[3]="19” and 23” Industrial Monitors for nautical applications ";
line[4]="ACP released ThinManager 3.3";
line[5]="New 5.7\" Touch Panel PC with Intel XScale® PXA270 312 MHz processor ";
line[6]="New Industrial Computer 15\" Panel PC";
line[7]="Latest HardwarePT News";

//Create list of links
var linkage=new Array();
linkage[1]="/company/news/flight-restrictions-may-cause-shipment-delays/26/";
linkage[2]="/company/news/hardwarept-adds-80211bg-industrial-wireless-access-point/25/";
linkage[3]="/company/news/19-and-23-industrial-monitors-for-nautical-applications-/24/";
linkage[4]="/company/news/acp-released-thinmanager-33/23/";
linkage[5]="/company/news/new-57-touch-panel-pc-with-intel-xscale-pxa270-312-mhz-processor-/22/";
linkage[6]="/company/news/new-industrial-computer-15-panel-pc/21/";
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;
}
