function closeVideoPlayer() {
    var vpLayer = $('#videoplayer');
    vpLayer.html('');
}

function openVideoPlayer(movie) {            
    var so = new SWFObject('assets/swf/ray-tukee-player.swf', 'vp', '782', '489', '8', '#ffffff');
    so.addParam('wmode', 'transparent');
    so.addVariable('leffa', movie);
    so.write('videoplayer');
    
    var vpLayer = $('#videoplayer');
    vpLayer.css('display', 'block');
}

function replaceVideoContent(ob) {    
    var theLink = $(ob);
    $('#videot .content').load(theLink.attr('href') + ' #videot .content');
}

$(document).ready(function() {
   $('<span class="hr">&nbsp;</span>').replaceAll('hr'); 
   
   /* avustustuloslistojen näyttö */
   
   $('#vastaanottajat li a').click(function() {
       $('#vastaanottajat li').removeClass('act');
       $(this).parents().addClass('act');
       return false ;
   });
   
   $('#vastaanottajat ul ul').each(function(intIndex) {
       $(this).children('li').each(function(intIndex) {
           if (intIndex % 2 != 0) {
               $(this).addClass('odd');
           }
       });
   });
   
   /* videon kuvaus */
   
   $('#videodescription p:first').nextAll('*').hide();
   //$('#videodescription p:first, #videodescription p:first a').show();
   visible = false ;
   $('#videodescription a.readmore').click(function() {
      if(!visible) {
          $('#videodescription p:first').nextAll('*').slideDown('fast');
          $(this).text('^ Vähemmän');
          visible = true ;
      } else {
          $('#videodescription p:first').nextAll('*').slideUp('fast');
          $(this).text('Lisää >');
          visible = false ;
      }
      return false ;
   });
   
});
