vids = new Array()
vids[1] = 'modelcar';
vids[2] = 'nightmarebreakfast';
vids[3] = 'eating';
vids[4] = 'runawayclay';
vids[5] = 'clayhero';
vids[6] = 'clayvolution';
vids[7] = 'duck';
vids[8] = 'lawnskating';
vids[9] = 'magicshoes';
vids[10] = 'paperdolldisco';
vids[11] = 'fruit';
vids[12] = 'nigel';
vids[13] = 'spacehero';
vids[14] = 'icecream';
vids[15] = 'sandsnake';
vids[16] = 'familyphotos';
vids[17] = 'rotoscope';
vids[18] = '';
vids[19] = '';
vids[20] = '';
vids[21] = '';
vids[22] = '';
vids[23] = '';
vids[24] = '';
vids[25] = '';

caps = new Array()
caps[1] = 'Model Car Mashups';
caps[2] = 'The Nightmare Before Breakfast';
caps[3] = 'No-Handed Eating';
caps[4] = 'Runaway Clay';
caps[5] = 'Clay Hero';
caps[6] = 'Clayvolution';
caps[7] = 'Duck, Duck, Poop';
caps[8] = 'Lawn Skating';
caps[9] = 'The Magic Shoes';
caps[10] = 'Paper Doll Disco';
caps[11] = 'Famous Fruit Speeches';
caps[12] = 'The Adventures of Nigel Plod';
caps[13] = 'Space Hero';
caps[14] = 'Un-melting Ice Cream';
caps[15] = 'Attack of the Self-Eating Sand Snake';
caps[16] = 'Magical, Moving Family Photos';
caps[17] = 'Juggling Rotoscope';
caps[18] = '';
caps[19] = '';
caps[20] = '';
caps[21] = '';
caps[22] = '';
caps[23] = '';
caps[24] = '';
caps[25] = '';

pgs = new Array()
pgs[1] = '14';
pgs[2] = '18';
pgs[3] = '20';
pgs[4] = '22';
pgs[5] = '24';
pgs[6] = '26';
pgs[7] = '28';
pgs[8] = '32';
pgs[9] = '36';
pgs[10] = '40';
pgs[11] = '42 ';
pgs[12] = '44';
pgs[13] = '46';
pgs[14] = '48';
pgs[15] = '50';
pgs[16] = '52';
pgs[17] = '56';
pgs[18] = '';
pgs[19] = '';
pgs[20] = '';
pgs[21] = '';
pgs[22] = '';
pgs[23] = '';
pgs[24] = '';
pgs[25] = '';





function f_scrollTop() {
  return f_filterResults (
    window.pageYOffset ? window.pageYOffset : 0,
    document.documentElement ? document.documentElement.scrollTop : 0,
    document.body ? document.body.scrollTop : 0
  );
}

function f_filterResults(n_win, n_docel, n_body) {
  var n_result = n_win ? n_win : 0;
  if (n_docel && (!n_result || (n_result > n_docel)))
    n_result = n_docel;
  return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}


function sp(vid, cap, pg) {

  document.getElementById('bgl').style.display = 'block';

  for (k = 0; k < vids.length; k++) {
    if(vids[k] == vid) {
      /*
      l = 'javascript: popup("/tv/tv_tell.php?vid='+k+'", 600, 460);';
      document.getElementById('tellafriendlink').href = l;
      */
      window.location.hash = k;
      break;
    } 
  }

  t = '<b>' + cap + '</b> p. ' + pg;
  document.getElementById('pu_caption').innerHTML = t;
  document.getElementById('video_player').innerHTML = '';

  // document.getElementById('pu').style.top = 20 + f_scrollTop();
  document.getElementById('pu').style.top = (20 + f_scrollTop()) + ('px');
  document.getElementById('pu').style.display = 'block';

  // use flashembed to place flowplayer into HTML element 
  api = flashembed("video_player", 
   
    // first argument supplies standard Flash parameters. See full list:
    // http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
    {
      src:'FlowPlayerLight.swf',
      width: 550, 
      height: 400
    },
    
    // second argument is Flowplayer specific configuration. See full list:
    // http://flowplayer.org/player/configuration.html
    { config: {
      initialScale: 'scale',
      autoRewind: true,
      loop: false,
      autoPlay: true,
      // videoFile: 'http://'+location.hostname+'/animation/animation_clip_'+pg+'_'+vid+'.flv',
      videoFile: 'animation_clip_'+pg+'_'+vid+'.flv',
      showMuteVolumeButton: false,
      showMenu: false,
      showStopButton: false,
      showFullScreenButton: false,
      showVolumeSlider: false
    }}
  );
  
}


function hp() {
  document.getElementById('pu').style.display = 'none';
  document.getElementById('bgl').style.display = 'none';
  // window.location.hash = '';
  // parent.location.hash = '';
  // window.location.href=window.location.href.slice(0, -1);
  // window.scrollTo(0, 1000);
}


function popup(filename,width,height)
{
  thedefinitionWindow = open(filename, "deWin"+width+height, get_win_props(width,height));
  thedefinitionWindow.focus();
}  

function get_win_props(thewidth,theheight)
{
  theprops = '';
  if(screen.width) {
    theprops = 'left=' + (screen.width - thewidth) / 2;
    theprops = theprops + ', top=' + (screen.height - theheight) / 2;
    theprops = theprops + ', ';    
  }
  theprops = theprops + 'width='+thewidth+',height='+theheight+',resizable=yes,status=0';
  return theprops;
}

