var activeThumbId = "thumb1";

function activeState(which)
{
	for(i=1;i<=2;i++)
	{
		var thumb_id = "thumb" + i;
		//var text_thumb_id = "txt_thumb" + i;
		document.getElementById(thumb_id).className = "border";
		//document.getElementById(text_thumb_id).className = "text";
	}
		//var text_thumb = 'txt_'+which;
		document.getElementById(which).className = "activeBorder";
		//document.getElementById(text_thumb).className = "activeText";
		
		activeThumbId = which;
}

function thumbOver(which)
{
	//var text_thumb = 'txt_'+which;
	document.getElementById(which).className = "activeBorder";
	//document.getElementById(text_thumb).className = "activeText";
}

function thumbOut(which)
{
	if(which != activeThumbId){
	//	var text_thumb = 'txt_'+which;
		document.getElementById(which).className = "border";
	//	document.getElementById(text_thumb).className = "text";
	}
}

function rollOver(which)
{ 
	which.src = which.src.replace("_of","_ov"); 
}

function rollOut(which)
{ 
	which.src = which.src.replace("_ov","_of"); 
}

function show_hide_layer(this_layer, action, displ_type)
{
	layer = document.getElementById(this_layer);
	
	switch(action)
	{
		case 'show':
			layer.style.display = displ_type;
		break;
		
		case 'hide':
			layer.style.display = 'none';
		break
	}
}

function hide_all_news(lenght) 
{
	for ( i = 0; i < lenght; i++ ) 
	{
		layer = "news" + i;
		if (document.getElementById(layer) != null) {
			document.getElementById(layer).style.display = 'none';
		}
	}
	
}

function activBtn(which, switcher, counter)
{
	
	switch(switcher)
	{
		case 'vids':
			str = "dot";
			rep_str = 'act';
			i		= 0;
		break;

	}

for(i=i; i<counter; i++)
	{
		document.getElementById(str+i).src = document.getElementById(str+i).src.replace("_"+rep_str, "_of");
	}
	which.src = which.src.replace("_of","_"+rep_str);
	which.src = which.src.replace("_ov","_"+rep_str);
	
}

var newsTimer;

function swapNews(loop, lenght)
{

	var loopNumber = parseInt(loop);
	var currentNews = "news"+loopNumber;
	
	document.getElementById(currentNews).style.display = "none";
	
	var nextLoopNumber = parseInt(loopNumber + 1);
	if (lenght == loopNumber + 1) nextLoopNumber = 0;
	var nextNews = "news"+nextLoopNumber;
	var dot_btn = document.getElementById("dot"+nextLoopNumber);
	
	document.getElementById(nextNews).style.display = "block";
	
	activBtn(dot_btn, 'vids', lenght);
	
	newsTimer = setTimeout("swapNews("+nextLoopNumber+","+lenght+")", 10000);
}

function clearTimer() {
	if (newsTimer != null) clearTimeout(newsTimer);
}


