    var BASE_LINK_URL = "http://www.cbsnews.com/video/watch/?id=";
    var ytplayer;

    function changeMovieInfo(video) {
      title = document.getElementById("movie_title");
      if (title) {
        title.innerHTML=video.title;
      }
     desc = document.getElementById("movie_desc");
     if (desc) {
        desc.innerHTML=video.description;
     }
  }
    
    function playMovie(video)
    {
      if (ytplayer) {
        ytplayer.stopVideo();
        ytplayer.clearVideo();
        ytplayer = null;
      }
      
      changeMovieInfo(video);
      flashvars.linkUrl =  BASE_LINK_URL + video.linkId;
      flashvars.videoId=video.videoId;
      swfobject.embedSWF("http://cnettv.cnet.com/av/video/cbsnews/player-dest.swf", "myContent", "425", "324", "9.0.0", "/flash/expressInstall.swf",flashvars, params, null);      
    }
    
    function playYouTubeMovie(video) {
      var youtubeparams = { allowScriptAccess: "always" };
      var atts = { id: "myytplayer" };
      changeMovieInfo(video);
      swfobject.embedSWF("http://www.youtube.com/v/" + video.videoId + "&enablejsapi=1&playerapiid=ytplayer&autoplay=1", 
                         "myContent", "425", "324", "8", "/flash/expressInstall.swf", null, youtubeparams, null);    
     }
    
    var video1 = {
      linkId: "4750380n***",
      videoId: "50068158",
      title: "The French Paradox",
      description: "Morley Safer found, in 1991, that the French may have lower rates of heart attacks because their diet is high in cheese and wine."
     };

    var video2 = {
      linkId: "4750372n",
      videoId: "50068157",
      title:"Copenhagen 1995 Wine Study",
      description:"Morley Safer reports on the Copenhagen 1995 Wine Study"
     };
     
     var video3 = {
       linkId: "5037314n",
       videoId: "50072152",
      title:"Resveratrol and the French Paradox in 2009",
      description:"Scientists have found a substance called resveratrol in red wine that slows down the aging process in mice. Will it someday lengthen the lives of humans, too? Morley Safer reports."
     };
     
     var video4 = {
       linkId: "2199668n",
       videoId: "50056368",    
       title:"Latest Resveratrol Research",
       description:"The latest findings show that wine and one if its ingredients, Resveratrol, just might be the secret to longevity. John Blackstone reports."
     };
     
     var video5 = {
       linkId: "2199668n",
       videoId: "TJu9SICmzDo",    
       title:"2009 Anti-Aging Medicine Convention",
       description:"Dr. Joseph Maroon speaks about Red Wine and Resveratrol at the 2009 Anti-Aging Medicine Convention"
     };
     
     var video6 = {
       linkId: "2199668n",
       videoId: "g8jqCZ4yUrs",    
       title:"KDKA Interview with Dr. Bryan Donohue and Whirl Magazine Editor",
       description:"Dr. Bryan Donohoe talks about the benefits of resveratrol and Vindure 900"
     }
          
    var flashvars = {
    linkUrl: BASE_LINK_URL + video1.linkId,
    releaseURL: "http://cnettv.cnet.com/av/video/cbsnews/player-dest.swf",
    videoId:video1.videoId,
    edid:"2121",
    vert:"News",
    autoPlayVid:"true",
    name:"cbsPlayer",
    allowScriptAccess:"always",
    wmode:"transparent",
    embedded:"y",
    scale:"noscale",
    rv: "n", 
    salign:"tl"
    };
    
    var params = {
    allowFullScreen: "true"
    };
    
   function onYouTubePlayerReady(playerId) {
      ytplayer = document.getElementById("myytplayer");
    }

    