
var yt = null;

function embedYouTubeVideoWithIdInNode(videoId,nodeId,autoPlay){
//	swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);


    var playerId = nodeId;
    
	var params = { allowScriptAccess: "always" };
    var atts = { id: nodeId , rel: videoId };
    

    
	swfobject.embedSWF(
//		"http://www.youtube.com/apiplayer?enablejsapi=1&version=3&playerapiid=" + playerId,
		"http://www.youtube.com/v/" + videoId + "?rel=0&showsearch=0&showinfo=0&enablejsapi=1&color1=ffffff&color2=ffffff&playerapiid="+playerId
		+'&autoplay=' + (autoPlay ? 1 : 0)
		,
		nodeId,
		"640",
		"385",
		"8.0.0",
		null,//express
		null,//flashvars
		params,//params
		atts//attributes
	);	
}


function onYouTubePlayerReady(playerId) {

	yt = document.getElementById(playerId);
	videoId = yt.getAttribute('rel');

	if (null == videoId)
		return;

	
//	if (null != &&  autoPlay)
//		yt.cueVideoById(videoId);
		
//  1. load the video/cue it up.. 
//	2. set up a timer.. for a scrubber???
//	3. add event handlers .. 
//	4. add buttons and what not..
}
