// JavaScript Document

var box = null; // object
var stp = false;

var clients = new Array(
"Johns Hopkins Hospital",
"Irvine Company",
"MetroWest Medical Center",
"General Motors",
"Greater Orlando Airport Authority",
"Brewery Blocks",
"JFK - International Air Terminal",
"Carnegie-Mellon University",
"Penn Tower Hotel",
"Lockheed Martin",
"AT&T Park",
"America Online",
"Harvard Medical School",
"Emerson Process Management",
"Multilayer Coating Technologies",
"Carrier Center",
"NFL Films",
"NASA",
"Glaxo SmithKline",
"Allegheny Energy",
"Fort Riley Military Housing",
"China Lake Naval Base",
"Museum of African American History",
"General Mills",
"Ellsworth Air Force Base",
"Applied Materials",
"New England Produce Center",
"Bell Atlantic Tower",
"Ireland Army Community Hospital",
"Delta Air Lines",
"McGuire Air Force Base",
"Andrews Air Force Base",
"Delta Community Credit Union",
"American Automobile Association",
"Eisenhower Army Medical Center",
"CICA-TEC",
"Atlanta Airlines Terminal Corporation",
"Massachusetts State Transportation Building",
"Digital Realty Trust",
"Kansas City International Airport",
"North American Energy Services",
"Army and Air Force Exchange Service",
"Avis",
"Fort Knox Armor Center",
"Federal Express",
"J. Strom Thurmond Lake, Dam and Power Plant",
"OfficeMax",
"Maxwell Air Force Base",
"NBC 10",
"Internal Revenue Service Center",
"Cairo International Medical Center"

);

var max_scroll = '-' + (clients.length * 45) + 'px';

function doMove() {
	if(stp == false) {
		if(box.style.top == max_scroll) {
			//alert(max_scroll);
			init();
		} else {
			box.style.top = parseInt(box.style.top) - 1 + 'px';
			setTimeout(doMove, 50); // call doMove in 40msec
		}
	} else {
		//alert(box.style.top); // TESTING
	}
}

function init() {
	box = document.getElementById('ticker'); // get the "ticker" object
	box.style.top = '80px'; // set its initial position
	doMove(); // start animating
}

function stopMove() {
	stp = true;
}

function startMove() {
	stp = false;
	setTimeout(doMove, 50); // call doMove in 40msec
}

window.onload = init;