var uid = new Date().getTime();
var flashProxy = new FlashProxy(uid, '/flash/teamTalk.swf');

function runInitialMovie(){
	var htmlStr = "";
	htmlStr += '<div id="colB">';
	htmlStr += '<div id="flashcontent">';
	htmlStr += '<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.';
	htmlStr += '</div>';
	htmlStr += '<ul id="teamTalkCurrent">';
	htmlStr += '<li id="ventasCafaroHigh"><a href="#" onClick="openArchive(\'ventasCafaroHigh\');return false;">Special Announcement<strong> Fast Connection</strong></a></li>';
	htmlStr += '<li id="ventasCafaroLow"><a href="#" onClick="openArchive(\'ventasCafaroLow\');return false;">Special Announcement<strong> Slow Connection</strong></a></li>';
	htmlStr += '<li id="ventasCafaroYouTube"><a href="#" onClick="youTube(\'OJt0lBhgrZE\');return false;">Special Announcement<strong> Streaming</strong></a></li>';
	htmlStr += '</ul>';
	htmlStr += '</div>';
	htmlStr += '<br clear="all" /><xsl:text disable-output-escaping=\'yes\'><![CDATA[&nbsp;]]></xsl:text>';
	document.getElementById('runmove').innerHTML = htmlStr;
	
	var so = new SWFObject("/flash/flvPlayer.swf?imagePath=/images/teamTalk_ventas_dcafaro2.jpg&videoPath=/flash/video/D_Cafaro_announcement.flv&autoStart=false&autoHide=false&autoHideTime=5&hideLogo=true&volAudio=100&newWidth=380&newHeight=300&disableMiddleButton=false&playSounds=true&soundBarColor=0x004953&barColor=0x004953&barShadowColor=0xA1D8E0&subbarColor=0xffffff", "sotester", "380", "300", "9", "#efefef");
	so.addParam("allowFullScreen", "true");
	so.write("flashcontent");		
	initializeNav();
}

function youTube(vidId){
	var htmlStr = "";
	htmlStr += '<div id="youTubeArea">';
	htmlStr += '<object width="380" height="300">';
	htmlStr += '<param name="movie" value="http://www.youtube.com/v/' + vidId + '&hl=en_US&fs=1&rel=0"></param>';
	htmlStr += '<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>';
	htmlStr += '<embed src="http://www.youtube.com/v/' + vidId + '&autoplay=1&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="380" height="300" wmode="transparent"></embed>';
	htmlStr += '</object>';
	htmlStr += '</div>';
	document.getElementById('flashcontent').innerHTML = htmlStr;
	clearNav();
	document.getElementById('ventasCafaroYouTube').style.background = 'url(/images/teamTalkVidNavSelected.gif)';
}
function loadFlash(whichMovie){
	flashProxy.call('myActionScriptFunction',whichMovie);
}
function flashJavaScript_getState(stateClick){
	alert(stateClick);
}
function playLowBandWidth(){

			var s2 = new SWFObject("/flash/teamTalk2.swf","teamTalkPlayList","402","340","7");
			document.getElementById('lowBandwidthLink').style.display = 'none';
			document.getElementById('highBandwidthLink').style.display = 'block';
			document.getElementById('teamTalkPlayer').style.display = 'block';
			document.getElementById('videoArea').innerHTML = "";
			
			s2.addParam("allowfullscreen","true");
			s2.addParam("play","true");
			s2.addVariable("file","/xml/content/teamTalkPlayList.xml");
			s2.addVariable("showicons",'false');
			s2.addVariable("displayheight","300");
			s2.addVariable("backcolor","0x000000");
			s2.addVariable("frontcolor","0xCCCCCC");
			s2.addVariable("lightcolor","0xCCCCCC");
			s2.write("teamTalkPlayer");	
}
function playHighBandWidth(){
			document.getElementById('videoArea').style.display = 'block';
			document.getElementById('lowBandwidthLink').style.display = 'block';
			document.getElementById('highBandwidthLink').style.display = 'none';
			document.getElementById('teamTalkPlayer').style.display = 'none';	
			
			window.location.reload();
}
function openArchive(videoId){
	clearNav();
			
	switch(videoId)
	{
	case 'ventasCafaroHigh':
	  var so = new SWFObject("/flash/flvPlayer.swf?imagePath=images/teamTalk_ventas_dcafaro2.jpg&videoPath=/flash/video/D_Cafaro_announcement.flv&autoStart=false&autoHide=false&autoHideTime=5&hideLogo=true&volAudio=100&newWidth=380&newHeight=300&#x0026;disableMiddleButton=false&playSounds=true&soundBarColor=0x004953&barColor=0x004953&barShadowColor=0xA1D8E0&subbarColor=0xffffff", "sotester", "380", "300", "9", "#efefef");
	  break;    
	
	case 'ventasCafaroLow':
	  var so = new SWFObject("/flash/flvPlayer.swf?imagePath=images/teamTalk_ventas_dcafaro_low2.jpg&#x0026;videoPath=/flash/video/D_Cafaro_announcement_low.flv&#x0026;autoStart=false&#x0026;autoHide=false&#x0026;autoHideTime=5&#x0026;hideLogo=true&#x0026;volAudio=100&#x0026;newWidth=380&#x0026;newHeight=300&#x0026;disableMiddleButton=false&#x0026;playSounds=true&#x0026;soundBarColor=0x004953&#x0026;barColor=0x004953&#x0026;barShadowColor=0xA1D8E0&#x0026;subbarColor=0xffffff", "sotester", "380", "300", "9", "#efefef");
	  break;	
	
 
	default:
	  alert('videoId not passed');
	}

	document.getElementById(videoId).style.background = 'url(/images/teamTalkVidNavSelected.gif)';
	
	so.addParam("allowFullScreen", "true");
	so.write("flashcontent");
}
function clearNav(){
	document.getElementById('ventasCafaroHigh').style.background = 'url(/images/teamTalkVidNav.gif)';
	document.getElementById('ventasCafaroLow').style.background = 'url(/images/teamTalkVidNav.gif)';
	document.getElementById('ventasCafaroYouTube').style.background = 'url(/images/teamTalkVidNav.gif)';
}
function initializeNav(){
	document.getElementById('ventasCafaroHigh').style.background = 'url(/images/teamTalkVidNavSelected.gif)';
}
