function scroller() {
	if (news.length > 0)
	{
		document.getElementById("news_scroller").innerHTML = news[newsIdx];
	}
	if (events.length > 0) 
	{
		document.getElementById("events_scroller").innerHTML = events[eventsIdx];
	}
	
	if (newsIdx + 1 < news.length) {
		newsIdx++;
	}
	else {
		newsIdx = 0;
	}
	
	if (eventsIdx + 1 < events.length) {
		eventsIdx++;
	}
	else {
		eventsIdx = 0;
	}

	t = setTimeout("scroller()", 5000)
}

function windowOnload()
{
	scroller();
	var selCountry = document.getElementById('country');
	if (selCountry != null)
		selCountry.onchange = gotoLocalSite;
}

function gotoLocalSite()
{
	switch(this.value)
	{
		case 'en-US':
			document.location = 'http://us.cipherlab.com';
			break;    
		case 'en-AU':
			document.location = 'http://au.cipherlab.com';
			break;    
		case 'zh-CN':
			document.location = 'http://cn.cipherlab.com';
			break;    
		case 'de-DE':
			document.location = 'http://de.cipherlab.com';
			break;    
		case 'en-UK':
			document.location = 'http://uk.cipherlab.com';
			break;    
		case 'it-IT':
			document.location = 'http://it.cipherlab.com';
			break;    
		case 'ru-RU':
			document.location = 'http://ru.cipherlab.com';
			break;    
		default:
	}
}

window.onload = windowOnload;
