var offset=null;
var timerID=null;


// set vid_player to slideTime and ensure correct slide is displayed
function gotoSlide( index )
{
   //alert(index);
   seekFlag = 'false';
   //parent.sld_pres.location.href = slideLoc[index];
   gotoSlidePlayer( slideTime[index], seekFlag );
}



// set vid_player to slideTime
function gotoSlidePlayer( indexTime, seekFlag )
{
  //alert(indexTime);
  offset = indexTime * 1000;

    // determine whether or not we are running with IE
  if ((navigator.userAgent.indexOf("IE") == "-1" ) && (navigator.userAgent.length > 1)) 
  {     // Netscape
    if (document.vid_player.GetPlayState() != 0)
    {
      document.vid_player.DoPause();
      document.vid_player.SetPosition( offset );
      document.vid_player.DoPlay();
    }
    else
    {
      if (document.vid_player.CanPlay()) 
      {
        document.vid_player.DoPlay();
        timerID = setInterval("fastforwardNS()",200);
      }
    }
  }
  else  // IE
  {
    if (vid_player(0).GetPlayState() != 0)
    {
      vid_player(0).DoPause();
      vid_player(0).SetPosition( offset );
      vid_player(0).DoPlay();
    }
    else
    {
      if (vid_player(0).CanPlay()) 
      {
        vid_player(0).DoPlay();
        timerID = setInterval("fastforwardIE()",200);
      }
    }
  }
}

// GetPlayState() return codes
//
// 0 Stopped
// 1 Contacting
// 2 Buffering
// 3 Playing
// 4 Paused
// 5 Seeking


function fastforwardNS() 
{
  if (document.vid_player.GetPlayState() == 2)
  {
    document.vid_player.DoPause();
    document.vid_player.SetPosition(offset);
    document.vid_player.DoPlay();
    clearInterval(timerID);
    timerID = null;
    offset = null;
  }
  return true;
}

function fastforwardIE() 
{
  if (vid_player(0).GetPlayState() == 2)
  {
    vid_player(0).DoPause();
    vid_player(0).SetPosition(offset);
    vid_player(0).DoPlay();
    clearInterval(timerID);
    timerID = null;
    offset = null;
  }
  return true;
}

