/*------------------------------------------------------------------------------
List of functions:

		 fnChangeNews()

------------------------------------------------------------------------------*/
// global variables (must initilaise to value)
var strNewsLine= new Array(
  "ORDER BACKLOG: there is currently no order backlog",
  "We will contact you with a fabrication date once your order is placed",
  "UK residents can now make online credit & debit card purchases",
  "Buy up to GBP(\u00A3)300 using our secure service from NOCHEX.com",
  "Rubber and steel tyres now available on the products page",
  "Decorative Wheels wishes all our visitors a prosperous 2009");

var iNewsLineCounter= 0;
var iNewsTitleCounter= 0;
var strTitleDir= "up";
//------------------------------------------------------------------------------
// function to change the news bar items
function fnChangeNews()
{
  // set alignment position of title text
	var strTitlePos= (iNewsTitleCounter== 0)? "left":
  								 (iNewsTitleCounter== 1)? "center":
  								 (iNewsTitleCounter== 2)? "right": "";
  // detect if couting up or down and increment counter
	if (iNewsTitleCounter>= 0 && strTitleDir== "up")
  {
   	iNewsTitleCounter++;
  	strTitleDir= (iNewsTitleCounter== 2)? "down": "up";
  } // end if
  else if (iNewsTitleCounter<= 2 && strTitleDir== "down")
  {
   	iNewsTitleCounter--;
  	strTitleDir= (iNewsTitleCounter== 0)? "up": "down";
  } // end else if
  // set input name field to position of title text
  document.formX.news_left.style.textAlign=  strTitlePos;
  document.formX.news_right.style.textAlign= strTitlePos;
  // set value of news text to array value
  document.formX.news_text.value= strNewsLine[iNewsLineCounter];
  // increment news counter
	iNewsLineCounter++;
	// detect if next array value is null, and re-set to zero
  if (strNewsLine[iNewsLineCounter]== null)
  {
   	iNewsLineCounter= 0;
  } // end if
  // set timout to recurse function in 4000 milli-seconds
  setTimeout("fnChangeNews()", 4000);
  return;
} // end fnChangeNews()
