﻿var g_player = null;
var g_currentid = '17';
var g_numvideos = 17;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function onLoadBody(videoid) {
    if (videoid != '') {
        g_currentid = videoid;
        onVideoClicked(g_currentid);
    }
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function playerReady(obj) {
    var id = obj['id'];
	g_player = document[id];
	if (g_player == null) {
	    g_player = document.getElementById('playerContent');
	}
	onVideoClicked(g_currentid);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function onVideoClicked(videoid) {
	g_player.sendEvent('LOAD', { file: 'flv/video_' + videoid + '.flv' }); 
	g_player.sendEvent('PLAY',true);
	g_currentid = videoid;
	for (x = 1; x != g_numvideos+1; x++) {
	    if (x < 10) {
	        document.getElementById('row0' + x.toString()).style.backgroundColor = '#c5fff4';
	    }
	    else {
	        document.getElementById('row' + x.toString()).style.backgroundColor = '#c5fff4';
	    }
	}
    document.getElementById('row' + videoid).style.backgroundColor = '#88ddfd';
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function onEmailClicked() {
    window.location.href = "video_email.asp?videoid=" + g_currentid;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function onEmbedClicked() {
    window.location.href = "video_embed.asp?videoid=" + g_currentid;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

