
var nt_i = 0;
var nt_j = 0;
var ndp = "";
var pint = 100;								// print interval
var tdelay = 6000;							// news ticker delay
var newsstring = new Array();				// array containing headlines and link to corresponding pages
newsstring[0] = new Array(	"Acadian Timber selects 3LOG",
							"forestry-software-news/1002Acadian.shtml");
newsstring[1] = new Array(	"RSG Forest products selects 3LOG",
							"forestry-software-news/1009RSG.shtml");
newsstring[2] = new Array(	"NewPage selects 3LOG as corporate solution",
							"forestry-software-news/0809NewPage.shtml");
newsstring[3] = new Array(	"3LOG improves user efficieny",
							"forestry-software-news/07093LOGuserinterface.shtml");
newsstring[4] = new Array(	"Sun Mountain selects 3LOG",
							"forestry-software-news/0609SunMountain.shtml");
newsstring[5] = new Array(	"Conifex, Inc. goes live with 3LOG solution",
							"forestry-software-news/0209Conifex.shtml");
newsstring[6] = new Array(	"Roseburg upgrades to LIMS5",
							"forestry-software-news/020Roseburg.shtml");
newsstring[7] = new Array(	"Major TIMO installs 3LOG's LIMS",
							"forestry-software-news/0607TIMO.shtml");
newsstring[8] = new Array(	"Wood Resources LLC selects 3LOG",
							"forestry-software-news/0209WoodResources.shtml");
newsstring[9] = new Array(	"Lonza moves forward with 3LOG",
							"forestry-software-news/0909Lonza.shtml");


function nt_tick() {
	var nct = newsstring[nt_i][0].split(' ');				// split words
	ndp += (nct[nt_j] + " ");								// attach one word to chain (ndp)
	
	var newsticker = document.getElementById("newsticker");	// get newsticker obj
	
	// remove existing child (assuming 1)
	if (newsticker.hasChildNodes) {
		var victim = newsticker.firstChild;
		newsticker.removeChild(victim);
	}
	
	// append new anchor node with ndp as nodeValue
	var newANode = document.createElement("a");
	newANode.setAttribute("href",newsstring[nt_i][1]);
	newANode.setAttribute("class","newsticker");
	var tempc = newANode.getAttribute("class");
	valANode = document.createTextNode(ndp);
	newANode.appendChild(valANode);
	newsticker.appendChild(newANode);
	
	//newsticker.innerHTML = "<a href ='" + newsstring[nt_i][1] + "' class='newsticker'>" + ndp + "</a>";
	if (nt_j < nct.length - 1) {
		nt_j++;
		setTimeout("nt_tick()",pint);
	} else {
		nt_j = 0;
		ndp = "";
		if (++nt_i == newsstring.length) nt_i = 0;
		setTimeout("nt_tick()",tdelay);
	}
}


