
try {
    __FLOWPLAYER = _FLOWPLAYER;

} catch(e) {

__FLOWPLAYER = 1;

var flowplayer_api = null;
var gallery_count = null;

flashplayer_ready = false;

function onFlowPlayerReady()
{
    flashplayer_ready = true;
}

function select_clip(index)
{
    if (!flashplayer_ready)
    {
        alert("Player is not ready. Try again in a few seconds");
        return;
    }

    flowplayer_api.ToClip(index);
    flowplayer_api.DoPlay();
}

function onClipChanged(clip)
{
    clip_index = flowplayer_api.getCurrentClip();

    for (i=1; i<=gallery_count; i++)
        $("#tubedd-playlist-" + i).attr("class", "tubedd-clip")

    $("#tubedd-playlist-" + clip_index).attr("class", "tubedd-active-clip")

}

}
