      var player    =  null;
      var playlist  =  null;


      function playerReady(obj)
      {
        player = gid(obj.id);
        addListeners();
      };


      function addListeners()
      {
        playlist = player.getPlaylist();

        if(playlist.length > 0)
        {
          player.addModelListener('STATE', 'stateMonitor');
        }
        else
        {
          setTimeout("addListeners();", 100);
        }
      };

      function itemMonitor(obj)
      {
        currentItem = obj.index;
      };

      function stateMonitor(obj)
      {
        if(obj.newstate == 'COMPLETED')
        {
          //...load a new page when the media file completes playing
          // document.location = 'http://www.google.com';

			$('call-to-action').setStyle({textAlign:'center',fontSize:'16px',fontFamily:'sans-serif',fontWeight:'bold',height:'1px', overflow:'hidden'});
			$('call-to-action').update(
				"<br>Now that you've seen the video,<br>why not <a href='http://qualityoflife.ascentemedia.com/hospice-forum/?page_id=3'>Join the Discussion</a><br>or share this video with friends?<br><br>"
				);
			$('call-to-action').morph("height:90px; background:#FFFFAA;");
			player.sendEvent('NEXT');

        }
      };


      function gid(name)
      {
        return document.getElementById(name);
      };
