// JavaScript Document

var vxCurrentChannel;
var vxCurrentClipId;

function checkCookie(channelid,channelname,clipid,baseurl,userEventName)
{
	vxCurrentChannel = channelname;
	vxCurrentClipId = clipid;
	
	if(G6_GetCookie("TT")!=null)
	{
		if(G6_GetCookie("TBV")!=null)
		{
			vxDispatch('eTokenApproved',{name:'TT',value:G6_GetCookie("TT"),userEvent:userEventName});
		}
		else
		{
			vxDispatch('eTokenNotTBV',{name:'TT',value:G6_GetCookie("TT"),userEvent:userEventName});
		}
	}else{
		vxDispatch('eTokenDisapproved',{name:'TT',value:G6_GetCookie("TT"),userEvent:userEventName});
	}
}
function addCookie()
{
	G6_SetCookie('TT',document.getElementById('inputTT').value,2);
}

function showAdBanner(url)
{
	document.getElementById("vxFlashPlayerSyncLeaderboard").src = url;
}

function vxDispatch(sEvent, oParams)
{
 vxGetPlayer().dispatchEvent(sEvent, oParams);
}
function login(url)
{
	window.location.href="http://"+url.split("\/")[2]+"/vip-login.htm?redirectto="+encodeURIComponent("vip/vip-lounge.htm"+"?channel=" + vxCurrentChannel + "&clipid=" + vxCurrentClipId);
}

function registerVIP(url)
{
	window.location.href="http://"+url.split("\/")[2]+"/vip/vip-lounge.htm";
}