var curFeat = 1;
var maxVid = 3;

function showVideo(num) {
  for(i=1;i<=maxVid;i++) {
    document.getElementById('videoLink'+i).className = '';
  }
  document.getElementById('videoLink'+num).className = 'current';

  var vp = document.getElementById('videoPlayer').innerHTML = videos[num];
}

function changeFeat(what) {
  switch(what) {
    case 'next':
      feat = (curFeat % maxFeat)+1;
      break;
    case 'prev':
      feat = curFeat-1;
      if (feat == 0) feat = maxFeat;
      break;
    default:
      feat = what;
  }

  var fadeOut = new YAHOO.util.Anim('feat'+curFeat, { opacity: { from: 1, to: 0 } }, 0.25);
  var fadeOutH2 = new YAHOO.util.Anim('featTitle'+curFeat, { opacity: { from: 1, to: 0 } }, 0.25);
  var fadeIn = function(type, args) {
    hideDiv('feat'+curFeat); // Off
    hideDiv('featTitle'+curFeat);
    document.getElementById('dot'+curFeat).className = "inactive";

    showDiv('feat'+feat); // On
    showDiv('featTitle'+feat);
    document.getElementById('dot'+feat).className = "active";

    var fadeIn = new YAHOO.util.Anim('feat'+feat, { opacity: { from: 0, to: 1 } }, 0.25);
    var fadeInH2 = new YAHOO.util.Anim('featTitle'+feat, { opacity: { from: 0, to: 1 } }, 0.25);
    fadeIn.animate();
    if (isIE() == false) fadeInH2.animate();
    curFeat = feat;
  };
  fadeOut.onComplete.subscribe(fadeIn);
  fadeOut.animate();
  if (isIE() == false) fadeOutH2.animate();
}
