function doOnLoad()
{
	_Destaque(null);
	startPlay();
}

window.onload = doOnLoad;

var _startIndex = 0;
var _Direction = '>';    
var ReestartPlay;

function startPlay()
{
	var iD = window.document.getElementById("ImageDestaque");
	var fK = window.document.getElementById("lnkImg");
	var aT = window.document.getElementById("aHref");
	var aP = window.document.getElementById("aPlay");                
	var sD = window.document.getElementById("sData");
	var sP = window.document.getElementById("sPrograma");
	aT.innerHTML = aVideos[_startIndex][4];
	aT.href = "video.aspx?" + 
		aVideos[_startIndex][2] + "," + 
		aVideos[_startIndex][3] + "," + 
		aVideos[_startIndex][0];
	aP.href = aT.href;
	fK.href = aT.href;
	sD.innerHTML = aVideos[_startIndex][6];
	sP.innerHTML = aVideos[_startIndex][5];
	iD.src = "images/thumbnail_videos/300x168/loading.gif";
	iD.src = "images/thumbnail_videos/164x94/" + aVideos[_startIndex][7];
	
	if (_Direction == '<') _startIndex --;
	if (_Direction == '>') _startIndex ++;
	
	if (_startIndex > aVideos.length - 1 && _Direction == '>' ) _startIndex = 0;
	if (_startIndex < 0 && _Direction == '<' ) _startIndex = aVideos.length - 1;	    
	
	window.clearTimeout(ReestartPlay);
	ReestartPlay = window.setTimeout("startPlay()", 5000);
}

function _Destaque(Direction)
{
	if (Direction != null)
	{        
		if (Direction == '<') 
		{
			if (_Direction == '>') _startIndex = _startIndex - 2;
			_Direction = '<';
			if (_startIndex < 0) _startIndex = aVideos.length - 1;
		}
		if (Direction == '>')
		{
			if (_Direction == '<') _startIndex = _startIndex + 2;
			_Direction = '>';
			if (_startIndex > aVideos.length - 1) _startIndex = 0;                                
		}
	}
	window.clearTimeout(ReestartPlay);
	ReestartPlay = window.setTimeout("startPlay()", 0);
}   
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function fecha()
{
	var layer = document.getElementById('flutuante');
	{
		layer.style.display = 'none';
	}
}