<!--
      var player1           =  null;
      var player2           =  null;
      var player3           =  null;
      var player4           =  null;
      var playlist1         =  null;
      var playlist2         =  null;
      var playlist3         =  null;
      var playlist4         =  null;
      var playlist2Length   =  null;
      var playlist3Length   =  null;
      var selectFlag        =  true;
      var instrumentation   =  true;
      // player common config of flash vars
      var scrcolor          = '000000';     // screen background
      var bcolor            = '555555';     // playlist background
      var fcolor            = 'EEEEEE';     // text & icons controll bar and playlist
      var lcolor            = '9999ff';     // selected / rollover text/track highlight
      var mplayerwidth      = '690';        // main viewing player width
      var mplayerheight     = '400';        // main viewing player height
      var listplayerwidth   = '220';        // listplayer widths
      var listplayerheight  = '200';        // listplayer heights
      var plistlength       = '200';        // length of playlists
      var verreq            = '9.0.124';    // flash version required
      
function playerReady(obj)
{
    window['player' + obj.id.substr((obj.id.length -1), 1)] = gid(obj.id);
    if((player1 !== null) && (player2 !== null) && (player3 !== null) && (player4 !== null))
    {
        concatPlaylists();
    }
};
function concatPlaylists()
{
    playlist1 = player1.getPlaylist();
    playlist2 = player2.getPlaylist();
    playlist3 = player3.getPlaylist();
    playlist4 = player4.getPlaylist();
    if((playlist1.length > 0) && (playlist2.length > 0) && (playlist3.length > 0) && (playlist4.length > 0))
    {
        playlist2Length  = playlist2.length;
        playlist3Length  = playlist3.length + playlist2Length;
        playlistX        = playlist2.concat(playlist3).concat(playlist4);
        addListeners();
    }
    else
    {
        setTimeout("concatPlaylists()", 100);
    }
};
function addListeners()
{
    var playlist1 = player1.getPlaylist();
    var playlist2 = player2.getPlaylist();
    var playlist3 = player3.getPlaylist();
    var playlist4 = player4.getPlaylist();
    if((playlist1.length > 0) && (playlist2.length > 0) && (playlist3.length > 0) && (playlist4.length > 0))
    {
        player1.addControllerListener('ITEM',      'itemMonitor');
        player2.addControllerListener('ITEM',      'itemMonitor');
        player3.addControllerListener('ITEM',      'itemMonitor');
        player4.addControllerListener('ITEM',      'itemMonitor');
        player1.addControllerListener('PLAYLIST',  'playlistMonitor');
        player2.addModelListener('STATE',          'stateMonitor');
        player3.addModelListener('STATE',          'stateMonitor');
        player4.addModelListener('STATE',          'stateMonitor');
        player1.sendEvent('LOAD', playlistX);
        }
        else                                  
        {
            setTimeout("addListeners()", 100);
        }
};

function itemMonitor(obj)
{
    if(obj.id == 'playerID1')
    {
        selectFlag = false;
        if(obj.index < playlist2Length)
        {
            player2.sendEvent('ITEM', obj.index);
//alert(obj.index + ' send to player2 objindex, playlist2Length ' + playlist2Length);
        }
        if((obj.index < playlist3Length) && (obj.index > playlist2Length))
        {
            player3.sendEvent('ITEM', obj.index - playlist2Length);
//alert(obj.index + ' send to player3 playlist2Length ' + playlist2Length);
        }
        if(obj.index > playlist3Length)
        {
            player4.sendEvent('ITEM', obj.index - playlist3Length);
//alert(obj.index + ' send to player4 playlist3Length ' + playlist3Length);
        }
    }
    else if(obj.id == 'playerID2')
    {
        if(selectFlag)
        {
            player1.sendEvent('ITEM', obj.index);
        }
        selectFlag = true;
    }
    else if(obj.id == 'playerID3')
    {
        if(selectFlag)
        {
            player1.sendEvent('ITEM', obj.index + playlist2Length);
        }
        selectFlag = true;
    }
    else if(obj.id == 'playerID4')
    {
        if(selectFlag)
        {
            player1.sendEvent('ITEM', obj.index + playlist3Length);
        }                       
        selectFlag = true;
    }
};

function playlistMonitor(obj)
{
//    setTimeout("player1.sendEvent('ITEM', 10)", 250);
};

function stateMonitor(obj)
{
    if((obj.id == 'playerID2') && (obj.newstate == 'PLAYING'))
    {
        player2.sendEvent('STOP');
    }
    else if((obj.id == 'playerID3') && (obj.newstate == 'PLAYING'))
    {
        player3.sendEvent('STOP');
    }
    else if((obj.id == 'playerID4') && (obj.newstate == 'PLAYING'))
    {
        player4.sendEvent('STOP');
    }
};

function dumpPlaylist(playlist, element)
{
    var listnodes = '';
    for(var j in playlist)
    {
        listnodes += '<br />Track: ' + j + '<br />';
        for(var k in playlist[j])
        {
            listnodes += '<li>' + k + ': ' + playlist[j][k] + '</li>';
        }
    }
    gid(element).innerHTML = '<br />Playlist - ' + element + ':' + listnodes;
};

function gid(name)
{
    return document.getElementById(name);
};
      var player     = 'videos/player/player-licensed.swf';
      var playlist1  =  encodeURIComponent('../Credits/videos/playlists/igstillist.xml');   // all local videos
      var playlist2  =  encodeURIComponent('../Credits/videos/playlists/igstillist.xml');
      var playlist3  =  encodeURIComponent('../Credits/videos/playlists/igvideolist.xml');   // all local videos
      var playlist4  =  encodeURIComponent('http://gdata.youtube.com/feeds/api/playlists/57E2FE5253E59B5C');  // youtube videos
      var playlistX  =  {};
      var flashvars1 =
      {
        file:                   playlist1,
        controlbar:             'bottom',
        playlist:               'none',
        autostart:              'false',
        stretching:             'uniform',
        bufferlength:           '2',
        respectduration:        'true',
        volume:                 '70',
        icons:                  "true",          
        repeat:                 'list',
        shuffle:                'false',
        screencolor:            scrcolor,
        backcolor:              bcolor,
        frontcolor:             fcolor,
        lightcolor:             lcolor,
        id:                     'playerID1'      
      };
      var params =
      {
        allowfullscreen:        'true',
        allowscriptaccess:      'always',
        bgcolor:                '#000000'
      };
      var attributes1 =
      {
        id:                     'playerID1',
        name:                   'playerID1'
      };
      swfobject.embedSWF(player, 'player1', mplayerwidth, mplayerheight, verreq, false, flashvars1, params, attributes1);

      var flashvars2 =
      {
        file:                     playlist2,
        controlbar:             'none',
        autostart:              'false',
        playlist:               'bottom',
        playlistsize:           plistlength,
        dock:                   "false",         // set this to true to show the dock with large buttons in the top right of the player. Available since 4.5.             
        icons:                  "false",          // set this to false to hide the play button and buffering icon in the middle of the video. Available since 4.2. 
        screencolor:            scrcolor,
        backcolor:              bcolor,
        frontcolor:             fcolor,
        lightcolor:             lcolor,
        thumbs:                 'true',
        volume:                 '0',
        repeat:                 'none',
        id:                     'playerID2'
      };
      var attributes2 =
      {
        id:                     'playerID2',
        name:                   'playerID2'
      };
      swfobject.embedSWF(player, 'player2', 250, listplayerheight, verreq, false, flashvars2, params, attributes2);

      var flashvars3 =
      {
        file:                   playlist3,
        controlbar:             "none",
        autostart:              'false',
        playlist:               'bottom',
        playlistsize:           plistlength,
        dock:                   "false",         
        icons:                  "false",          
        screencolor:            scrcolor,
        backcolor:              bcolor,
        frontcolor:             fcolor,
        lightcolor:             lcolor,
        thumbs:                 'true',
        volume:                 '0',
        repeat:                 'none',
        id:                     'playerID3'
      };
      var attributes3 =
      {
        id:                     'playerID3',
        name:                   'playerID3'
      };
      swfobject.embedSWF(player, 'player3', listplayerwidth, listplayerheight, verreq, false, flashvars3, params, attributes3);

      var flashvars4 =
      {
        file:                   playlist4,
        controlbar:             "none",
        autostart:              'false',
        playlist:               'bottom',
        playlistsize:           plistlength,
        dock:                   "false",         
        icons:                  "false",          
        screencolor:            scrcolor,
        backcolor:              bcolor,
        frontcolor:             fcolor,
        lightcolor:             lcolor,
        thumbs:                 'true',
        volume:                 '0',
        repeat:                 'none',
        id:                     'playerID4'
      };
      var attributes4 =
      {
        id:                     'playerID4',
        name:                   'playerID4'
      };
      swfobject.embedSWF(player, 'player4', listplayerwidth, listplayerheight, verreq, false, flashvars4, params, attributes4);
//-->

