//called from video player swf
function handleCompanion(bannerURL, clickThroughURL)
{
	
	var bg = document.getElementById("companion_bg");	
	var link = document.getElementById("companion_link");	
	var ad = document.getElementById("companion_ad");	
	var disp = (bannerURL)? "block" : "none";
	
	link.href = clickThroughURL;
	ad.src = bannerURL;
	bg.style.display = disp;
	ad.style.display = disp;
}

//deprecating for new player. use handleCompanion instead
function expandPlayer(dir)
{
	var n;
	//ff browsers work better changing width
	if(navigator.userAgent.indexOf("Firefox") >= 0)
	{
		n = (dir == "out")? "988" : "640";
		document.getElementById("video_player_mask").style.width = n + "px";	
	}
	else
	{
		//all other browsers work better changing overflow
		n = (dir == "out")? "visible" : "hidden";
		document.getElementById("video_player_mask").style.overflow = n;	
	}
}


<!--double hover effect for video thumbs and descriptions -->
function hiliteDesc(id){

	document.getElementById('descTitle' + id).style.color = '#fff';
	document.getElementById('descText' + id).style.color = '#ccc';

}	

function dimDesc(id){

	document.getElementById('descTitle' + id).style.color = '#7C7C7C';
	document.getElementById('descText' + id).style.color = '#666';

}

//handles page refreshes
var timeout; 
function refreshPage(seconds)
{
	if(window.location.href.indexOf("/video/") < 0 &&
	   window.location.href.indexOf("/channel/") < 0 &&
	   window.location.href.indexOf("/blog/") < 0 &&
	   window.location.href.indexOf("/search?") < 0)
	{
		window.timeout = window.setTimeout(refresh, seconds*1000);		
	}
	function refresh()
	{
		window.location.replace('?reload=true');
	}
}
function updateRefresh(seconds)
{
	window.clearTimeout(window.timeout);refreshPage(seconds);
}