vids = new Array()
vids[1] = 'slopeyjoe';
vids[2] = 'thepunchoutinthepark';
vids[3] = 'attackofthedeadlystapler';
vids[4] = 'stickynoteanimation';
vids[5] = 'boxcarracing';
vids[6] = 'rubberarm';
vids[7] = 'stopactionfigureboogie';
vids[8] = 'howtodescrambleeggs';
vids[9] = 'ghostwalking';
vids[10] = 'reversiblebubblefairy';
vids[11] = 'theneatfairy';
vids[12] = 'themysterytower';
vids[13] = 'snappower';
vids[14] = 'howtounscrewyourfriendshead';
vids[15] = 'adventuresingiantland';
vids[16] = 'adventuresofslowmo';
vids[17] = 'antigravitygames';
vids[18] = 'nobrainermagic';
vids[19] = 'thebasketballmiracle';
vids[20] = 'mrsoundfx';
vids[21] = '';
vids[22] = 'thingsthatsing';
vids[23] = 'manvsbanana';
vids[24] = 'credits';
vids[25] = '';

caps = new Array()
caps[1] = 'Slopey Joe';
caps[2] = 'The Punchout in the Park';
caps[3] = 'The Attack of the Deadly Stapler Fish';
caps[4] = 'Sticky Note Animation';
caps[5] = 'Boxcar Racing';
caps[6] = 'The Rubbbbber Arm';
caps[7] = 'Stop Action Figure Boogie';
caps[8] = 'How to Descramble Eggs';
caps[9] = 'Ghost Walking';
caps[10] = 'The Reversible Bubble Fairy';
caps[11] = 'The Neat Fairy';
caps[12] = 'The Mystery Tower';
caps[13] = 'Snap Power';
caps[14] = 'How to Unscrew Your Friend\'s Head';
caps[15] = 'Adventures in Giant Land';
caps[16] = 'The Adventures of Slow Moe';
caps[17] = 'Anti-Gravity Games';
caps[18] = 'No-Brainer Magic';
caps[19] = 'The Basketball Miracle';
caps[20] = 'Mr. Sound FX';
caps[21] = '';
caps[22] = 'Things That Sing';
caps[23] = 'Man vs. Banana';
caps[24] = 'How to Roll Credits';
caps[25] = '';

pgs = new Array()
pgs[1] = '10';
pgs[2] = '12';
pgs[3] = '16';
pgs[4] = '20';
pgs[5] = '26';
pgs[6] = '28';
pgs[7] = '30';
pgs[8] = '31';
pgs[9] = '32';
pgs[10] = '33';
pgs[11] = '34 ';
pgs[12] = '35';
pgs[13] = '36';
pgs[14] = '38';
pgs[15] = '40';
pgs[16] = '44';
pgs[17] = '46';
pgs[18] = '47';
pgs[19] = '48';
pgs[20] = '51';
pgs[21] = '';
pgs[22] = '52';
pgs[23] = '54';
pgs[24] = '56';
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.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://video.klutz.com/tricky/tv_'+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';
}


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;
}

