var browser = window.navigator.appName;
var versao = window.navigator.appVersion;
var versao = window.navigator.appVersion.substr(22,1);
var fechado;

//var URLVIDEO = "http://streaming.dh-c.com.br/cvrd/Vale_ing_web_final.wmv"
//var URLVIDEO = "http://www.vale.com/vale_us/media/video_lancamento_Vale_eng.wmv"
var URLVIDEO = "mms://valevideo.cvrd.com.br/VALIA/MEETING INGLES.wmv"

// Função para alternar entre Play e Pause
var parado="on";var cont;
function playOrPause(){
	//document.getElementById("vol").style.display="block"
	document.WMPlay.Play();
	
}


// Stop no video!
function videoStop(){ 
	document.WMPlay.Stop();
	document.getElementById("btStop").src="/vale/templates/htm/vale/img/img_bt_play_stop.jpg";
}

// Volume do vídeo
function UpVolumeClick()
{
if (document.WMPlay.Volume <= -300) 
		document.WMPlay.Volume = document.WMPlay.Volume + 400;
}

function DownVolumeClick()
{
if ( document.WMPlay.Volume >= -8000) 
		document.WMPlay.Volume = document.WMPlay.Volume - 400;
}

// Inicia o player!
function iniciar(){ 
	mostraAba(1,'parar');
	
	if(browser=="Netscape"){
	document.getElementById("controls").style.display='none';
	}else{
	document.getElementById("controls").style.display='block';
	setTimeout ("playOrPause()", 3000 ); 
	}
	


	document.getElementById("flashVideo").style.display='block';
	var posicaoX = ((screen.width/2)-160)-35
	
	if(versao==6){
		var posicaoY = 320
	}else{
		var posicaoY = 325
	}
	
	document.getElementById("flashVideo").style.left = posicaoX + "px"
	document.getElementById("flashVideo").style.top = posicaoY + "px"
}

// Fecha o player
function fechaPlayer(){ 
	document.getElementById("flashVideo").style.display="none"
	videoStop()
	fechado="sim"
}

function player(){
	document.writeln('<OBJECT width="320" height="240" ID="WMPlay" name="WMPlay" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Carregando..." TYPE="application/x-oleobject">');
	document.writeln('<PARAM NAME="FileName" VALUE="'+URLVIDEO+'">');
	document.writeln('<PARAM NAME="AutoStart" VALUE="False">');
	document.writeln('<PARAM NAME="ShowDisplay" VALUE="False">')
	document.writeln('<PARAM NAME="ShowControls" VALUE="False">');
	document.writeln('<PARAM NAME="ShowStatusBar" VALUE="True">');
	document.writeln('<PARAM NAME="ShowTracker" VALUE="falses">');


/*document.write("<object name='WMPlay' id='WMPlay' width=0 height=0 classid='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F'   codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'	type='application/x-oleobject' vspace=0 hspace=0 align='absbottom' border=0 width=320 height=240><param name='FileName' value='"+URLVIDEO+"'><param name='TransparentAtStart' value='true'><param name='ShowControls' value=0><param name='ShowDisplay' value='0'><param name='ShowStatusBar' value=1><param name='AutoSize' value='0'><param name='AutoStart' value='0'><param name='AnimationAtStart' value='False'><param name='border' value=0><param name='width' value=320><param name='height' value=240>")*/

	 if(browser=="Netscape"){
		 	document.writeln('<embed name="WMPlay1" ');
			document.writeln('type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/default.asp?DispLang=br" ');
			document.writeln('filename="'+URLVIDEO+'" ');
			document.writeln('src="'+URLVIDEO+'" ');
			document.writeln('ShowControls=1 ');
			document.writeln('ShowDisplay=0 ');
			document.writeln('ShowStatusBar=0 ');
			document.writeln('ShowTracker=0 ');
			document.writeln('width=320 height=280>');
			document.writeln('</embed>');
	/*document.write('<embed type="application/x-mplayer2" pluginspage="http://download.microsoft.com/download/winmediaplayer/nsplugin/6.4/WIN98/EN-US/wmpplugin.exe" src="'+URLVIDEO+'" NAME=WMPlay AUTOSTART=false ShowControls=1 ShowStatusBar=1 displaysize=0 width=320 height=280></embed>')*/
	}else{
			document.writeln('<embed name="WMPlay1" ');
			document.writeln('type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/default.asp?DispLang=br" ');
			document.writeln('filename="'+URLVIDEO+'" ');
			document.writeln('src="'+URLVIDEO+'" ');
			document.writeln('ShowControls=0 ');
			document.writeln('ShowDisplay=0 ');
			document.writeln('ShowStatusBar=0 ');
			document.writeln('ShowTracker=0 ');
			document.writeln('width=320 height=240>');
			document.writeln('</embed>');
	/*document.write('<embed type="application/x-mplayer2" pluginspage="http://download.microsoft.com/download/winmediaplayer/nsplugin/6.4/WIN98/EN-US/wmpplugin.exe" src="'+URLVIDEO+'" NAME=WMPlay AUTOSTART=false ShowControls=0 ShowStatusBar=1 displaysize=0 width=320 height=240></embed>')*/
	}
	
	document.write('</object>')
	carregado = "sim"
	
}