/*************************************************************
These two functions need to live in global territory because 
the swfobject expects them to. From what I've read, there's
no other way to make this work. The player is going to 
broadcast an onStateChange event 
*************************************************************/	
function onYouTubePlayerReady(playerId){
	ytplayer = document.getElementById('myytplayer');
	ytplayer.addEventListener('onStateChange', 'onytplayerStateChange');
}

function onytplayerStateChange(newState) {
	switch (newState){
		case -1: //unstarted
//			ytplayer.loadVideoById(TUBEFOOT.videoID, 180)
			break;

		case 1: //playing
			YAHOO.util.Dom.setStyle('player_container', 'background-color', 'transparent');
			break;

		case 2: //paused
			break;

		case 3: //buffering
//			var elParam = document.createElement('param')			
//				elParam.setAttribute('wmode', 'transparent');

//			ytplayer.appendChild(elParam);
//			ytplayer.play();
			break;

		case 5: //queued
			break;

		case 0: //ended
			TUBEFOOT.search.moveNext();
			break;
	}
}
