	function getVId(link){
		start = link.indexOf("?v=") + 3;
		end = link.indexOf("&");
		if (end == -1){
		end = start + 11;
		}
		var temp = link.slice(start, end);
		return temp;
	}
  $(document).ready(function(){
    var active;
	var activevid = '08';
	
	
	
	
	$(".active").click(
	  function () {
	    var link = $(this).attr("id");
		var tmplink = getVId(link);
		activevid = tmplink;
		fname = activevid;
		tmp = fname;
		loadPc(activevid);
      });
	  
	function loadPc(fname){
		$('.player').empty();
		$('.player').flash(
				{ 
				  src: 'http://www.youtube.com/v/' + fname + '&hl=en_US&fs=1&',
				  width: 640,
				  allowfullscreen: "true",
				  allowscriptaccess: "always",
				  height: 505,
                                  wmode: "opaque"
				},
				{ version: 8, update : true }
			);
	}
	//load most recent video
	loadPc("VAivK8n5J28");
  });