function getVideoData(videoId) {
	$.getScript('http://gdata.youtube.com/feeds/api/videos/'+encodeURIComponent(videoId)+'?v=2&alt=json-in-script&callback=videoCallback');
	
    var html = '';
    html += '<object width="575" height="350">';
    html += '<param id="param" name="movie" value="http://www.youtube.com/v/'+videoId+'&fs=1&"></param>';
    html += '<param name="allowFullScreen" value="true"></param>';
    html += '<param name="allowscriptaccess" value="always"></param>';
    html += '<embed id="embed" src="http://www.youtube.com/v/'+videoId+'&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="575" height="350"></embed>';
    html += '</object>';
    $("#movie").html(html);
    
}
function videoCallback(data) {
	
	var title = data.entry["title"].$t;
	var desc = data.entry["media$group"]["media$description"].$t.replace(/\n/g, '<br/>');
	
	$('#movie-title').html(title);
	//$('#movie-description').html(desc);
	$('#movie-author-name').html(data.entry["author"][ 0 ].name.$t);
	//$('#movie-url').html(data.entry["media$group"]["media$player" ].url);
	$('#movie-published').html(new Date( data.entry[ "published" ].$t.substr( 0, 4 ), data.entry[ "published" ].$t.substr( 5, 2 ) - 1, data.entry[ "published" ].$t.substr( 8, 2 ) ).toLocaleDateString( ));
	$('#movie-rating').html(new Number( data.entry[ "gd$rating" ].average ).toFixed( 1 ) + ' out of ' + data.entry[ "gd$rating" ].max + '; ' + data.entry[ "gd$rating" ].numRaters + ' rating(s)');
	
}

