/**
 * Reference and declaration for all vars to keep track of for the video player page.
 */
 
// user logged in status
loggedIn = false;

// holds data about object segments
var transcriptIndex = new Array();

// holds data about object segments
var indexTitle = new Array();

// set initial index for currently loaded segment, start with the first
curIndex = 0;

// id of the currently highlighted anchor
curObjectIndex = 0;

// number of times that a timeout has been set trying to determine if
// the toc has been loaded, it will try for 10 seconds and then die
tryLoadIndexToc = 0;

// Name of the current speaker
var curSpeaker = "";

// object pid
var pid;

// collection object pid
var coid;

// currently playing segment id
var segId;

// current content Model of player
var contentModel;

// holds all of the anchors for the table of contents
var anchors = new Array();

// all items to appear in the transcript window
var transcripts = new Array();

// all items to appear in the notes window
var notes = new Array();

// boolean for indicating whether we're composing or not
var composing = false;

// boolean for indicating whether we have a metaobject to deal with
var metaObject = false;

// flash movie
var movie;

// flash viewer (should replace movie)
var viewer;

// these are set to true when the ajax components complete
tocDone = false;
transcriptDone = false;
notesDone = false;

// 0 - segment; 1 - chpter; 2 - phrase;
var searchStateSegment  =  0;
var searchStateChapter  =  1;
var searchStatePhrase   =  2;
var searchStateControll =  searchStatePhrase;

// position controll to navigate (first -1; last 1; do not synchronize - 0);
var searchPositionFirst = -1;
var searchPositionLast  = 1;
var searchPositionDoNotSynchronize = 0;

var searchPositionControll = searchPositionDoNotSynchronize;

var searchInited = false;

var isIE = /MSIE/.test(navigator.userAgent);