///////////////////////
// News
///////////////////////

////////////////
// Edit here
////////////////

var newsCount = 1;
var newsList = new Array(newsCount);

//newsList[0]= "2007-06-22\nPCCW will have a maintenance work on June 29st 2006, from 4am to 5am. Occational service interruption may occur during the period. We apologize for the inconvenience.\nPlease call our services hotline at 852-2687-2039 for any inqueries.";

//newsList[0]= "Happy Lunar New Year 2008!!\n恭賀新禧,鼠年進步!!";
//newsList[0]= "秋高氣爽,慎防山火!";
//newsList[0]= "Have a Beautiful Spring & Summer!!\n春臨大地,百花盛開!!";
//newsList[0]= "Happy Easter!!\n復活節快樂!!";
//newsList[0]= "Happy New Year!!\n新年快樂!!";
//newsList[0]= "Merry Christmas!!\n聖誕快樂!!";
//newsList[0]= "TOL Professional 行蹤保專業版!!\nThanks to valuable inputs from our clients,\nWesTel is upgrading TOL with new services:\n-- Mobile Motion Indicators, MMI, showing the stop, wait & drag time of the vehicle.\n-- Executive Report with KPI.\n-- Mobile search on cell phone.\n-- Map enhancement.\nPlease call our Customer Service hotline @ 26872039 for any inquiries.";

/*newsList[0] = "Good Management Philosophy 管理哲學 is essential for your business to grow globally. TOL 行蹤保 helps visualize your philosophy throughout the daily operations of your fleet. We cover you 24 hours a day.\nDrive Safely in 2006!";*/

/*newsList[0] = "2006-02-25\nIn an effort to enhance our quality service, WesTel has scheduled a routine maintenance work. Occational service interruption may occur from February 26th, 2006, 4:00am to 12:00am. We apologize for the inconvenience.\nPlease call our services hotline at 852-2687-2039 for any queries.\n\nDrive Safely in 2006!";*/


//newsList[0] = "How much Money Could you Save on Gas?\nTOL will tell you!";
newsList[0] = "TOL 2010, Tracking OnLine GPS Fleet Management\nServing Your Vehicle Fleet to Optimize Efficiency by:-\nPreventing Accidents, Saving Fuel Cost, Maximizing Productivity"


/*
newsList[0] = "2005-8-12\nDo you want to know the performance of your vehicle fleet? Is it Pass or Fail? waiting time? fuel? mileage? wasted trucking capacity? security measures? Today WesTel announces the launch of our Executive Fleet Report, which shows the performance of your fleet in KPI numbers, the Key Performance Index. It's FREE for all our TOL subscribers. Please call our hot line 2687-2039 for registration.";
*/

/*
newsList[0] = "2005-7-27 to 31, 6:00pm-7:00pm\nThere will be a server upgrade. During these periods, services will be interrupted.";
*/
/*
newsList[0] = "香港迎夏日2005\n支持環保，停車時請關掉引擎，做個有責任的司機。"
newsList[1] = "Beautiful Summer 2005 Hong Kong\nBe a friendly driver, switch off the engine while you parked. Save our environment."
*/


///////////////////////
// END edit news
//////////////////////

var isPlay = 1;
var waitTime = 2000;
var newsIndex = 0;

/**
 * This function change text in textarea
 */
function showNews()
{
	//decrement the index if pause
	if (isPlay == 0)
		newsIndex--;
	if (newsIndex < 0)
		newsIndex = newsCount-1;
		
	//show specified news
	//t1.value = "News " + (newsIndex + 1) + " on " + newsList[newsIndex];
	var t1 = document.getElementById("t1");
	t1.value = newsList[newsIndex];
	//document.getElementById("t1").value = newsList[newsIndex];
	//document.getElementById('body').style.color="red"
	
	//increment to the next news
	newsIndex++;
	
	//return to the first news
	if (newsIndex >= newsCount)
		newsIndex = 0;
	
	//repeat
	setTimeout("showNews()", waitTime);
}

/**
 * Stop the changing news.
 */
function pauseNews()
{
	isPlay = 0;
}


/**
 * Play the news
 */
function playNews()
{
	isPlay = 1;
}


var win;
/**
 * Open tracking window
 */
function openWindow()
{
	win = window.open("tracking.htm", "tracking");
}

/**
 * logout: close current browser and tracking browser.
 */
function logout()
{
	closeChild();
	
	window.close();
}

/**
 * close when unload
 */
function closeChild()
{
	if (win && win.open && !win.closed)
		win.close();
}
