var id;
var msg = "Welcome to the largest Subaru Dealer in the nation!  ";

var xmlDoc;
function importXML(file) {
  var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined');
  var ie = (typeof window.ActiveXObject != 'undefined');
  if (moz) {
    xmlDoc = document.implementation.createDocument("","",null);
    xmlDoc.async = false;
    xmlDoc.load(file);
    incentives = xmlDoc.getElementsByTagName("incentives");
    for(var i=0; i < incentives.length; i++) {
      msg = incentives[i].getElementsByTagName("theIncentive")[0].childNodes[0].nodeValue;
      //alert(msg);
    }
  } else if (ie) {
    xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async = false;
    while(xmlDoc.readyState != 4) {};
    xmlDoc.load(file);
    msg = xmlDoc.getElementsByTagName("theIncentive").item(0).text;
  }
}

theUrl = window.location.pathname;
if(theUrl.indexOf("/LiveInventory/") >= 0) {
  importXML("../xml/currentIncentive.xml");
} else {
  importXML("xml/currentIncentive.xml");
}

msg = msg.replace("&amp;", "&")

function scroll() {
  var lchar;
  lchar	= msg.substring(0,1);
  msg		+= lchar;
  msg		= msg.substring(1,msg.length);
  document.getElementById("displayScroll").value = msg.substring(0,80);
  id		= setTimeout("scroll()", 250);
}
