// Natural Synthetic Video Player (Version 1.0)
// Copyright © 2009 Natural Synthetic Design Studios - http://www.naturalsynthetic.com
// Any unauthorized use or duplication of this script is strictly prohibited.
// Liscensed for use on the official Eye Empire website - http://www.eyeempire.com

function requestAccess (client, access_key) {
  naturalsyntheticaccess.embedAccessKey(client + access_key + (access?1:0), 'client', 'key1', 'key2', 'key3', false, false, {getAccess: 'true'});
}

function loadVideo(playerUrl, autoplay) {
  swfobject.embedSWF(
      playerUrl + '&rel=1&border=0&fs=1&autoplay=' + 
      (autoplay?1:0), 'player', '465', '344', '9.0.0', false, 
      false, {allowfullscreen: 'true'});
}

function showMyVideos2(data) {
  var feed = data.feed;
  var entries = feed.entry || [];
  var html = ['<ul class="videos">'];
  for (var i = 0; i < entries.length; i++) {
	var entry = entries[i];
    var title = entry.title.$t.substr(0, 50);
	var alt = entry.title.$t.substr(0, 500);
	var postday = entry.published.$t.substr(8, 2);
	var postmonth = entry.published.$t.substr(5, 2);
	var postyear = entry.published.$t.substr(0, 4);
	var content = entries[i].media$group.media$description.$t.substr(0, 500);
    var thumbnailUrl = entries[i].media$group.media$thumbnail[0].url;
    var playerUrl = entries[i].media$group.media$content[0].url;
	var video = entries[i].media$group.media$thumbnail[0].url.substr(22, 11);
    html.push('<li><p class="title">', alt, '</p><div class="imgholder"><a href="http://www.bckochmit.com/video.php?watch=', video, '" rel="lyteframe[video]" title="', alt, '" rev="width: 790px; height: 475px; scrolling: no;"><img src="', thumbnailUrl, '" alt="', alt, '" width="225" height="160"/></a></div></li>');
  }
  html.push('</ul>');
  document.getElementById('videos2').innerHTML = html.join('');
  if (entries.length > 0) {
    loadVideo(entries[0].media$group.media$content[0].url, false);
  }
}
