function replaceVideos(){
  var tag = document.createElement('script');
  tag.src = "http://www.youtube.com/player_api";
  var firstScriptTag = document.getElementsByTagName('script')[0];
  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  
  }
var youtubePlayers = new Array();  
var youtubePlayersBigger = new Array();  

function onYouTubePlayerAPIReady() {
    var tempCount=0;
    
    $('.youtubeFrame').each(function(){
      tempCount += 1;
      var playerId = 'youtubePlayer'+tempCount;
      var utubeSrc=$(this).html();
      //$(this).html('<div id="'+playerId+'"></div>');
      $(this).html('<iframe width="340" id="'+playerId+'" height="211" src="http://www.youtube.com/embed/'+utubeSrc+'?enablejsapi=1&rel=0" frameborder="0" allowfullscreen></iframe>');
      youtubePlayers[tempCount] = new YT.Player(playerId);
      
      //$(this).html('<iframe width="340" id="'+playerId+'" height="211" src="'+utubeSrc+'?enablejsapi=1&rel=0" frameborder="0" allowfullscreen></iframe>');
      //youtubePlayers.push(playerId);
    });
    
    $('.ytFrameBigger').each(function(){
      tempCount += 1;
      var playerId = 'youtubePlayer'+tempCount;
      var utubeSrc=$(this).html();
      //$(this).html('<div id="'+playerId+'"></div>');
      $(this).html('<iframe width="520" id="'+playerId+'" height="293" src="http://www.youtube.com/embed/'+utubeSrc+'?enablejsapi=1&rel=0" frameborder="0" allowfullscreen></iframe>');
      youtubePlayersBigger[tempCount] = new YT.Player(playerId);
      
      //$(this).html('<iframe width="340" id="'+playerId+'" height="211" src="'+utubeSrc+'?enablejsapi=1&rel=0" frameborder="0" allowfullscreen></iframe>');
      //youtubePlayers.push(playerId);
    });
    
    
  }
