/* Create a page object */
var pageObj = {};

/* Get all the headers */
pageObj.headlines = document.getElementById("headlines");
pageObj.partners = document.getElementById("partners");

/******************/
/*    Headings    */
/******************/

function startScroll(){
	pageObj.headInterval = setInterval("moveHeadlines()", 40);
}

function moveHeadlines(){
	pageObj.headlines.style.top = --pageObj.headTop + "px";
	if(pageObj.headTop == pageObj.headEnd) {
		clearInterval(pageObj.headInterval);
		pageObj.headEnd -= 38;
		if(--pageObj.headTotal == 0) {  setTimeout("initiateScroll(); startScroll();", 3860); }
		else setTimeout("startScroll()", 4000);
	}
}

function initiateScroll(){
	pageObj.headTotal = 5;
	pageObj.headTop = 38;
	pageObj.headEnd = 0;
}

pageObj.headlines.style.position = "absolute";
pageObj.headlines.style.display = "block";

initiateScroll();
startScroll();

/******************/
/*    Partners    */
/******************/

function startScroll2(){
	pageObj.headInterval2 = setInterval("moveHeadlines2()", 40);
}

function moveHeadlines2(){
	pageObj.partners.style.top = --pageObj.headTop2 + "px";
	if(pageObj.headTop2 == pageObj.headEnd2) {
		clearInterval(pageObj.headInterval2);
		pageObj.headEnd2 -= 38;
		if(--pageObj.headTotal2 == 0) { setTimeout("initiateScroll2(); startScroll2();", 3860); }
		else setTimeout("startScroll2()", 4000);
	}
}

function initiateScroll2(){
	pageObj.headTotal2 = 5;
	pageObj.headTop2 = 38;
	pageObj.headEnd2 = 0;
}

pageObj.partners.style.position = "absolute";
pageObj.partners.style.display = "block";

initiateScroll2();
startScroll2();


