function getVideoInformation(hash,callback){var url='http://gdata.youtube.com/feeds/api/videos/'+hash+'?v=2&alt=jsonc&callback=?';$.getJSON(url,function(result){callback(result,hash)})}
function setVideoImage(result,hash){$('#videoImage').attr('src',result.data.thumbnail.hqDefault);var height=191,top=(height-116)/2;$('#videoImage').css('top','-'+top+'px')}
function setVideoTitle(result,hash){$('#playlist_title').html(result.data.title)}
function getUserVideos(username,callback){var url='http://gdata.youtube.com/feeds/api/users/'+username+'/uploads?alt=json&callback=?';$.getJSON(url,function(result){callback(result,username)})}
function processUserVideos(result){if(result){var html='';for(var i in result.feed.entry){var hash=result.feed.entry[i].id.$t.replace('http://gdata.youtube.com/feeds/api/videos/','');html+='<option value="'+hash+'"';if(hash==currentVideoHash)html+=' selected="selected"';html+='>'+result.feed.entry[i].title.$t+'</option>'};$('#youtubeList').append(html)}}
function getLastVideoFromPlaylist(playlist_id,el_id){var url='http://gdata.youtube.com/feeds/api/playlists/'+playlist_id+'?v=2&max-results=1&alt=jsonc&callback=?';$.getJSON(url,function(result){if(result){var hash=result.data.items[0].video.id,res=$('#'+el_id).flash({src:'http://www.youtube.com/v/'+hash,width:292,height:165,allowFullScreen:true,allowscriptaccess:'always'});$('#'+el_id).show()}else $('#'+el_id).hide()})}
