var t = 0;

function Ticker()
{
var MonthName = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");

var xmlhttp = new ActiveXObject("Msxml2.DOMDocument");
var xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
xmlDoc.open("GET","http://www.bayer.com/module/xml/share-price.xml",false);
xmlDoc.send();
xmlhttp.loadXML(xmlDoc.responseText); 

var CName = "sharePrices/sharePrice";
a = xmlhttp.selectNodes(CName+"/name");
b = xmlhttp.selectNodes(CName+"/price");
c = xmlhttp.selectNodes(CName+"/percent_change");
d = xmlhttp.selectNodes(CName+"/date/month");
e = xmlhttp.selectNodes(CName+"/date/day");
f = xmlhttp.selectNodes(CName+"/date/year");
g = xmlhttp.selectNodes(CName+"/time/hour");
h = xmlhttp.selectNodes(CName+"/time/min");

if (c[t].text>0)
{
var c1="<img src=\"../Files/Icons/$file/arrow_up.gif\" style=\"border:none;\">";
}
else if (c[t].text<0)
{
var c1="<img src=\"../Files/Icons/$file/arrow_down.gif\" style=\"border:none;\">";
}
else
{
var c1="<img src=\"../Files/Icons/$file/arrow_same.gif\" style=\"border:none;\">";
}

if (t==0)
{
var a1 = a[0].text;
a1 = a1.substring(0,9);
curr = "EUR";
}
else if (t==1)
{
var a1 = a[1].text;
a1 = a1.substring(0,6);
curr = "GBX";
}
else if (t==2)
{
var a1 = a[2].text;
a1 = a1.substring(0,8);
curr = "USD";
}
else if (t==3)
{
var a1 = a[3].text;
curr = "EUR";
}

var d_adj=(Math.abs(d[t].text))-1;

price_ticker = "<a href=\"http://www.investor.bayer.com/en/aktie/kursinformationen/\" target=\"_self\" style=\"text-decoration:none;color:#666666;\"><span style=\"font:bold 12px arial,helvetica;color:#666666;\">"+a1+": "+b[t].text+" "+curr+" "+c1+" "+c[t].text+"</span><br><span style=\"font-style:normal;color:#666666;\">"+MonthName[d_adj]+" "+e[t].text+", "+f[t].text+"&nbsp;&nbsp;&nbsp;"+g[t].text+":"+h[t].text+" Hrs</a>";

document.getElementById("prices").innerHTML= price_ticker;
t++;
window.setTimeout("Ticker()",3000);

if (t>1)
{
t=0;
}

}