
// This just goes through the list of clips we get
// and shows them on the page... you can doi better than this!
function showMyThumbs(stuff) {
// show some stats
document.getElementById("stats").innerHTML = "TOTAL VIDEOS: " + stuff.length;

// setup the thumbs list.
var thumbs = document.getElementById("thumbs");
thumbs.innerHTML = "";
for(var i = 0; i < stuff.length; ++i) {
 
thumbs.innerHTML += "<table><tr><td><!--[if !IE]> --><object type=\"application/x-shockwave-flash\" width=\"320\" height=\"180\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=" + stuff[i].clip_id + "&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ff9933\" ><param name=\"wmode\" value=\"opaque\" /><!-- <![endif]--><!--[if IE]><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"320\" height=\"180\"><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=" + stuff[i].clip_id + "&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ff9933\" /><!--><!--dgx--> <param name=\"quality\" value=\"best\" />	<param name=\"allowfullscreen\" value=\"true\" />	<param name=\"scale\" value=\"showAll\" /></object><!-- <![endif]--></td><td>" + 
                     "<p class=\"popisekvidea01\">" + stuff[i].title + "</p><br><p class=\"popisekvidea02\">" + stuff[i].caption + "</p><br><p class=\"popisekvidea03\"> Pocet shlednuti: "+ stuff[i].stats_number_of_views + "<br> Pocet komentaru: " + stuff[i].stats_number_of_comments + "</p><br><p class=\"popisekvidea02\">You can WATCH and DOWNLOAD HD VIDEO version of this video at <a href=\"" + stuff[i].url + "\" target=\"_blank\">" + stuff[i].url + "</a><br>Uploaded: " + stuff[i].upload_date + "</p></td></tr></table><br><br>";
}


} 


// this is just a fancy way of loading the javascript from vimeo.
function initPage() {

// user name of clips to load
var vimeoUserName = "TIE";

// we need to tell vimeo which function to call
var myVimeoCallback = "showMyThumbs";

// ok, set up the url
var url = "http://vimeo.com/api/" + vimeoUserName + "/clips/js";
url += "?callback=" + myVimeoCallback;

var js = document.createElement("script");
js.setAttribute("language", "JavaScript");
js.setAttribute("type", "text/javascript");
js.setAttribute("src", url);
document.getElementsByTagName("head").item(0).appendChild(js);
}

// setup the onload
window.onload = initPage;
