// news.js periodically updates the news box with items from the newsItems array.

var newsto = 8000; // time to next update, miliseconds
var newsitems = new Array(); // this array holds the news items
newsitems[0] = "5/18/10: Pranalytica announces 2-watt 4.0 micron laser system Model 1101-40."
newsitems[1] = "Kumar Patel and Pranalytica featured in SPIE Photonics West 2010 <a href=\"http://spie.org/x38990.xml\">article</a>.";
newsitems[2] = "6/24/09: Pranalytica selected by DARPA to continue development of high efficiency mid-infrared quantum cascade lasers.";
newsitems[3] = "5/19/09: Pranalytica ships the first 2 Watt continuous wave room temperature quantum cascade laser system.";
newsitems[4] = "2/4/09: In the news: Articles about Pranalytica have appeared in several print and online publications.  See the <a href=\"news.html\">news</a> page for links.";
newsitems[5] = "1/28/09: Pranalytica announces new PoyntIR<sup>&reg;</sup> handheld illuminators and BeckonIR<sup>&reg</sup> infrared beacons.";
newsitems[6] = "12/15/08: Pranalytica announces availability of the 2 Watt version of its Model 1101-46 quantum cascade laser system.";
//newsitems[6] = "news items can be added by putting more stuff in this array, start counting at 0";

// updateNews sets the news document element to newsitems[n], then sets a timer to
// call itself in 'newsto' miliseconds with an argument of n+1.  If 'n' is greater
// than the length of the newsitems array, n is reset to 0.
function updateNews(n) {
    // make sure n wraps around
    if (n > newsitems.length - 1) n = 0;

    document.getElementById("news").innerHTML = newsitems[n];

    // set timer for next update
    setTimeout("updateNews("+ (n+1) +")", newsto);
}