// Playlist tabs
function playpopular() {
  $$('#block4343262').each(function(item){
    item.style.display = 'none';
  });
  $$('#new-videos-tab').each(function(item){
      item.style.backgroundColor = 'transparent';
    });
  $$('#new-tab-link').each(function(item){
      item.style.color = '#587D13';
    });
  
  $$('#popular-videos-tab').each(function(item){
    item.style.backgroundColor = '#EEEEEE';
  });
  $$('#block4343264').each(function(item){
    item.style.display = 'block';
  });
  $$('#popular-tab-link').each(function(item){
       item.style.color = '#888888';
     });
}

function playnew() {
  $$('#block4343262').each(function(item){
    //item.setAttribute('style', 'display:block;');
    item.style.display = 'block';
  });
  $$('#new-videos-tab').each(function(item){
      //item.setAttribute('style', 'background-color: #EEEEEE;');
    item.style.backgroundColor = '#EEEEEE';
    });
  $$('#new-tab-link').each(function(item){
        //item.setAttribute('style', 'color: #888888;');
    item.style.color = '#888888';
      });
  
  $$('#popular-videos-tab').each(function(item){
     //item.setAttribute('style', 'background-color: transparent;');
    item.style.backgroundColor = 'transparent';
   });
  $$('#block4343264').each(function(item){
     //item.setAttribute('style', 'display: none;');
    item.style.display = 'none';
   });
  $$('#popular-tab-link').each(function(item){
       //item.setAttribute('style', 'color: #587D13;');
    item.style.color = '#587D13';
     });
}

function nextthumbs(sender) {
  var t;
  if (sender == 1) {t = $$('#block4343262 .video-thumbnails table');}
  if (sender == 2) {t = $$('#block4343264 .video-thumbnails table');}

  var l = $(t[0]).getStyle('left');
  l = parseInt( l.slice(0, l.indexOf("px")) ) - 850;
  
  if (l >= -1700) {
    $(t[0]).morph({left:l+'px'}, {duration:.5});
  } else {
    $(t[0]).morph({left:0+'px'}, {duration:.8});
  }
}

function prevthumbs(sender) {
  var t;
  if (sender == 1) {t = $$('#block4343262 .video-thumbnails table');}
  if (sender == 2) {t = $$('#block4343264 .video-thumbnails table');}

  var l = $(t[0]).getStyle('left');
  l = parseInt( l.slice(0, l.indexOf("px")) ) + 850;
  
  if (l <= 0) {
    $(t[0]).morph({left:l+'px'}, {duration:.5});
  } else {
    $(t[0]).morph({left:-1700+'px'}, {duration:.8});
  }
}

