<!--

// must equal the count of videos in array below
videoCount = 4;

var baseSFURL = 'http://www.statefarm.com/';
var videos = new Array(videoCount);

// array containing video details

videos[0] = [
  'Marsico Capital Management, LLC',
  '',
  'http://downloads.statefarm.com.edgesuite.net/PROD/20001-21000/20228/20228marsicojimg.flv',
  'Marsico Capital Management, LLC',
  baseSFURL + '_images/invest_team/video_preroll.jpg'
];

videos[1] = [
  'Northern Cross, LLC',
  '',
  'http://downloads.statefarm.com.edgesuite.net/PROD/20001-21000/20227/20227nocrosslatorre.flv',
  'Northern Cross, LLC',
  baseSFURL + '_images/invest_team/video_preroll.jpg'
];


videos[2] = [
  'Rainier Investment Management, Inc.',
  'rtmp://cp51267.edgefcs.net/ondemand',
  '/SFFlashOD/PROD/19001-20000/19017/19017rainier4.flv',
  'Rainier Investment Management, Inc.',
  baseSFURL + '_images/invest_team/video_preroll.jpg'
];


videos[3] = [
  'Westwood Management Corp.',
  'rtmp://cp51267.edgefcs.net/ondemand',
  '/SFFlashOD/PROD/19001-20000/19473/19473_susanbyrne.flv',
  'Westwood Management Corp.',
  baseSFURL + '_images/invest_team/video_preroll.jpg'
];


function changeVideo (idx, autoplay)
{
  linkCode = '';
  
  for (i=0; i<videoCount; i++) {
  
    if (i==idx) {
      
      titleCode = videos[i][0];
      $("#player_tile").html(titleCode);

      if (autoplay) autoPlayValue = 'true';
      else autoPlayValue = 'false';

  		sParams = 'allowfullscreen=true';
      sParams += '&allowscriptaccess=true';
      sParams += '&wmode=opaque';
      sParams += '&flashvars=true';

      var flashVars = {
        streamer: videos[i][1],
        file: videos[i][2],
        stretching: "fill",
        autostart: autoPlayValue,
        bufferlength: 15,
        image: videos[i][4],
        abouttext: "State Farm",
        aboutlink: "http://www.statefarm.com"
      };
      
      swfobject.embedSWF(baseSFURL + "_swf/player.swf", "player_swf", "240", "180", "9.0.0", baseSFURL + "_js/expressInstall.swf", flashVars);
      if (videoCount>1) linkCode += '<option value="' + i + '" selected="selected">' + videos[i][3] + '</option>\n';
      
    }
    else {
      if (videoCount>1) linkCode += '<option value="' + i + '">' + videos[i][3] + '</option>\n';
    }
  }

  if (videoCount>1) {
    linkCodeFinal = '<p id="team_select_label">NOW PLAYING:</p>\n';
    linkCodeFinal += '<select id="team_select" onchange="changeVideo(this.selectedIndex, true)">\n' + linkCode + '</select>\n';
  }
  else {
    linkCodeFinal = linkCode;
  }
  $("#player_links").html(linkCodeFinal);
}

$(document).ready(function () {
    changeVideo(0, false);
});

//-->